pa-protos.h (reg_before_reload_operand): New function prototype.
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Mon, 21 Jan 2002 22:57:49 +0000 (22:57 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Mon, 21 Jan 2002 22:57:49 +0000 (22:57 +0000)
* pa-protos.h (reg_before_reload_operand): New function prototype.
* pa.c (reg_before_reload_operand): New function implementation.
* pa.md (decrement_and_branch_until_zero, movb): Use it.  Change "!*m"
contraints to "*m".

From-SVN: r49058

gcc/ChangeLog
gcc/config/pa/pa-protos.h
gcc/config/pa/pa.c
gcc/config/pa/pa.md

index 33de54d7b39cbfd9d6869f82904d32c176999948..513425dcf8cddf59cfdf00e31b19b6efa7a6554a 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-21  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * pa-protos.h (reg_before_reload_operand): New function prototype.
+       * pa.c (reg_before_reload_operand): New function implementation.
+       * pa.md (decrement_and_branch_until_zero, movb): Use it.  Change "!*m"
+       contraints to "*m".
+
 2002-01-21  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * combine.c (simplify_and_const_int): Properly sign-extend CONSTOP.
index e3487e5a0181f9b80a6af3fe73d48c0b5efa393f..0c81ae0681483820de1e30a41dcc03347dce9aa3 100644 (file)
@@ -1,5 +1,5 @@
 /* Prototypes for pa.c functions used in the md file & elsewhere.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -83,6 +83,7 @@ extern int ior_operand PARAMS ((rtx, enum machine_mode));
 extern int arith32_operand PARAMS ((rtx, enum machine_mode));
 extern int uint32_operand PARAMS ((rtx, enum machine_mode));
 extern int reg_or_nonsymb_mem_operand PARAMS ((rtx, enum machine_mode));
+extern int reg_before_reload_operand PARAMS ((rtx, enum machine_mode));
 extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode));
 extern int reg_or_0_or_nonsymb_mem_operand PARAMS ((rtx, enum machine_mode));
 extern int pre_cint_operand PARAMS ((rtx, enum machine_mode));
index fd2099fa6ebbd776f8715438526da6d7dd8a5a60..40fe3dab139f41c9bb47b8252cd401450e517417 100644 (file)
@@ -364,6 +364,28 @@ reg_or_0_or_nonsymb_mem_operand (op, mode)
   return 0;
 }
 
+/* Return 1 if the operand is a register operand or a non-symbolic memory
+   operand after reload.  This predicate is used for branch patterns that
+   internally handle register reloading.  We need to accept non-symbolic
+   memory operands after reload to ensure that the pattern is still valid
+   if reload didn't find a hard register for the operand.  */
+
+int
+reg_before_reload_operand (op, mode)
+    register rtx op;
+    enum machine_mode mode;
+{
+  if (register_operand (op, mode))
+    return 1;
+
+  if (reload_completed
+      && memory_operand (op, mode)
+      && ! symbolic_memory_operand (op, mode))
+    return 1;
+
+  return 0;
+}
+
 /* Accept any constant that can be moved in one instructions into a
    general register.  */
 int
index 09dd2ff470cb131a0d7734383644a8c473089fad..846cc49fc72ace26332d58995a469c5018f960d7 100644 (file)
        (if_then_else
          (match_operator 2 "comparison_operator"
           [(plus:SI
-             (match_operand:SI 0 "reg_or_nonsymb_mem_operand" "+!r,!*f,!*m")
+             (match_operand:SI 0 "reg_before_reload_operand" "+!r,!*f,*m")
              (match_operand:SI 1 "int5_operand" "L,L,L"))
            (const_int 0)])
          (label_ref (match_operand 3 "" ""))
           [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)])
          (label_ref (match_operand 3 "" ""))
          (pc)))
-   (set (match_operand:SI 0 "register_operand" "=!r,!*f,!*m,!*q")
+   (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*m,!*q")
        (match_dup 1))]
   ""
 "* return output_movb (operands, insn, which_alternative, 0); "
           [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)])
          (pc)
          (label_ref (match_operand 3 "" ""))))
-   (set (match_operand:SI 0 "register_operand" "=!r,!*f,!*m,!*q")
+   (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*m,!*q")
        (match_dup 1))]
   ""
 "* return output_movb (operands, insn, which_alternative, 1); "