Commit 1a8fca8a by J"orn Rennecke Committed by Joern Rennecke

regmove.c (copy_src_to_dest): Don't copy if that requires (a) new register(s).

	* regmove.c (copy_src_to_dest): Don't copy if that requires
	(a) new register(s).

From-SVN: r22448
parent 905a3d66
Wed Sep 16 14:47:43 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* regmove.c (copy_src_to_dest): Don't copy if that requires
(a) new register(s).
Wed Sep 16 01:29:12 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> Wed Sep 16 01:29:12 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* global.c (reg_allocno): Now static. * global.c (reg_allocno): Now static.
......
...@@ -617,14 +617,25 @@ copy_src_to_dest (insn, src, dest, loop_depth) ...@@ -617,14 +617,25 @@ copy_src_to_dest (insn, src, dest, loop_depth)
&& GET_CODE (dest) == REG && GET_CODE (dest) == REG
&& REG_LIVE_LENGTH (REGNO (dest)) > 0 && REG_LIVE_LENGTH (REGNO (dest)) > 0
&& (set = single_set (insn)) != NULL_RTX && (set = single_set (insn)) != NULL_RTX
&& !reg_mentioned_p (dest, SET_SRC (set)) && !reg_mentioned_p (dest, SET_SRC (set)))
&& validate_replace_rtx (src, dest, insn))
{ {
int old_num_regs = reg_rtx_no;
/* Generate the src->dest move. */ /* Generate the src->dest move. */
start_sequence (); start_sequence ();
emit_move_insn (dest, src); emit_move_insn (dest, src);
seq = gen_sequence (); seq = gen_sequence ();
end_sequence (); end_sequence ();
/* If this sequence uses new registers, we may not use it. */
if (old_num_regs != reg_rtx_no
|| ! validate_replace_rtx (src, dest, insn))
{
/* We have to restore reg_rtx_no to its old value, lest
recompute_reg_usage will try to compute the usage of the
new regs, yet reg_n_info is not valid for them. */
reg_rtx_no = old_num_regs;
return;
}
emit_insn_before (seq, insn); emit_insn_before (seq, insn);
move_insn = PREV_INSN (insn); move_insn = PREV_INSN (insn);
p_move_notes = &REG_NOTES (move_insn); p_move_notes = &REG_NOTES (move_insn);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment