[Bug tree-optimization/118900] Wrong code at -O0 on x86_64-linux-gnu

2025-02-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118900 --- Comment #2 from Anonymous --- (In reply to Andrew Pinski from comment #1) > ((&b[1] - (a & ~a)) - a) goes outside of the array bounds of b. so it > becomes undefined, at the second iteration > > But in this case, it just happens the address

[Bug tree-optimization/118900] Wrong code at -O0 on x86_64-linux-gnu

2025-02-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118900 --- Comment #3 from Andrew Pinski --- The undefinedness in this case is recorded as PR 118721 not being able to detected by ubsan. But even then you can still run into issues like this where `&b[2] == &c` at different optimization levels becaus

[Bug tree-optimization/118900] Wrong code at -O0 on x86_64-linux-gnu

2025-02-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118900 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED