diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-09-16 06:49:57 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-09-16 06:49:57 +0000 |
commit | 150c4a53f359ab4796ed3e820e06448366c32352 (patch) | |
tree | 0f820d13dd3772f8291d556437e4e4e2191545b3 /gcc/regmove.c | |
parent | a84642be5616d73f9b264894ffd7189c404200be (diff) | |
download | gcc-150c4a53f359ab4796ed3e820e06448366c32352.tar.gz |
* regmove.c (copy_src_to_dest): Don't copy if that requires
(a) new register(s).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22448 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r-- | gcc/regmove.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c index 8df75e5c8aa..d8dec1faed0 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -617,14 +617,25 @@ copy_src_to_dest (insn, src, dest, loop_depth) && GET_CODE (dest) == REG && REG_LIVE_LENGTH (REGNO (dest)) > 0 && (set = single_set (insn)) != NULL_RTX - && !reg_mentioned_p (dest, SET_SRC (set)) - && validate_replace_rtx (src, dest, insn)) + && !reg_mentioned_p (dest, SET_SRC (set))) { + int old_num_regs = reg_rtx_no; + /* Generate the src->dest move. */ start_sequence (); emit_move_insn (dest, src); seq = gen_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); move_insn = PREV_INSN (insn); p_move_notes = ®_NOTES (move_insn); |