On 03/10/2019 00:01, Segher Boessenkool wrote:
On Wed, Oct 02, 2019 at 10:22:22PM +0100, Richard Sandiford wrote:
My change to the -fipa-ra bookkeeping used ALL_REGS as the supposedly
safe default assumption, but ALL_REGS isn't literally all registers,
just a close approximation.

This caused a bootstrap failure on arm-linux-gnu, where the condition
code register isn't in ALL_REGS and so was being masked out of some
call-clobbered sets.

The documentation says

@findex ALL_REGS
@findex NO_REGS
In general, each register will belong to several classes.  In fact, one
class must be named @code{ALL_REGS} and contain all the registers.  Another
class must be named @code{NO_REGS} and contain no registers.  Often the
union of two classes will be another class; however, this is not required.

so is the arm port wrong, or is the documentation wrong?  I think the arm
port simply forgets to include CC_REG, VFPCC_REG, SFP_REG, AFP_REG:

#define REG_CLASS_CONTENTS                                              \
...
   { 0x00000000, 0x00000000, 0x00000000, 0x00000010 }, /* CC_REG */      \
   { 0x00000000, 0x00000000, 0x00000000, 0x00000020 }, /* VFPCC_REG */   \
   { 0x00000000, 0x00000000, 0x00000000, 0x00000040 }, /* SFP_REG */     \
   { 0x00000000, 0x00000000, 0x00000000, 0x00000080 }, /* AFP_REG */     \
   { 0xFFFF7FFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F }  /* ALL_REGS */    \

and that last number should be 0x000000ff instead?



Segher


Well CC_REG is completely fixed and can't be used for anything other than condition flags. The register allocator should never be considering it for allocation. So at that level, it really shouldn't matter and adding it would just make more useless work for the register allocator.

The omission of SFP_REG and AFP_REG is probably also deliberate. These are essentially special pseudo regs that MUST be eliminated during frame layout. They should certainly never be considered for general allocation.

R.

Reply via email to