Sharing hard registers
Fri Jun 14 03:21:00 GMT 2002

In message <>, "David S. Miller" write
 >    From: Jan Hubicka <>
 >    Date: Fri, 14 Jun 2002 11:59:16 +0200
 >    Pseudo registers are always shared.
 > I thought reload rewrites individual pseudo REG rtx expressions as it
 > performs spills/reloads, and therefore each pseudo instance must be
 > unique and not shared.
Pseudos are modified in-place and this requirement implies that pseudos must be
shared.  ie, when we change a pseudo to a mem because it did not get a hard
register, we modify the rtx for the reg in-place to make it a mem and we 
expect that doing so will fix all references to the pseudo.  Similarly when
we assign a hard register to a pseudo -- we modify REGNO (pseudo) and expect
that all references will be updated with the new pseudo.

The latter is the reason why I think we can make shared hard regs work -- the
compiler already has to deal with shared hard regs after reload.  The only
code that should cause us problems is stuff generated in the prologue/epilogue
expanders by the backend.


More information about the Gcc-patches mailing list