RFA: Fix ICE in MN10300's address_cost function

Nick Clifton nickc@redhat.com
Thu Oct 1 09:14:00 GMT 2009

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 ?


PS. The code in question inside create_new_invariant is this:

   if (def)
       inv->cost = rtx_cost (set, SET, speed);
       inv->cheap_address = address_cost (SET_SRC (set), word_mode,
					 speed) < COSTS_N_INSNS (1);

More information about the Gcc-patches mailing list