This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [RFC:] Support FORBIDDEN_INC_DEC_CLASS (through FORBIDDEN_INC_DEC_CLASSES)


On Wed, 26 Mar 2003, Hans-Peter Nilsson wrote:

> Scenario for work in progress: a machine supports postincrement
> addressing for all general registers except one.  GCC insists on
> postincrementing that register despite the port forbidding
> postincremented use of the register in GO_IF_LEGITIMATE_ADDRESS.
> Sanity check in the port address output functions aborts.

Maybe I'm missing something, but shouldn't this one register be in a
different register class?

> Thankfully, there's infrastructure to handle that case, though
> the current implementation handles only some
> SECONDARY_RELOAD_CLASS cases.  These cases do not match the
> machine in question: the non-postincrementable register can be
> moved to and from memory just as any other register, it's just
> that it can't be used for postincrement addressing.
> 
> Sidenote: why would there be a problem with using postincrement
> on the register even if it isn't movable to/from memory (but can
> otherwise form an address?  I don't understand that part.

If I understand correctly, it's due to inc_for_reload().

It sometimes needs to reload the register used in a post-increment, so it
generates a load, increment, store, and decrement.

Toshi



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