RFA: Fix ICE in MN10300's address_cost function

Jeff Law law@redhat.com
Thu Oct 1 14:39:00 GMT 2009


On 10/01/09 07:13, Paolo Bonzini wrote:
> On 10/01/2009 11:14 AM, Nick Clifton wrote:
>> Hi Jeff,
>>
>>>> * config/mn10300/mn10300.c (mn10300_address_cost_1): Treat
>>>> CONST_DOUBLEs like CONSTs.
>>> So the obvious question, how in the world did we get a CONST_DOUBLE
>>> appearing as an address?
>>
>> Well yes, that is a very good point. The address_cost() function is
>> being called from loop_invariant.c:create_new_invariant() which has
>> extracted the source from this insn:
>>
>> (set (reg:DF 1176)
>> (const_double:DF 0 [0x0] 0.0 [0x0.0p+0]))
>>
>> So I guess the question is: why does create_new_invariant think that it
>> has an address at this point. I do not know. Maybe it is just assuming
>> that it might have an address, and so it computes the address cost in
>> case it is needed later on ?
>
> Yes, but this is useless.  Just make it
>
>   inv->cheap_address =
>     (memory_address_p (word_mode, SET_SRC (set)
> && address_cost (SET_SRC (set), word_mode,
>                       speed) < COSTS_N_INSNS (1));
I think I'd prefer something like Paolo's solution -- I wouldn't be 
terribly surprised if other ports don't handle CONST_DOUBLE.

Jeff




More information about the Gcc-patches mailing list