On 05/08/11 02:38, roy rosen wrote: > Hi, > > In my port I have an error: Before ira I have the following insn: > > (insn 3859 4277 4366 57 (set (reg:BI 2038) > (subreg:BI (reg/v:SI 181 [ realsz ]) 3)) 76 {movbi} > (expr_list:REG_EQUAL (const_int 1 [0x1]) > (nil))) > > > During ira this insn is transformed (I guess because reg 181 is spilled) into: > > (insn 5109 5108 4366 57 (set (reg:BI 82 p1 [2038]) > (mem/c:BI (plus:SI (reg/f:SI 79 r31) > (const_int -353 [0xfffffffffffffe9f])) [26 %sfp+-353 > S1 A8])) 77 {movbi_load} > (nil)) > > The problem is that this is an illegal insn since the I don't have an > insn which loads from memory to P registers so I get error: > unrecognizable insn. > I have only insns which load from memory to R register class and insn > that moves from R to P and I expected that to happen. > > I also tried to add to secondary reload things like: > if (rclass == P_REGS && MEM_P(x)) > return R_REGS; > or > if ((rclass == P_REGS) && (((GET_CODE(x) == SUBREG) && MEM_P(XEXP (x, > 0))))) > { > return R_REGS; > } > but it does not seem to help. > Does anyone have any idea what can I do? Presumably r31 is your frame or stack pointer?
reload will replace a pseudo with its equivalent stack location when the pseudo fails to get a hard register. Thus it is often necessary to test reg_equiv_mem (pseudo) to see if a pseudo might be turned into a mem and thus need a secondary reload. jeff