[cond-optab][patch RFA] Fix bootstrap failure on SH
Kaz Kojima
kkojima@rr.iij4u.or.jp
Thu Apr 9 22:53:00 GMT 2009
Hi,
Bootstrap has failed for sh4-unknown-linux-gnu on cond-optab
revision 145778 at stage2 with
../../INTEST/cond-optab/gcc/tree-ssa-structalias.c: In function 'get_constraint_for_ptr_offset':
../../INTEST/cond-optab/gcc/tree-ssa-structalias.c:2938: error: could not split insn
(jump_insn 174 749 175 ../../INTEST/cond-optab/gcc/tree-ssa-structalias.c:2884 (parallel [
(set (pc)
(if_then_else (ne (reg:DI 5 r5)
(const_int -9223372036854775808 [0x8000000000000000]))
(label_ref 260)
(pc)))
(clobber (reg:SI 7 r7))
(clobber (reg:SI 147 t))
]) 6 {cbranchdi4_i} (expr_list:REG_BR_PRED (const_int 49 [0x31])
(expr_list:REG_UNUSED (reg:SI 147 t)
(expr_list:REG_UNUSED (reg:SI 7 r7)
(expr_list:REG_BR_PROB (const_int 0 [0x0])
(nil))))))
../../INTEST/cond-optab/gcc/tree-ssa-structalias.c:2938: internal compiler error: in final_scan_insn, at final.c:2608
It seems that this is a target problem which is revealed
on that revision of cond-optab branch. sh.md:cbranchdi4_i
define_insn_and_split looks like
(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 2 "arith_operand" "rN,i")])
(label_ref (match_operand 3 "" ""))
(pc)))
(clobber (match_scratch:SI 4 "=X,&r"))
(clobber (reg:SI T_REG))]
"TARGET_CBRANCHDI4"
"#"
...
The failed insn matches the second constraint "i" for
the second operand 0x8000000000000000, but only 8-bit
constants are permitted for non SHmedia targets with
arith_operand which is defined at sh/predicates.md.
I've confirmed that the attached patch fixes the failure
and it doesn't cause any regressions on the cross compiler
for sh4-unknown-linux-gnu. The native bootstrap isn't
completed yet but it's now in the stage3.
OK for cond-optab branch?
Regards,
kaz
--
2009-04-09 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.md (cbranchdi4_i): Use an "I08" constraint
instead of an "i" constraint.
--- cond-optab/gcc/config/sh/sh.md~ 2009-04-07 19:37:50.000000000 +0900
+++ cond-optab/gcc/config/sh/sh.md 2009-04-09 13:23:51.000000000 +0900
@@ -736,7 +736,7 @@
[(set (pc)
(if_then_else (match_operator 0 "comparison_operator"
[(match_operand:DI 1 "arith_operand" "r,r")
- (match_operand:DI 2 "arith_operand" "rN,i")])
+ (match_operand:DI 2 "arith_operand" "rN,I08")])
(label_ref (match_operand 3 "" ""))
(pc)))
(clobber (match_scratch:SI 4 "=X,&r"))
More information about the Gcc-patches
mailing list