[m68k]: Trouble trying to figure out LEGITIMIZE_RELOAD_ADDRESS

James E Wilson wilson@specifixinc.com
Wed Mar 30 06:44:00 GMT 2005


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



More information about the Gcc mailing list