This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Problem with EH regs in global register allocation
- From: Michael Matz <matz at suse dot de>
- To: Andreas Krebbel <Andreas dot Krebbel at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Dec 2007 10:00:26 +0100 (CET)
- Subject: Re: [RFC] Problem with EH regs in global register allocation
- References: <20071213182224.GA17989@homer.boeblingen.de.ibm.com>
Hi,
On Thu, 13 Dec 2007, Andreas Krebbel wrote:
> /* If we haven't succeeded yet,
> see if some hard reg that conflicts with us
> was utilized poorly by local-alloc.
> If so, kick out the regs that were put there by local-alloc
> so we can use it instead. */
> if (best_reg < 0 && !retrying
> /* Let's not bother with multi-reg allocnos. */
> && allocno[num].size == 1
> && REG_BASIC_BLOCK (allocno[num].reg) == REG_BLOCK_GLOBAL)
> {
> ...
>
> finds out that r9 would be the best choice for r46 and reassigns r9 to
> r46
Blaeh. There's a similar problem with stack regs on x86. At that time we
solved it by adding a new field to struct allocno. I would do that here
too. Make it a bitfield, and add a new bit for no_eh_regs to not enlarge
the structure too much.
You can then use this in find_reg to either initialize used1 before it's
copied to used2 (the hardreg set of unusable registers), or explicitely
test it only in reuse-local-regs loop.
Ciao,
Michael.