This is the mail archive of the gcc-patches@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]

Re: [PATCH] REG_EQUAL notes on cond_jumps.


On Wed, 14 May 2003, Andrew Pinski wrote:
> > A more accurate example is:
> >
> > void foo()
> > {
> >   int a = 10;
> >   int b = 20000;
> >   int c;
> >
> >   for(c=0; c<1000; c++)
> >     if (a < b)
> >       link_error();
> > }
>
> I think you comparison is swapped but this case actually still does
> the right thing.


Doh!  Yep, you're right about the comparison being swapped, sorry.
However this test case really does fail on PA-Risc with mainline CVS.

[For the reasons why some optimizations are applied on some platforms
and not on others, see my current discussion with Geoff Keating.  Its
impossible to extrapolate that because GCC's GCSE can optimize a test
for one target, that it can also do if for another].


> I have a fix (in GCSE) posted at:
> <http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00268.html>

I can't approve anything, of course, but I think your patch looks good.
Indeed the irony is that I introduced gcse_constant_p to fix the above
example on PPC: http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01527.html
You'll see that that message even refers to this thread, i.e. "REG_EQUAL
notes on cond_jumps" :>

Roger
--


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