summaryrefslogtreecommitdiff
path: root/gcc/targhooks.c
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-25 20:15:27 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-25 20:15:27 +0000
commiteb7c310bd894dda2c2bbd413a6bb067d8f57fa09 (patch)
treed0389a22d27e192ea7e0191376e61570262ecb32 /gcc/targhooks.c
parent5aadc72a41f52bd43fb930b484ddc84945e000c3 (diff)
downloadgcc-eb7c310bd894dda2c2bbd413a6bb067d8f57fa09.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r--gcc/targhooks.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 1d5a7fec42c..afeba1f3f64 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