diff options
author | zadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-10 21:31:59 +0000 |
---|---|---|
committer | zadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-10 21:31:59 +0000 |
commit | a6879b1d1819c9d4761e0d4eada1a48700dfcccd (patch) | |
tree | 6b17aca629fb07f8dd1cd92489d1718c8d612fe2 /gcc/auto-inc-dec.c | |
parent | 1b8215f15a4b69cbe68febe5413b87bc2c1286af (diff) | |
download | gcc-a6879b1d1819c9d4761e0d4eada1a48700dfcccd.tar.gz |
2007-12-10 Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/34302
* auto-inc-dec.c (attempt_change): Change place where move is
inserted.
2007-12-10 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/34302
* gcc.c-torture/execute/20071210-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130751 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/auto-inc-dec.c')
-rw-r--r-- | gcc/auto-inc-dec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c index e59adab2641..2e2d047bf97 100644 --- a/gcc/auto-inc-dec.c +++ b/gcc/auto-inc-dec.c @@ -550,7 +550,10 @@ attempt_change (rtx new_addr, rtx inc_reg) switch (inc_insn.form) { case FORM_PRE_ADD: - mov_insn = insert_move_insn_before (mem_insn.insn, + /* Replace the addition with a move. Do it at the location of + the addition since the operand of the addition may change + before the memory reference. */ + mov_insn = insert_move_insn_before (inc_insn.insn, inc_insn.reg_res, inc_insn.reg0); move_dead_notes (mov_insn, inc_insn.insn, inc_insn.reg0); @@ -673,7 +676,7 @@ try_merge (void) } /* Look to see if the inc register is dead after the memory - reference. If it is do not do the combination. */ + reference. If it is, do not do the combination. */ if (find_regno_note (last_insn, REG_DEAD, REGNO (inc_reg))) { if (dump_file) |