Defining LEGITIMIZE_ADDRESS?

Anders Ådland aaadland@atmel.no
Sun Aug 24 00:55:00 GMT 2003


I'm still porting GCC to a new CPU and have a question.

When storing to (mem (pseudo reg)), the pseudo register is replaced by a 
stack slot, (mem (plus (reg fp) (const_int -32776))). Normally this is 
correct, but in this particular example the index is too large for the load 
instruction and therefore not accepted by GO_IF_LEGITIMATE_ADDRESS. This 
results in a "unable to generate reloads" error message.

It would be possible to move the index into a register to make (mem (plus 
(reg fp) (reg))) in LEGITIMIZE_ADDRESS, but is this the right place to do 
it, or am I doing something wrong somewhere else? The documentation is 
telling that "It is safe for this macro (LEGITIMIZE_ADDRESS) to do 
nothing". In my case it's not.

Anders



More information about the Gcc mailing list