Georg-Johann Lay schrieb:
Denis Chertykov schrieb:
2011/6/9 Georg-Johann Lay <a...@gjlay.de>:
This is a tentative patch to fix PR46779 and hopefully also related
issues like PR45291.
- /* Disallow QImode in stack pointer regs. */
- if ((regno == REG_SP || regno == (REG_SP + 1)) && mode == QImode)
+ /* Don't allocate data to non-GENERAL_REGS registers. */
+
+ if (regno >= 32)
return 0;
I think that we not need in this code.
GCC core must bother about this.
I am unsure about that. There is the "q" constraint that is used for
SP. register_operand will accept SP because regno_reg_class does not
return NO_REGS for SP. So something must stop the register allocator
from allocating ordinary data to SP.
In the current md there is "*movhi_sp" insn prior to "*movhi" insn.
Besides that it is strongly discouraged to have more than one move
insn for one mode, not each and every place looks at insn conditions.
Moreover, if there is an insn like
(set (reg:HI 100)
(reg:HI 101))
that matches "*movhi", what will keep IRA from allocating one of the
values to SP, i.e. chose alternative "q,r" or "r,q"?
Ok, SP is a fixed register, I missed that above :-)
For the "*movhi_sp" I will provide a patch too as soon as I find the time.
Johann