This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Defining LEGITIMIZE_ADDRESS?
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Anders Ådland <aaadland at atmel dot no>
- Cc: gcc at gcc dot gnu dot org
- Date: 23 Aug 2003 13:14:48 -0700
- Subject: Re: Defining LEGITIMIZE_ADDRESS?
- References: <opruc00faa4anuxc@store>
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>