This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/53465] [4.7 regression] wrong code with -O1 -ftree-vrp


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]