This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71335] [7 Regression] wrong code at -O2 and -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 May 2016 08:37:12 +0000
- Subject: [Bug tree-optimization/71335] [7 Regression] wrong code at -O2 and -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-71335-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71335
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at redhat dot com
--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The return goes away in thread1 pass. Before:
main ()
{
int b;
int a.0_1;
<bb 2>:
<bb 3>:
# b_3 = PHI <0(2), 9(4), 9(3)>
a.0_1 = a;
if (a.0_1 < 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 4>:
if (b_3 != 0)
goto <bb 3>;
else
goto <bb 5>;
<bb 5>:
return 0;
}
after:
main ()
{
int b;
int a.0_1;
int a.0_8;
<bb 2>:
<bb 3>:
# b_3 = PHI <0(2), 9(4), 9(3)>
a.0_1 = a;
if (a.0_1 < 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 4>:
# b_4 = PHI <9(3)>
a.0_8 = a;
goto <bb 3>;
}
The first code still is finite: a is 0 and thus it should execute
BB2->BB3 (b_3=0,a.0_1=0)->BB4->BB5.
Jeff, any idea?