ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Return false when count is incremente...
authorJakub Jelinek <jakub@redhat.com>
Mon, 1 Feb 2016 20:37:49 +0000 (21:37 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 1 Feb 2016 20:37:49 +0000 (21:37 +0100)
* ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Return false
when count is incremented above limit, don't analyze further
insns afterwards.

From-SVN: r233050

gcc/ChangeLog
gcc/ifcvt.c

index b3524271d589820e96e7965eb58fbf32424119c4..a551069a23e3389788b3ec747fd09f8956b4901e 100644 (file)
@@ -1,5 +1,9 @@
 2016-02-01  Jakub Jelinek  <jakub@redhat.com>
 
+       * ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Return false
+       when count is incremented above limit, don't analyze further
+       insns afterwards.
+
        * omp-low.c (oacc_parse_default_dims): Avoid
        -Wsign-compare warning, make sure value fits into int
        rather than just unsigned int.
index 53cb41f1ffa7d8bbdd2665ba986bf325977398d3..a50e33dc66ccc194d39bd5662df8fb25e976a424 100644 (file)
@@ -3286,15 +3286,13 @@ bb_ok_for_noce_convert_multiple_sets (basic_block test_bb,
       if (!can_conditionally_move_p (GET_MODE (dest)))
        return false;
 
-      ++count;
+      /* FORNOW: Our cost model is a count of the number of instructions we
+        would if-convert.  This is suboptimal, and should be improved as part
+        of a wider rework of branch_cost.  */
+      if (++count > limit)
+       return false;
     }
 
-  /* FORNOW: Our cost model is a count of the number of instructions we
-     would if-convert.  This is suboptimal, and should be improved as part
-     of a wider rework of branch_cost.  */
-  if (count > limit)
-    return false;
-
   return count > 1;
 }