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 middle-end/28685] Multiple comparisons are not simplified



------- Comment #14 from rguenther at suse dot de  2010-05-25 08:11 -------
Subject: Re:  Multiple comparisons are not simplified

On Mon, 24 May 2010, sandra at codesourcery dot com wrote:

> ------- Comment #13 from sandra at codesourcery dot com  2010-05-24 13:21 -------
> I'm working on a patch that fixes the test case in comment #5 (originally filed
> as PR 39874) and some other test cases by improving the comparison combination
> logic in both tree-ssa-ifcombine and tree-ssa-reassoc.
> 
> The test case in comment #4 is a somewhat different problem -- maybe it is a
> VRP failure?  The problem is figuring out the right place to attempt to combine
> the comparisons....

In this case it is probably phiopt that could recognize this (though
it does not do the kind of transformation).  It could transform

<bb 2>:
  eq_5 = a_2(D) == b_3(D);
  if (a_2(D) < b_3(D))
    goto <bb 4>;
  else
    goto <bb 3>;

<bb 3>:

<bb 4>:
  # eq_1 = PHI <1(2), eq_5(3)>
  return eq_1;

to

<bb 2>:
  if (a_2(D) <= b_3(D))
    goto <bb 4>;
  else
    goto <bb 3>;

<bb 3>:

<bb 4>:
  # eq_1 = PHI <1(2), 0(3)>
  return eq_1;

and eventually further if-convert that.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28685


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