re PR middle-end/59584 (regressions related to __builtin_stack_restore)
authorHans-Peter Nilsson <hp@axis.com>
Mon, 23 Dec 2013 22:33:52 +0000 (22:33 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 23 Dec 2013 22:33:52 +0000 (22:33 +0000)
PR middle-end/59584
* config/cris/predicates.md (cris_nonsp_register_operand):
New define_predicate.
* config/cris/cris.md: Replace register_operand with
cris_nonsp_register_operand for destinations in all
define_splits where a register is set more than once.

From-SVN: r206187

gcc/ChangeLog
gcc/config/cris/cris.md
gcc/config/cris/predicates.md

index 1f170a6..00b2c21 100644 (file)
@@ -1,3 +1,12 @@
+2013-12-23  Hans-Peter Nilsson  <hp@axis.com>
+
+       PR middle-end/59584
+       * config/cris/predicates.md (cris_nonsp_register_operand):
+       New define_predicate.
+       * config/cris/cris.md: Replace register_operand with
+       cris_nonsp_register_operand for destinations in all
+       define_splits where a register is set more than once.
+
 2013-12-23  Jason Merrill  <jason@redhat.com>
 
        * gdbinit.in (input_line, input_filename): Define.
index 8a7f0bf..b3e9f04 100644 (file)
                      (match_operand:SI 1 "const_int_operand" ""))
             (match_operand:SI 2 "register_operand" ""))])
          (match_operand 3 "register_operand" ""))
-     (set (match_operand:SI 4 "register_operand" "")
+     (set (match_operand:SI 4 "cris_nonsp_register_operand" "")
          (plus:SI (mult:SI (match_dup 0)
                            (match_dup 1))
                   (match_dup 2)))])]
             (match_operand:SI 0 "cris_bdap_operand" "")
             (match_operand:SI 1 "cris_bdap_operand" ""))])
          (match_operand 2 "register_operand" ""))
-     (set (match_operand:SI 3 "register_operand" "")
+     (set (match_operand:SI 3 "cris_nonsp_register_operand" "")
          (plus:SI (match_dup 0) (match_dup 1)))])]
   "reload_completed && reg_overlap_mentioned_p (operands[3], operands[2])"
   [(set (match_dup 4) (match_dup 2))
 ;; up.
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         4 "cris_operand_extend_operator"
         [(match_operand 1 "register_operand" "")
 ;; Call this op-extend-split-rx=rz
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         4 "cris_plus_or_bound_operator"
         [(match_operand 1 "register_operand" "")
 ;; Call this op-extend-split-swapped
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         4 "cris_plus_or_bound_operator"
         [(match_operator
 ;; bound.  Call this op-extend-split-swapped-rx=rz.
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         4 "cris_plus_or_bound_operator"
         [(match_operator
 ;; Call this op-extend.
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         3 "cris_orthogonal_operator"
         [(match_operand 1 "register_operand" "")
 ;; Call this op-split-rx=rz
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         3 "cris_commutative_orth_op"
         [(match_operand 2 "memory_operand" "")
 ;; Call this op-split-swapped.
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         3 "cris_commutative_orth_op"
         [(match_operand 1 "register_operand" "")
 ;; Call this op-split-swapped-rx=rz.
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         3 "cris_orthogonal_operator"
         [(match_operand 2 "memory_operand" "")
 ;; We're not allowed to generate copies of registers with different mode
 ;; until after reload; copying pseudos upsets reload.  CVS as of
 ;; 2001-08-24, unwind-dw2-fde.c, _Unwind_Find_FDE ICE in
-;; cselib_invalidate_regno.
+;; cselib_invalidate_regno.  Also, don't do this for the stack-pointer,
+;; as we don't want it set temporarily to an invalid value.
 
 (define_split ; indir_to_reg_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operand 1 "indirect_operand" ""))]
   "reload_completed
    && REG_P (operands[0])
 ;; As the above, but MOVS and MOVU.
 
 (define_split
-  [(set (match_operand 0 "register_operand" "")
+  [(set (match_operand 0 "cris_nonsp_register_operand" "")
        (match_operator
         4 "cris_extend_operator"
         [(match_operand 1 "indirect_operand" "")]))]
index 040482b..2acd02f 100644 (file)
            (match_test "cris_simple_address_operand (XEXP (op, 0),
                                                      Pmode)"))))
 
+(define_predicate "cris_nonsp_register_operand"
+  (and (match_operand 0 "register_operand")
+       (match_test "op != stack_pointer_rtx")))
+
 ;; The caller needs to use :SI.
 (define_predicate "cris_bdap_sign_extend_operand"
 ; Disabled until <URL:http://gcc.gnu.org/ml/gcc-patches/2005-10/msg01376.html>