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]

Re: LO_SUM memrefs offsettable ?


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.


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