[MDEV-20277] Disable -fno-strict-aliasing Created: 2019-08-07  Updated: 2022-02-03

Status: Open
Project: MariaDB Server
Component/s: Compiling
Fix Version/s: None

Type: Task Priority: Major
Reporter: Eugene Kosov (Inactive) Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: cmake, compile

Issue Links:
PartOf
includes MDEV-20454 Disable -fno-strict-aliasing for InnoDB Open
Relates
relates to MDEV-21981 Replace arithmetic + with bitwise OR ... Closed
relates to MDEV-19386 Broken strict-aliasing rules in /stor... Open

 Description   

-fno-strict-aliasing was added in https://github.com/mariadb/server/commit/c192be206ae36398804b473f7b0e4ee4431b71da

Basically it removes some optimizations: https://godbolt.org/z/dzgsVJ

Violating aliasing rules is UB: https://blog.regehr.org/archives/1520

Some cases can be found with UBSAN's check -fsanitize=alignment Something can be caught by compiler itself: https://jira.mariadb.org/browse/MDEV-19386

So instead of violating C/C++ ISO standards and having less optimizations it's better to honour type system an have more optimizations.


Generated at Thu Feb 08 08:58:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.