re PR rtl-optimization/68920 (Undesirable if-conversion for a rarely taken branch)
authorYuri Rumyantsev <ysrumyan@gmail.com>
Thu, 21 Jan 2016 16:05:14 +0000 (16:05 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 21 Jan 2016 16:05:14 +0000 (16:05 +0000)
gcc/

2016-01-21  Yuri Rumyantsev  <ysrumyan@gmail.com>

PR rtl-optimization/68920
* ifcvt.c (cond_move_process_if_block): Limit number of conditional
moves.

From-SVN: r232680

gcc/ChangeLog
gcc/ifcvt.c

index d15a87dcca6976de8298ac50def11a27dcb985fa..abde3f44886b6dd20c6a569e9267b4772a37c926 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-21  Yuri Rumyantsev  <ysrumyan@gmail.com>
+
+       PR rtl-optimization/68920
+       * ifcvt.c (cond_move_process_if_block): Limit number of conditional
+       moves.
+
 2016-01-21  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/68990
index ec6c3def1462c20c33616ba469b0dccc75364503..74958fb76d06e61e3f32c5465950c9b54ef6439b 100644 (file)
@@ -3743,6 +3743,7 @@ cond_move_process_if_block (struct noce_if_info *if_info)
   vec<rtx> else_regs = vNULL;
   unsigned int i;
   int success_p = FALSE;
+  int limit = PARAM_VALUE (PARAM_MAX_RTL_IF_CONVERSION_INSNS);
 
   /* Build a mapping for each block to the value used for each
      register.  */
@@ -3792,7 +3793,8 @@ cond_move_process_if_block (struct noce_if_info *if_info)
      is the number of assignments currently made in only one of the
      branches, since if we convert we are going to always execute
      them.  */
-  if (c > MAX_CONDITIONAL_EXECUTE)
+  if (c > MAX_CONDITIONAL_EXECUTE
+      || c > limit)
     goto done;
 
   /* Try to emit the conditional moves.  First do the then block,