[Bug c/111319] Wrong code at -O2 on x86_64-linux-gnu

2023-09-07 Thread shaohua.li at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111319 --- Comment #4 from Shaohua Li --- (In reply to Xi Ruoyao from comment #3) > Please try not to create more reports with "not sure if there is UB" esp. > this UB should be obvious, and it's also detectable with > -fsanitize=undefined: > > t.c:13

[Bug c/111319] Wrong code at -O2 on x86_64-linux-gnu

2023-09-07 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111319 Xi Ruoyao changed: What|Removed |Added Resolution|--- |INVALID CC|

[Bug c/111319] Wrong code at -O2 on x86_64-linux-gnu

2023-09-07 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111319 --- Comment #2 from Andrew Pinski --- Also comparing unrelated addresses with >= is undefined.

[Bug c/111319] Wrong code at -O2 on x86_64-linux-gnu

2023-09-07 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111319 --- Comment #1 from Andrew Pinski --- int *h = g; h--; is undefined right away ...