This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question regarding regrename and failure of 950704-1.c on main
- From: law at redhat dot com
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: rth at redhat dot com (Richard Henderson), gcc at gcc dot gnu dot org
- Date: Fri, 10 May 2002 13:22:28 -0600
- Subject: Re: question regarding regrename and failure of 950704-1.c on main
- Reply-to: law at redhat dot com
In message <200205101852.g4AIqSqk004647@hiauly1.hia.nrc.ca>, "John David
Anglin" writes:
> I have a mod to HARD_REGNO_MODE_OK that seems to fix the problem.
> I have changed the sets of registers that are HARD_REGNO_MODE_OK
> for DI and TI modes. Argument and return value pairs for DImode
> are now HARD_REGNO_MODE_OK and we never have overlaps with the new
> scheme. This seems to give better code. For example in 950704-1.c
> at -O2, we don't need to copy the argument registers and a frame
> doesn't need to be allocated.
>
> The drawback to this approach is that fewer choices are available.
> How hard would it be to handle arbitrary overlaps and do you think
> there would be a benefit in doing it?
Allowing arbitrary overlaps is going to make a mess of the generated code.
If we allow arbitrary overlaps, then the register allocator will never be
able to tie an input and an output operand together for a DImode operation.
Meaning that for a large number of DImode operations we're going to need to
allocate an extra (and totally unnecessary) register.
I really think we're better off fixing regrename to be a little more careful
about it's actions in respect to HARD_REGNO_MODE_OK.
Twiddling HARD_REGNO_MODE_OK to switch from even regs to odd regs probably
does make sense for the mainline, but not for the branch. We'll still
need some register shuffling for the return value, but it should be less
than the amount we're currently doing for input arguments.
jeff