[Bug c/108439] incorrect optimization with -O2, -O3, -Os

georgmueller at gmx dot net gcc-bugzilla@gcc.gnu.org
Tue Jan 17 21:22:03 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108439

--- Comment #1 from Georg Müller <georgmueller at gmx dot net> ---
Created attachment 54293
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54293&action=edit
reduced test case to give a compile warning, which seems to be incorrect

While trying to reduce the problem and reducing the array size of lb_key to ony
one member (t_crap8-1u64.c), it gives a compile error with -O2, -O3 and -Os
even if the only member gets initialized all the time with the line "lb_key[0]
= 0x1234;".

Also, this compiler warning and execution error is removed by compiling with
-fno-strict-aliasing, but again, this does not look right.


More information about the Gcc-bugs mailing list