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]
Other format: [Raw text]

Re: Sharing hard registers


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



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