]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Actually check in the patch this time!
authorNick Clifton <nickc@gcc.gnu.org>
Tue, 7 Feb 2006 12:29:24 +0000 (12:29 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Tue, 7 Feb 2006 12:29:24 +0000 (12:29 +0000)
From-SVN: r110695

gcc/sched-rgn.c

index b1c457c593abf68b71e74f55ad14e498a84dc823..7107445302285591de8248fa9c065b3bd2e2a67b 100644 (file)
@@ -2078,6 +2078,41 @@ add_branch_dependences (rtx head, rtx tail)
       insn = PREV_INSN (insn);
     }
 
+#ifdef HAVE_cc0
+  /* There may be other cc0 setters earlier on in this block.
+     Look for them and include them in the set not to be disturbed.  */
+  if (insn != head && last != NULL_RTX)
+    {
+      rtx earlier_cc0_setter = NULL_RTX;
+
+      for (insn = last; insn != NULL_RTX && insn != head;)
+       {
+         insn = prev_nonnote_insn (insn);
+         if (sets_cc0_p (insn))
+           earlier_cc0_setter = insn;
+       }
+
+      if (earlier_cc0_setter != NULL_RTX)      
+       {
+         insn = last;
+         do
+           {
+             insn = prev_nonnote_insn (insn);
+
+             if (last != 0 && ! find_insn_list (insn, LOG_LINKS (last)))
+               {
+                 add_dependence (last, insn, REG_DEP_ANTI);
+                 INSN_REF_COUNT (insn)++;
+               }
+             
+             CANT_MOVE (insn) = 1;
+             
+             last = insn;
+           }
+         while (insn != earlier_cc0_setter);
+       }
+    }
+#endif
 
   /* Make sure these insns are scheduled last in their block.  */
   insn = last;