diff options
author | Richard Henderson <rth@redhat.com> | 2005-05-12 16:52:37 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-05-12 16:52:37 -0700 |
commit | 9325973e950abdec507306238a253d2c6029a0c6 (patch) | |
tree | 70c14f666232110ced2ed02e6c5a232fbed22b2c | |
parent | 8fd1590ca61628b3e9598b51851a1b1e7a8fca7f (diff) | |
download | gcc-9325973e950abdec507306238a253d2c6029a0c6.zip gcc-9325973e950abdec507306238a253d2c6029a0c6.tar.gz gcc-9325973e950abdec507306238a253d2c6029a0c6.tar.bz2 |
function.c (instantiate_virtual_regs_in_insn): Do not simplify addition to move unless dest is a register.
* function.c (instantiate_virtual_regs_in_insn): Do not simplify
addition to move unless dest is a register. Do not skip
instantiation in dest on addition simplification.
From-SVN: r99637
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/function.c | 21 |
2 files changed, 18 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aec423e..4ad9bb4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-05-13 Richard Henderson <rth@redhat.com> + + * function.c (instantiate_virtual_regs_in_insn): Do not simplify + addition to move unless dest is a register. Do not skip + instantiation in dest on addition simplification. + 2005-05-13 Hans-Peter Nilsson <hp@axis.com> * config/cris/cris.c (cris_print_operand) <case 'H'; case diff --git a/gcc/function.c b/gcc/function.c index 059886f..2e2152d 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1317,7 +1317,7 @@ instantiate_virtual_regs_in_insn (rtx insn) { HOST_WIDE_INT offset; int insn_code, i; - bool any_change; + bool any_change = false; rtx set, new, x, seq; /* There are some special cases to be handled first. */ @@ -1374,6 +1374,7 @@ instantiate_virtual_regs_in_insn (rtx insn) } extract_insn (insn); + insn_code = INSN_CODE (insn); /* Handle a plus involving a virtual register by determining if the operands remain valid if they're modified in place. */ @@ -1387,7 +1388,9 @@ instantiate_virtual_regs_in_insn (rtx insn) offset += INTVAL (recog_data.operand[2]); /* If the sum is zero, then replace with a plain move. */ - if (offset == 0) + if (offset == 0 + && REG_P (SET_DEST (set)) + && REGNO (SET_DEST (set)) > LAST_VIRTUAL_REGISTER) { start_sequence (); emit_move_insn (SET_DEST (set), new); @@ -1400,7 +1403,6 @@ instantiate_virtual_regs_in_insn (rtx insn) } x = gen_int_mode (offset, recog_data.operand_mode[2]); - insn_code = INSN_CODE (insn); /* Using validate_change and apply_change_group here leaves recog_data in an invalid state. Since we know exactly what @@ -1411,15 +1413,17 @@ instantiate_virtual_regs_in_insn (rtx insn) *recog_data.operand_loc[1] = recog_data.operand[1] = new; *recog_data.operand_loc[2] = recog_data.operand[2] = x; any_change = true; - goto verify; + + /* Fall through into the regular operand fixup loop in + order to take care of operands other than 1 and 2. */ } } } else - extract_insn (insn); - - insn_code = INSN_CODE (insn); - any_change = false; + { + extract_insn (insn); + insn_code = INSN_CODE (insn); + } /* In the general case, we expect virtual registers to appear only in operands, and then only as either bare registers or inside memories. */ @@ -1503,7 +1507,6 @@ instantiate_virtual_regs_in_insn (rtx insn) any_change = true; } - verify: if (any_change) { /* Propagate operand changes into the duplicates. */ |