------- Comment #5 from changpeng dot fang at amd dot com  2010-03-01 18:02 
-------
I have a fix for this problem. We should not decrease the cost if the cost is
infinite.

diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 74dadf7..9accda9 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -4124,7 +4124,11 @@ determine_use_iv_cost_condition (struct ivopts_data
*data,
   if (integer_zerop (*bound_cst)
       && (operand_equal_p (*control_var, cand->var_after, 0)
          || operand_equal_p (*control_var, cand->var_before, 0)))
-    elim_cost.cost -= 1;
+    {
+      /* Should not decrease the cost if it is infinite */
+      if (!infinite_cost_p (elim_cost))
+        elim_cost.cost -= 1;
+    }


-- 

changpeng dot fang at amd dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |changpeng dot fang at amd
                   |                            |dot com


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

Reply via email to