This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/61383] [4.8/4.9/4.10 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Jun 2014 13:19:18 +0000
- Subject: [Bug tree-optimization/61383] [4.8/4.9/4.10 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-61383-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61383
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
This very minor variant also misbehaves with 4.7 and 4.6, so before my patch.
An unsafe instruction (1%f) is taken out of a branch in ifcombine.
int a, b = 1, c, d, e, f, g;
int
fn1 ()
{
int h;
for (;;)
{
g = b;
g = g ? 0 : 1 % g;
e = a + 1;
for (; d < 1; d = e)
{
if (f == 0)
h = 0;
else
h = 1 % f;
if (f < 1)
c = 0;
else if (h)
break;
}
if (b)
return 0;
}
}
int
main ()
{
fn1 ();
return 0;
}