This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/53465] [4.7 regression] wrong code with -O1 -ftree-vrp
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 24 May 2012 07:42:26 +0000
- Subject: [Bug tree-optimization/53465] [4.7 regression] wrong code with -O1 -ftree-vrp
- Auto-submitted: auto-generated
- References: <bug-53465-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53465
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-24 07:42:26 UTC ---
Dropping all might pessimize some code (of course, this is VR_UNDEFINED, so the
question is if we need to care that much about broken code), like:
int
foo (int x, int y)
{
int z;
if (x <= 3)
return 7;
if (y)
z = x;
return z == x;
}
where the equivalence could be very well kept. Or
int
foo (int y)
{
int z;
int x = bar ();
if (x <= 3)
return 7;
if (y)
z = x;
return z == x;
}
In both cases the x_3 in the equivalence bitmap dominates the PHI stmt (in one
case it is the default parm def, in the second case not). vrp_meet would
probably need to be called with gimple stmt in that case on which the meet
happens.
Anyway, if you think it is overkill, we can just drop the equivalences
altogether.