# DP: Attachment 23909 to fix PR rtl-optimization/47612

Index: gcc-4.6-4.6.3/src/gcc/df-problems.c
===================================================================
--- gcc-4.6-4.6.3.orig/src/gcc/df-problems.c	2012-03-04 15:52:07.000000000 +0000
+++ gcc-4.6-4.6.3/src/gcc/df-problems.c	2012-03-04 15:54:57.000000000 +0000
@@ -4024,7 +4024,10 @@
 	  if (bitmap_intersect_p (merge_set, test_use)
 	      || bitmap_intersect_p (merge_use, test_set))
 	    break;
-	  max_to = insn;
+#ifdef HAVE_cc0
+	  if (!sets_cc0_p (insn))
+#endif
+	    max_to = insn;
 	}
       next = NEXT_INSN (insn);
       if (insn == to)
@@ -4061,7 +4064,11 @@
     {
       if (NONDEBUG_INSN_P (insn))
 	{
-	  if (!bitmap_intersect_p (test_set, local_merge_live))
+	  if (!bitmap_intersect_p (test_set, local_merge_live)
+#ifdef HAVE_cc0
+	      && !sets_cc0_p (insn)
+#endif
+	      )
 	    {
 	      max_to = insn;
 	      break;
