[PATCH] Fix PR 29715, fold produces &a - 4

Richard Guenther richard.guenther@gmail.com
Wed May 2 09:14:00 GMT 2007


On 5/2/07, Andrew Pinski <pinskia@gmail.com> wrote:
> On 3/1/07, Richard Guenther <richard.guenther@gmail.com> wrote:
> > This optimization doesn't look too useful at all now that we gimplify all this
> > post/preinc/decrement anyway.  This is actually the only place where we look
> > at this operators in fold, so I suggest removing the whole
> > transformation instead.
>
> Like this?  I agree that this is no longer needed as we do
> gimplification and then optimize it later if we can (though sometimes
> we don't because we don't recombined the PLUS with the comparision but
> that is not actually tested :) ).
>
> This is not the first time this code has bought troubles:
> http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00582.html
> http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00575.html
> http://gcc.gnu.org/ml/gcc-patches/2004-03/msg02369.html
>
>
> This was bootstrapped and tested many times on powerpc64-linux-gnu
> with no regressions and built and tested for spu-elf with no
> regressions.

This is ok.

Thanks,
Richard.

> Thanks,
> Andrew Pinski
>
> ChangeLog:
>   * fold-const.c (fold_comparision): Remove the "foo++ == CONST" transformation.
>
>



More information about the Gcc-patches mailing list