This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [m68k]: Trouble trying to figure out LEGITIMIZE_RELOAD_ADDRESS
- From: James E Wilson <wilson at specifixinc dot com>
- To: Peter Barada <peter at the-baradas dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 29 Mar 2005 18:51:55 -0800
- Subject: Re: [m68k]: Trouble trying to figure out LEGITIMIZE_RELOAD_ADDRESS
- References: <20050324020132.8785598473@baradas.org>
Peter Barada wrote:
I'd like to make the reload look like:
(set (reg:SI y) (plus:SI (reg_SI 16) (const_int 32832)))
(set (reg:DF x) (mem:DF (reg:SI y)))
Reload already knows how to make this transformation, so it should not
be necessary to resort to LEGITIMIZE_RELOAD_ADDRESS. This is only
needed for target specific tricks that reload can not and does not know
about.
See the code in find_reloads_address with the comment
/* If we have address of a stack slot but it's not valid because the
displacement is too large, compute the sum in a register.
The problem here seems to be that double_reg_address_ok is true, but you
don't want it to be true. It can only be true if
GO_IF_LEGITIMATE_ADDRESS accept REG+REG+4. Perhaps the problem here is
that a double address reg is OK for integer loads, but not for FP loads,
in which case the double_address_reg_ok logic in reloads needs to be
generalized a bit. Maybe an array based on mode instead of a single
variable? Or maybe just int and fp versions are good enough for now.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com