re PR target/33132 (m32r: ICE: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in insn_current_length, at insn-attrtab.c:29)

PR target/33132
* config/m32r/constraints.md: Add W constraint for integer zero.
* config/m32r/m32r.md (get_pc): Use W and i constraints.
  Fix length calculation by using alternatives.

From-SVN: r127992
This commit is contained in:
Nick Clifton 2007-08-31 14:27:19 +00:00 committed by Nick Clifton
parent 62442ab9cb
commit 3681df8fe1
3 changed files with 20 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2007-08-31 Nick Clifton <nickc@redhat.com>
PR target/33132
* config/m32r/constraints.md: Add W constraint for integer zero.
* config/m32r/m32r.md (get_pc): Use W and i constraints.
Fix length calculation by using alternatives.
2007-08-31 Richard Sandiford <richard@codesourcery.com>
* optabs.c (shift_optab_p, commutative_optab_p): New functions,

View File

@ -39,6 +39,7 @@
;; S is for stores with pre {inc,dec}rement
;; T is for indirect of a pointer.
;; U is for loads with post increment.
;; W is used for an immediate value of 0.
;;
;; Register constraints
@ -128,3 +129,9 @@
"A load with post increment."
(and (match_code "mem")
(match_test "LOAD_POSTINC_P (GET_MODE (op), XEXP (op, 0))")))
(define_constraint "W"
"zero immediate."
(and (match_code "const_int")
(match_test "ival == 0")))

View File

@ -2637,19 +2637,14 @@
(define_insn "get_pc"
[(clobber (reg:SI 14))
(set (match_operand 0 "register_operand" "=r")
(set (match_operand 0 "register_operand" "=r,r")
(unspec [(match_operand 1 "" "")] UNSPEC_GET_PC))
(use (match_operand:SI 2 "immediate_operand" ""))]
(use (match_operand:SI 2 "immediate_operand" "W,i"))]
"flag_pic"
"*
{
if (INTVAL(operands[2]))
return \"bl.s .+4\;ld24 %0,%#%1\;add %0,lr\";
else
return \"bl.s .+4\;seth %0,%#shigh(%1)\;add3 %0,%0,%#low(%1+4)\;add %0,lr\";}"
[(set (attr "length") (if_then_else (ne (match_dup 2) (const_int 0))
(const_int 8)
(const_int 12)))])
"@
bl.s .+4\;seth %0,%#shigh(%1)\;add3 %0,%0,%#low(%1+4)\;add %0,lr
bl.s .+4\;ld24 %0,%#%1\;add %0,lr"
[(set_attr "length" "12,8")])
(define_expand "builtin_setjmp_receiver"
[(label_ref (match_operand 0 "" ""))]