Help with reload and naked constant sum causing ICE

Jeff Law law@redhat.com
Wed May 28 20:52:00 GMT 2008


Richard Sandiford wrote:
> Andy H <hutchinsonandy@aim.com> writes:
>>> If L_R_A does nothing with it,
>>> the normal reload handling will first try:
>>>
>>>   (const:HI (plus:HI (symbol_ref:HI ("chk_fail_buf") (const_int 2))))
>>>   
>> This worked just as your described after I added test of 
>> reg_equiv_constant[] inside L_R_A .
>>
>> So I guess that looks like  the fix for bug I posted.
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34641
>>
>> To summarize
>>
>> LEGITIMIZE_RELOAD_ADDRESS should now always check reg_equiv_constant
>> before it trying to do any push_reload of register.
> 
> TBH, I still think AVR is doing far too much in L_R_A.  To quote
> the current version:
[...]
Not only should there be some comments, those comments should clearly 
explain how L_R_A is improving the generated code.  That is LRA's job, 
to implement target specific reload strategies which improve the 
generated code.  If the AVR port is using L_R_A for *correctness*, then 
the AVR port is broken.

Interestingly enough, we've seen a fair amount of commonality in L_R_A 
implementations (particularly in dealing with out-of-range offsets in 
reg+d addressing modes).  It probably wouldn't be terribly difficult to 
factor that code into reload itself and do away with a significant hunk 
of the existing L_R_A implementations.


Jeff



More information about the Gcc mailing list