[Bug middle-end/40525] if conversion (in dead_or_predicable) fails for targets with limited conditional execution support

2009-06-26 Thread steven at gcc dot gnu dot org


--- Comment #7 from steven at gcc dot gnu dot org  2009-06-26 06:06 ---
Subject: Bug 40525

Author: steven
Date: Fri Jun 26 06:06:04 2009
New Revision: 148961

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148961
Log:
PR middle-end/40525
* ifcvt.c (dead_or_predicable): If predicating MERGE_BB fails,
try the non-cond_exec path also.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/ifcvt.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40525



[Bug middle-end/40525] if conversion (in dead_or_predicable) fails for targets with limited conditional execution support

2009-06-26 Thread steven at gcc dot gnu dot org


--- Comment #8 from steven at gcc dot gnu dot org  2009-06-26 06:06 ---
.


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40525



[Bug middle-end/40525] if conversion (in dead_or_predicable) fails for targets with limited conditional execution support

2009-06-25 Thread steven at gcc dot gnu dot org


--- Comment #5 from steven at gcc dot gnu dot org  2009-06-25 08:17 ---
Tentative patch:

Index: ifcvt.c
===
--- ifcvt.c (revision 148927)
+++ ifcvt.c (working copy)
@@ -3780,6 +3780,8 @@
basic_block other_bb, basic_block new_dest, int reversep)
 {
   rtx head, end, jump, earliest = NULL_RTX, old_dest, new_label = NULL_RTX;
+  /* Number of pending changes.  */
+  int n_validated_changes = 0;

   jump = BB_END (test_bb);

@@ -3849,13 +3851,15 @@
}

   if (! cond_exec_process_insns ((ce_if_block_t *)0, head, end, cond,
-prob_val, 0))
-   goto cancel;
-
+prob_val, 0)
+ || ! verify_changes (0))
+   cancel_changes (0);
+  n_validated_changes = num_validated_changes ();
   earliest = jump;
 }
-  else
 #endif
+  /* Try the NCE path if the CE path did not result in any changes.  */
+  if (n_validated_changes  0)
 {
   /* In the non-conditional execution case, we have to verify that there
 are no trapping operations, no calls, no references to memory, and
@@ -3995,8 +3999,10 @@
goto cancel;
 }

-  if (! apply_change_group ())
-return FALSE;
+  if (verify_changes (n_validated_changes))
+confirm_change_group ();
+  else
+goto cancel;

   if (other_bb != new_dest)
 {


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40525