]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* dce.c (dce_process_block): Do not re-scan already marked instructions.
authorJan Hubicka <jh@suse.cz>
Fri, 4 Jun 2010 13:27:51 +0000 (15:27 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 4 Jun 2010 13:27:51 +0000 (13:27 +0000)
From-SVN: r160262

gcc/ChangeLog
gcc/dce.c

index fa0304ffbd5e8cd685335e47b40adda8f9ea99fb..9063edc4ee92c80b5d0b47d8873cbc92228eadc8 100644 (file)
@@ -1,3 +1,7 @@
+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>
 
        PR rtl-optimization/39871
index 12f3af0760f20421f98ce42640eab01386386370..7191f90414f5c26fbe04539f4aec6aac94dd8112 100644 (file)
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -904,19 +904,18 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au)
   FOR_BB_INSNS_REVERSE (bb, 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.  */
-       for (def_rec = DF_INSN_DEFS (insn); *def_rec; 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;
-           }
-
-       if (needed)
-         mark_insn (insn, true);
+       if (!needed)
+         for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
+           if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec))
+               || bitmap_bit_p (au, DF_REF_REGNO (*def_rec)))
+             {
+               needed = true;
+               mark_insn (insn, true);
+               break;
+             }
 
        /* No matter if the instruction is needed or not, we remove
           any regno in the defs from the live set.  */
@@ -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
           anything in local_live.  */
-       if (marked_insn_p (insn))
+       if (needed)
          df_simulate_uses (insn, local_live);
       }