aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>2002-01-21 22:57:49 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2002-01-21 22:57:49 +0000
commit2e3964763a9c0f12cc15b2b787e3d0ed5c93ca63 (patch)
tree9828f88120bec160ceaa396807c48710a31f7fd9 /gcc
parent3b5708e7e67f0e50a7d67545d898ac69cdbb9846 (diff)
downloadgcc-2e3964763a9c0f12cc15b2b787e3d0ed5c93ca63.zip
gcc-2e3964763a9c0f12cc15b2b787e3d0ed5c93ca63.tar.gz
gcc-2e3964763a9c0f12cc15b2b787e3d0ed5c93ca63.tar.bz2
pa-protos.h (reg_before_reload_operand): New function prototype.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/pa/pa-protos.h3
-rw-r--r--gcc/config/pa/pa.c22
-rw-r--r--gcc/config/pa/pa.md6
4 files changed, 34 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 33de54d..513425d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index e3487e5..0c81ae0 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -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));
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index fd2099f..40fe3da 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -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
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 09dd2ff..846cc49 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -6589,7 +6589,7 @@
(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 "" ""))
@@ -6646,7 +6646,7 @@
[(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); "
@@ -6692,7 +6692,7 @@
[(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); "