+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
"")
(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))]
}
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