diff options
author | spark <spark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-18 20:49:23 +0000 |
---|---|---|
committer | spark <spark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-18 20:49:23 +0000 |
commit | 65a5a1a8a93afdf1e28bb4c1ecb1bd24f1127b3e (patch) | |
tree | d389cd31a3929555328650e9fcad1777bd249ca0 /gcc/gcse.c | |
parent | a0877a20338f2e5dbc1d2162119ea0feba2dd261 (diff) | |
download | gcc-65a5a1a8a93afdf1e28bb4c1ecb1bd24f1127b3e.tar.gz |
2007-06-18 Seongbae Park <seongbae.park@gmail.com>
PR rtl-optimization/32321
* gcse.c (replace_store_insn): Update the note before
calling emit_insn_after.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125827 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index 828ee6b3254..8278714cefe 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -6341,17 +6341,6 @@ replace_store_insn (rtx reg, rtx del, basic_block bb, struct ls_expr *smexpr) mem = smexpr->pattern; insn = gen_move_insn (reg, SET_SRC (single_set (del))); - insn = emit_insn_after (insn, del); - - if (dump_file) - { - fprintf (dump_file, - "STORE_MOTION delete insn in BB %d:\n ", bb->index); - print_inline_rtx (dump_file, del, 6); - fprintf (dump_file, "\nSTORE MOTION replaced with insn:\n "); - print_inline_rtx (dump_file, insn, 6); - fprintf (dump_file, "\n"); - } for (ptr = ANTIC_STORE_LIST (smexpr); ptr; ptr = XEXP (ptr, 1)) if (XEXP (ptr, 0) == del) @@ -6379,6 +6368,20 @@ replace_store_insn (rtx reg, rtx del, basic_block bb, struct ls_expr *smexpr) XEXP (note, 0) = insn; } + /* Emit the insn AFTER all the notes are transferred. + This is cheaper since we avoid df rescanning for the note change. */ + insn = emit_insn_after (insn, del); + + if (dump_file) + { + fprintf (dump_file, + "STORE_MOTION delete insn in BB %d:\n ", bb->index); + print_inline_rtx (dump_file, del, 6); + fprintf (dump_file, "\nSTORE MOTION replaced with insn:\n "); + print_inline_rtx (dump_file, insn, 6); + fprintf (dump_file, "\n"); + } + delete_insn (del); /* Now we must handle REG_EQUAL notes whose contents is equal to the mem; |