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: new register allocator and HARD_REGNO_CALL_PART_CLOBBERED


On May 15, 2003, Michael Matz <matz@suse.de> wrote:

> It doesn't do that.  It's already possible for each call to clobber
> different registers, and this is handled correctly.  Just that insane
> notion of mode-dependent clobbering (which I really think is not necessary
> at all) should ideally be removed alltogether, or at least it should not
> depend on the call itself.

It is not insane.  It makes a lot of sense when you extend an
architecture's register width but maintain the ABI unchanged, such
that existing object or assembly code developed for the old
architecture will still work correctly in the new one, even if linked
with code that takes advantage of the features of the new
architecture.  The old code couldn't possibly preserve say the most
significant 32-bits of a 64-bit register if the register was only
32-bits wide when it was written.

It also makes sense when you have two ISAs co-existing in a single
chip, and only part of registers is accessible in one of the
instruction sets.  The ABI could specify that code in this ISA is
still responsible for somehow preserving the entire register's
contents.  For example, the SH5 ABI requires a 64-bit argument to be
passed in a single 64-bit register, whose upper 32-bits are not
accessible in SHcompact mode.  Similar contortions as those used for
argument passing could be applied to function prologues and epilogues
as well.

Claiming a feature isn't necessary because it's difficult to implement
won't make it go away.  There are ABIs that define registers as
not-entirely-preserved, and if the register allocator doesn't take
this into account, it will generate incorrect or poor code.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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