This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/43940] DOM doesn't propagate constants properly
- From: "steven at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 18 Mar 2012 22:48:49 +0000
- Subject: [Bug tree-optimization/43940] DOM doesn't propagate constants properly
- Auto-submitted: auto-generated
- References: <bug-43940-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43940
--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2012-03-18 22:48:49 UTC ---
With trunk today (r185508), on x86_64-linux at -O2 -fno-tree-vrp:
The .072t.ifcombine dump:
main ()
{
void * p;
<bb 2>:
p_2 = __builtin_malloc (4);
if (p_2 != 0B)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
__builtin_free (p_2);
<bb 4>:
# p_1 = PHI <p_2(2), 0B(3)>
__builtin_free (p_1);
return 0;
}
And the .073t.phiopt1 dump:
main ()
{
void * p;
<bb 2>:
p_2 = __builtin_malloc (4);
if (p_2 != 0B)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
__builtin_free (p_2);
<bb 4>:
# p_1 = PHI <0B(2), 0B(3)>
__builtin_free (p_1);
return 0;
}
And finally the 080t.dom1 dump:
main ()
{
void * p;
<bb 2>:
p_2 = __builtin_malloc (4);
if (p_2 != 0B)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
__builtin_free (p_2);
<bb 4>:
# p_1 = PHI <0B(2), 0B(3)>
GIMPLE_NOP
return 0;
}