This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/35135] unable to find a register to spill in class ‘GENERAL_REGS’ with global registers
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Feb 2008 18:48:00 -0000
- Subject: [Bug target/35135] unable to find a register to spill in class ‘GENERAL_REGS’ with global registers
- References: <bug-35135-12049@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2008-02-12 18:48 -------
The new testcase works for me with older releases (-O2 is enough), but 2.95.4
fails as well. The difference from 4.2 to 4.3 is that 4.2 uses two induction
variables, while 4.3 uses one. After lreg 4.2 has
(insn 21 19 22 3 (set (reg:DI 68)
(mem:DI (plus:SI (plus:SI (reg:SI 64 [ ivtmp.44 ])
(reg/v/f:SI 67 [ ptr ]))
(const_int 160 [0xa0])) [0 S8 A64])) 80 {*movdi_2} (nil)
(expr_list:REG_EQUIV (mem:DI (plus:SI (plus:SI (reg:SI 64 [ ivtmp.44 ])
(reg/v/f:SI 67 [ ptr ]))
(const_int 160 [0xa0])) [0 S8 A64])
(nil)))
(insn 22 21 23 3 (set (mem/s/j:DI (reg/f:SI 63 [ ivtmp.51 ]) [0 <variable>._q+0
S8 A8])
(reg:DI 68)) 80 {*movdi_2} (insn_list:REG_DEP_TRUE 21 (nil))
(expr_list:REG_DEAD (reg:DI 68)
(nil)))
(insn 23 22 24 3 (parallel [
(set (reg:SI 64 [ ivtmp.44 ])
(plus:SI (reg:SI 64 [ ivtmp.44 ])
(const_int 16 [0x10])))
(clobber (reg:CC 17 flags))
]) 216 {*addsi_1} (nil)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
(insn 24 23 26 3 (parallel [
(set (reg/f:SI 63 [ ivtmp.51 ])
(plus:SI (reg/f:SI 63 [ ivtmp.51 ])
(const_int 16 [0x10])))
(clobber (reg:CC 17 flags))
]) 216 {*addsi_1} (nil)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
...
while 4.3 ends up with
(insn 14 13 15 3 t.c:25 (set (reg:DI 67)
(mem:DI (plus:SI (plus:SI (reg/v/f:SI 66 [ ptr ])
(reg:SI 63 [ ivtmp.15 ]))
(const_int 160 [0xa0])) [0 S8 A64])) 88 {*movdi_2}
(expr_list:REG_EQUIV (mem:DI (plus:SI (plus:SI (reg/v/f:SI 66 [ ptr ])
(reg:SI 63 [ ivtmp.15 ]))
(const_int 160 [0xa0])) [0 S8 A64])
(nil)))
(insn 15 14 16 3 t.c:25 (set (mem/s/j:DI (plus:SI (reg/v/f:SI 65 [ env ])
(reg:SI 63 [ ivtmp.15 ])) [0 <variable>._q+0 S8 A8])
(reg:DI 67)) 88 {*movdi_2} (expr_list:REG_DEAD (reg:DI 67)
(nil)))
(insn 16 15 18 3 t.c:25 (parallel [
(set (reg:SI 63 [ ivtmp.15 ])
(plus:SI (reg:SI 63 [ ivtmp.15 ])
(const_int 16 [0x10])))
(clobber (reg:CC 17 flags))
]) 249 {*addsi_1} (expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
Or before expand for 4.2:
<bb 2>:
ivtmp.51 = (unsigned int) &env->xmm_regs[0]._q[0];
ivtmp.44 = 0;
<L0>:;
MEM[index: ivtmp.51] = MEM[base: ptr, index: ivtmp.44, offset: 160];
ivtmp.44 = ivtmp.44 + 16;
ivtmp.51 = ivtmp.51 + 16;
if (ivtmp.44 != 128) goto <L0>; else goto <L2>;
<L2>:;
return;
while 4.3 starts with:
<bb 2>:
ivtmp.15 = 0;
<bb 3>:
MEM[base: env, index: ivtmp.15] = MEM[base: ptr, index: ivtmp.15, offset:
160];
ivtmp.15 = ivtmp.15 + 16;
if (ivtmp.15 != 128)
goto <bb 3>;
else
goto <bb 4>;
<bb 4>:
return;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35135