http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59017
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- -fno-aggressive-loop-optimizations fixes this. On trunk I get t.c: In function 'main': t.c:59:29: warning: iteration 200000u invokes undefined behavior [-Waggressive-loop-optimizations] x_count += c5_counts[LIM_min_x-1]-c5_counts[x+1]; ^ t.c:35:5: note: containing loop for(int x = 0; x <= LIM; x++) ^ clearly x+1 is out-of bounds for x == LIM.