This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: LO_SUM memrefs offsettable ?
- To: law at cygnus dot com
- Subject: Re: LO_SUM memrefs offsettable ?
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Fri, 22 Jan 1999 08:07:17 +1300 (NZDT)
- Cc: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>, egcs at cygnus dot com
- References: <"13991.2128.712970.417769"@ongaonga.elec.canterbury.ac.nz><6219.916930504@hurl.cygnus.com>
Jeffrey A Law writes:
> If you're going to add a constant to the LO_SUM, then you need to find its
> associated HIGH part and add the constant to the HIGH part too. Else you
> can get inconsistencies. Consider the adddress 0xffff.
OK, that's what I thought was the problem. (Life without boundary
conditions would be so much simpler :-) I'll submit some modified docs.
Rather than adding the constant to the associated HIGH part, I would
have thought that been safer to emit a new load of the modified HIGH
part?
> > offsettable_address_p considers that LO_SUM memrefs are offsettable
> It probably shouldn't.
Do any ports rely on this behaviour or does every port using LO_SUM
have to have a work around for this?
> > yet operand_subword calls plus_constant instead of
> > plus_constant_for_output. This has the effect of generating
> > addresses of the form (PLUS (LO_SUM (REG) (SYMBOL_REF)) (CONST_INT)
> > instead of (LO_SUM (REG) (CONST (SYMBOL_REF) (CONST_INT))).
> Ah, yes, that's the only way to make it work.
So what's the mechanism employed to make this work? Any good examples
to look at?
Michael.