problem in global allocation
Heiko Panther
heiko.panther@web.de
Mon Oct 20 19:06:00 GMT 2003
I'm hunting a bug in the or32-gcc port, which I'm taking to Mac OS X.
The or32 is a 32 bit machine (www.opencores.org), and the gcc compiler
works fine for i86-linux.
In global.c, find_reg:1056 ff, something bad happens. find_reg is
processing a request for a DI, and it finds r31 suitable. I assume it is
not suitable, since there is no r32 to hold the second part of the DI.
I believe the main problem is that TEST_HARD_REG_BIT(used, 32) returns 0
and thus r32 is believed to be available. This happens because "used" of
type HARD_REG_SET is a 32 bit integer, which I assume is legal.
If I am not mistaken, this would generally mean that find_reg() might
yield errors for n-bit targets if the host HARD_REG_SET is not more than
n bits wide. The reason that the x86 port works could be that the
HARD_REG_SET is 64 bit wide there for some reason, but I did not check
that. Did I make a mistake?
My quickly hacked workaround
1066: && TEST_HARD_REG_BIT (~used, j));
seems to do the trick.
Heiko Panther
More information about the Gcc
mailing list