OSDN Git Service

* flow.c (calculate_global_regs_live): Skip for_each_successor_phi
[pf3gnuchains/gcc-fork.git] / gcc / flow.c
index 16f008c..f0cee82 100644 (file)
@@ -3086,8 +3086,9 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
         global_live_at_start, since they are live only along a
         particular edge.  Set those regs that are live because of a
         phi node alternative corresponding to this particular block.  */
-      for_each_successor_phi (bb, &set_phi_alternative_reg, 
-                             new_live_at_end);
+      if (in_ssa_form)
+       for_each_successor_phi (bb, &set_phi_alternative_reg, 
+                               new_live_at_end);
 
       if (bb == ENTRY_BLOCK_PTR)
        {
@@ -3364,6 +3365,15 @@ propagate_one_insn (pbi, insn)
      delete it.  */
   if ((flags & PROP_KILL_DEAD_CODE) && insn_is_dead)
     {
+      /* Record sets.  Do this even for dead instructions, since they
+        would have killed the values if they hadn't been deleted.  */
+      mark_set_regs (pbi, PATTERN (insn), insn);
+
+      /* CC0 is now known to be dead.  Either this insn used it,
+        in which case it doesn't anymore, or clobbered it,
+        so the next insn can't use it.  */
+      pbi->cc0_live = 0;
+
       if (libcall_is_dead)
        {
          prev = propagate_block_delete_libcall (pbi->bb, insn, note);
@@ -3372,11 +3382,6 @@ propagate_one_insn (pbi, insn)
       else
        propagate_block_delete_insn (pbi->bb, insn);
 
-      /* CC0 is now known to be dead.  Either this insn used it,
-        in which case it doesn't anymore, or clobbered it,
-        so the next insn can't use it.  */
-      pbi->cc0_live = 0;
-
       return prev;
     }