This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59017] Infinite loop introduced in program with -O2 or -O3 on Mageia Linux x86-64 Cauldron with gcc-4.8.2
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 06 Nov 2013 11:42:46 +0000
- Subject: [Bug c/59017] Infinite loop introduced in program with -O2 or -O3 on Mageia Linux x86-64 Cauldron with gcc-4.8.2
- Auto-submitted: auto-generated
- References: <bug-59017-4 at http dot gcc dot gnu dot org/bugzilla/>
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.