This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Defining LEGITIMIZE_ADDRESS?


Anders Ådland <aaadland@atmel.no> writes:

> 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.

You're doing something wrong somewhere else.  The documentation is
correct; these cases get dealt with by reload.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]