Commit f251709a by Jan Hubicka Committed by Jan Hubicka

* dce.c (dce_process_block): Do not re-scan already marked instructions.

From-SVN: r160262
parent 8ff49c29
2010-06-04 Jan Hubicka <jh@suse.cz>
* dce.c (dce_process_block): Do not re-scan already marked instructions.
2010-06-04 Bernd Schmidt <bernds@codesourcery.com> 2010-06-04 Bernd Schmidt <bernds@codesourcery.com>
PR rtl-optimization/39871 PR rtl-optimization/39871
......
...@@ -904,19 +904,18 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au) ...@@ -904,19 +904,18 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au)
FOR_BB_INSNS_REVERSE (bb, insn) FOR_BB_INSNS_REVERSE (bb, insn)
if (INSN_P (insn)) if (INSN_P (insn))
{ {
bool needed = false; bool needed = marked_insn_p (insn);
/* The insn is needed if there is someone who uses the output. */ /* The insn is needed if there is someone who uses the output. */
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) if (!needed)
if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec)) for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
|| bitmap_bit_p (au, DF_REF_REGNO (*def_rec))) if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec))
{ || bitmap_bit_p (au, DF_REF_REGNO (*def_rec)))
needed = true; {
break; needed = true;
} mark_insn (insn, true);
break;
if (needed) }
mark_insn (insn, true);
/* No matter if the instruction is needed or not, we remove /* No matter if the instruction is needed or not, we remove
any regno in the defs from the live set. */ any regno in the defs from the live set. */
...@@ -924,7 +923,7 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au) ...@@ -924,7 +923,7 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au)
/* On the other hand, we do not allow the dead uses to set /* On the other hand, we do not allow the dead uses to set
anything in local_live. */ anything in local_live. */
if (marked_insn_p (insn)) if (needed)
df_simulate_uses (insn, local_live); df_simulate_uses (insn, local_live);
} }
......
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