Sharing hard registers

law@redhat.com law@redhat.com
Fri Jun 14 03:21:00 GMT 2002


In message <20020614.030603.82192502.davem@redhat.com>, "David S. Miller" write
s:
 >    From: Jan Hubicka <jh@suse.cz>
 >    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.





jeff




More information about the Gcc-patches mailing list