https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108574
Bug ID: 108574 Summary: wrong code at -Os and above on x86_64-linux-gnu Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- It appears to be a recent regression from 12.2. Compiler Explorer: https://godbolt.org/z/4T3xMvsab [578] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/13.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk --enable-sanitizers --enable-languages=c,c++ --disable-werror --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.1 20230127 (experimental) [master r12-4647-g3f861a5c8fd] (GCC) [579] % [579] % gcctk -O3 small.c [580] % ./a.out Floating point exception [581] % [581] % cat small.c int a = 1, b, c = 2, d; int main() { if (b) goto L2; L1: { int e = c; a = 1 % a; while (e && 1 <= d) ; d >= b; L2: if (1 >= e) goto L1; } return 0; }