This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/58731] wrong code (hangs) at -O3 on x86_64-linux-gnu
- 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: Tue, 15 Oct 2013 08:13:25 +0000
- Subject: [Bug tree-optimization/58731] wrong code (hangs) at -O3 on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-58731-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58731
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-10-15
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
int a, b, c, d, e;
int
main ()
{
for (b = 4; b > -30; b--)
for (; c;)
for (;;)
{
e = a > 2147483647 - b;
the issue here is that PRE (and LIM) move 2147483647 - b outside the
for (;c;) loop entry test and thus make it always execute in the
outermost loop, triggering the undefined behavior at iteration 5.
Also warns at -O1 with -fstrict-overflow.
PR58134 and PR58227 are related (if not dups).