[Bug tree-optimization/58731] wrong code (hangs) at -O3 on x86_64-linux-gnu
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 15 08:13:00 GMT 2013
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).
More information about the Gcc-bugs
mailing list