simplify_plus_minus busted in 4.3

Paolo Bonzini bonzini@gnu.org
Wed Feb 11 15:30:00 GMT 2009


Bernd Schmidt wrote:
> Paolo Bonzini wrote:
>> Paolo Bonzini wrote:
>>> Bernd Schmidt wrote:
>>>> While trying to teach the doloop code new tricks in our Blackfin tree
>>>> based on 4.3, I've noticed that simplify_plus_minus appears to be
>>>> busted.
>>> I will try on 4.4 and let you know.  I remember some fixes going in for
>>> s_p_m; all of them could be backported to your tree, even though some
>>> were unsafe for other targets (they depended on using UNSPECs rather
>>> than MINUSes for things such as PIC access).
>> Here it is (extracted from r142035).  In
>> http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00792.html Zdenek said
>> "simplify-rtx.c:simplify_plus_minus may fail before it actually tries to
>> simplify the expression, so it may e.g. leave (x+y)-y unsimplified" and
>> that seems exactly your case).
>>
>> As I said in the previous email, it is safe for Blackfin even though I
>> am not sure it would be okay for the FSF 4.3 tree.
> 
> It's a regression, and it does affect code generation in a few cases
> I've seen.  So I'd like approval to apply either Paolo's patch or my
> earlier one to the 4.3 tree after testing.

But it caused regressions too (and I think your other patch would do so
as well), on targets that used MINUS instead of UNSPEC for PIC accesses.

Paolo



More information about the Gcc-patches mailing list