]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ifcvt.c (noce_process_if_block): Try to handle only the then block if the else block...
authorAlexandre Oliva <aoliva@redhat.com>
Sat, 1 Mar 2008 18:22:52 +0000 (18:22 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Sat, 1 Mar 2008 18:22:52 +0000 (18:22 +0000)
* ifcvt.c (noce_process_if_block): Try to handle only the then
block if the else block exists but isn't suitable.

From-SVN: r132803

gcc/ChangeLog
gcc/ifcvt.c

index ff83b9cbff7f0461fd4a2660c81deceb4cf18498..216d321498bd1a5bec9220f3656aeb7bb608c945 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-01  Alexandre Oliva  <aoliva@redhat.com>
+
+       * ifcvt.c (noce_process_if_block): Try to handle only the then
+       block if the else block exists but isn't suitable.
+
 2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>
 
        PR gcc/35063
index 1bb67321d2bded244bfbfaa09ab4a7fca4f606e5..4fd98d010d37e37bf0ca28a13b80096940900f0c 100644 (file)
@@ -2245,6 +2245,7 @@ noce_process_if_block (struct noce_if_info *if_info)
          || !NONJUMP_INSN_P (insn_b)
          || (set_b = single_set (insn_b)) == NULL_RTX
          || ! rtx_equal_p (x, SET_DEST (set_b))
+         || ! noce_operand_ok (SET_SRC (set_b))
          || reg_overlap_mentioned_p (x, SET_SRC (set_b))
          || modified_between_p (SET_SRC (set_b),
                                 PREV_INSN (if_info->cond_earliest), jump)
@@ -2290,6 +2291,7 @@ noce_process_if_block (struct noce_if_info *if_info)
   if (! noce_operand_ok (a) || ! noce_operand_ok (b))
     return FALSE;
 
+ retry:
   /* Set up the info block for our subroutines.  */
   if_info->insn_a = insn_a;
   if_info->insn_b = insn_b;
@@ -2387,6 +2389,13 @@ noce_process_if_block (struct noce_if_info *if_info)
        goto success;
     }
 
+  if (!else_bb && set_b)
+    {
+      insn_b = set_b = NULL_RTX;
+      b = orig_x;
+      goto retry;
+    }
+
   return FALSE;
 
  success: