------- Comment #2 from kkojima at gcc dot gnu dot org 2006-11-07 02:37 -------
I've attached a reduced test case which fails also on the cross compiler
with -O2:
foo.c:69: error: insn does not satisfy its constraints:
(insn 232 235 233 9 (set (reg:SI 147 t)
(eq:SI (reg:SI 8 r8 [orig:169 diff ] [169])
(const_int 1 [0x1]))) 1 {cmpeqsi_t} (nil)
(nil))
The .greg dump for it has a cbranchdi4_i insn
(jump_insn:HI 61 222 155 8 (parallel [
(set (pc)
(if_then_else (eq (reg/v:DI 8 r8 [orig:169 diff ] [169])
(reg:DI 1 r1))
(label_ref:SI 82)
(pc)))
(clobber (scratch:SI))
(clobber (reg:SI 147 t))
]) 6 {cbranchdi4_i} (nil)
(expr_list:REG_BR_PROB (const_int 5000 [0x1388])
(nil)))
which is transformed to insns
(insn 232 235 233 9 (set (reg:SI 147 t)
(eq:SI (reg:SI 8 r8 [orig:169 diff ] [169])
(const_int 1 [0x1]))) 1 {cmpeqsi_t} (nil)
(nil))
(jump_insn 233 232 237 9 (set (pc)
(if_then_else (ne (reg:SI 147 t)
(const_int 0 [0x0]))
(label_ref 82)
(pc))) 207 {branch_true} (nil)
(expr_list:REG_BR_PROB (const_int 10000 [0x2710])
(nil)))
at .flow2. With the change of cbranchdi4_i insn_and_split like as
--- ORIG/trunk/gcc/config/sh/sh.md 2006-11-05 10:02:45.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.md 2006-11-07 09:45:27.000000000 +0900
@@ -713,7 +713,7 @@
(define_insn_and_split "cbranchdi4_i"
[(set (pc)
(if_then_else (match_operator 0 "comparison_operator"
- [(match_operand:DI 1 "arith_operand" "r,r")
+ [(match_operand:DI 1 "arith_operand" "r,z")
(match_operand:DI 2 "arith_operand" "rN,i")])
(label_ref (match_operand 3 "" ""))
(pc)))
the reduced test case doesn't fail but the original ifcvt.c fails
with -O2:
../../TMP/trunk/gcc/ifcvt.c:1036: error: unable to find a register to spill in
class 'R0_REGS'
../../TMP/trunk/gcc/ifcvt.c:1036: error: this is the insn:
(jump_insn:HI 324 339 655 42 ../../TMP/trunk/gcc/ifcvt.c:977 (parallel [
(set (pc)
(if_then_else (eq (reg/v:DI 172 [ diff ])
(const_int 1 [0x1]))
(label_ref:SI 345)
(pc)))
(clobber (scratch:SI))
(clobber (reg:SI 147 t))
]) 6 {cbranchdi4_i} (nil)
(expr_list:REG_UNUSED (reg:SI 147 t)
(expr_list:REG_UNUSED (scratch:SI)
(expr_list:REG_BR_PROB (const_int 5000 [0x1388])
(nil)))))
../../TMP/trunk/gcc/ifcvt.c:1036: internal compiler error: in spill_failure, at
reload1.c:1938
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29746