[Bug tree-optimization/110369] wrong code on x86_64-linux-gnu

2023-06-22 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110369

Alexander Monakov  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #2 from Alexander Monakov  ---
The loop over 'e' is never entered, because 'a' is zero.

[Bug tree-optimization/110369] wrong code on x86_64-linux-gnu

2023-06-22 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110369

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
I don't think it's wrong code:

110369.c:8:9: warning: iteration 2 invokes undefined behavior
[-Waggressive-loop-optimizations]
8 | printf("%d", b[e]);
  | ^~
110369.c:7:21: note: within this loop
7 |   for (e = 0; e < 5; e++) {
  |   ~~^~~

The behavior changed in r14-338.