aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/cris/cris.md2
-rw-r--r--gcc/targhooks.c11
3 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 580dd53..f26b24a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-11-25 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/cris.md ("reload_out<mode>"): Mark operand 2 as
+ earlyclobber.
+ * targhooks.c (default_secondary_reload): Don't require operand 2
+ for an input reload to be earlyclobber.
+
2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* fold-const.c (negate_mathfn_p): Fix comment and add support
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 37bd4ab..5665897 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -1151,7 +1151,7 @@
"")
(define_expand "reload_out<mode>"
- [(set (match_operand:BW 2 "register_operand" "=r")
+ [(set (match_operand:BW 2 "register_operand" "=&r")
(match_operand:BW 1 "register_operand" "x"))
(set (match_operand:BW 0 "memory_operand" "=m")
(match_dup 2))]
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 1d5a7fe..afeba1f 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -514,10 +514,15 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
}
scratch_constraint = insn_data[(int) icode].operand[2].constraint;
- /* The scratch register's constraint must start with "=&". */
+ /* The scratch register's constraint must start with "=&",
+ except for an input reload, where only "=" is necessary,
+ and where it might be beneficial to re-use registers from
+ the input. */
gcc_assert (scratch_constraint[0] == '='
- && scratch_constraint[1] == '&');
- scratch_constraint += 2;
+ && (in_p || scratch_constraint[1] == '&'));
+ scratch_constraint++;
+ if (*scratch_constraint == '&')
+ scratch_constraint++;
scratch_letter = *scratch_constraint;
scratch_class
= (scratch_letter == 'r' ? GENERAL_REGS