[PATCH] Fix up cprop to canonicalize PLUS/MINUS with 2 CONSTANT_P arguments (PR rtl-optimization/57915)

Jeff Law law@redhat.com
Sat Feb 1 06:13:00 GMT 2014


On 01/31/14 22:52, Richard Biener wrote:
> On February 1, 2014 12:56:45 AM GMT+01:00, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
>> On Fri, Jan 31, 2014 at 10:28 PM, Jakub Jelinek wrote:
>>
>>> Without this patch, cprop can propagate e.g. a SYMBOL_REF to former
>>> (mem (plus (reg) (const_int)))
>>> making it invalid RTL (as plus of CONSTANT_P arguments must be
>> simplified
>>> or surrounded by CONST).
>>
>> But isn't this true for all non-unary operators? Is covering MINUS and
>> PLUS enough?
>
> AND should be handled as well.  I can't think of any others that might be used with symbol refs.  But yes, in principle you are right.
I think AND is necessary for certain variants of the Alpha.  In theory a 
shift-add might be possible here, but I don't know if it happens in 
practice.

jeff



More information about the Gcc-patches mailing list