https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115805
Bug ID: 115805
Summary: 436.cactusADM and 507.cactuBSSN_r miscompilation with
-O2 generic -flto and some hardening options
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: pheeck at gcc dot gnu.org
Blocks: 26163
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
I have observed that the 436.cactusADM and 507.cactuBSSN_r CPU SPEC benchmarks
report miscompilation when compiled with the current trunk GCC with the
following options
-O2 -g -flto=128 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong
-funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection
436.cactusADM reports this
0106: INFO (PUGH): Size: 120 120 120
INFO (PUGH): 120
^
507.cactuBSSN_r reports this
0092: INFO (PUGH): Size: 84 84 84
INFO (PUGH): 84
^
I have seen this on Zen4 and Zen3 machines. I haven't tested this on other
architectures.
I have also found pr115256 and wondered if this isn't the same problem.
However, this problem persists even with -fno-strict-aliasing.
I haven't yet found any commit where this issue isn't present. This is the
oldest commit I found where this issue is present: r15-570-gbff532827515b2
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
[Bug 26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)