re PR middle-end/45098 (Missed induction variable optimization)
authorTom de Vries <tom@codesourcery.com>
Sun, 22 May 2011 18:57:19 +0000 (18:57 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sun, 22 May 2011 18:57:19 +0000 (18:57 +0000)
2011-05-22  Tom de Vries  <tom@codesourcery.com>

PR target/45098
* tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Fix const test
for call to get_shiftadd_cost.

From-SVN: r174033

gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c

index 81e2d20fa2d67ff09dfffc9109de3b8a02e713f9..a022b62d23e7e78e40bd245f140b73818997406d 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-22  Tom de Vries  <tom@codesourcery.com>
+
+       PR target/45098
+       * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Fixed const test
+       for call to get_shiftadd_cost.
+
 2011-05-22  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/49104
index 69df4b62b77a78dbe6a6531aa95dcf40fe5fe9a3..10fd7dc48c774e82677dd2a08abaa963039579cb 100644 (file)
@@ -3685,7 +3685,7 @@ force_expr_to_var_cost (tree expr, bool speed)
             mult = op0;
 
           if (mult != NULL_TREE
-              && TREE_CODE (TREE_OPERAND (mult, 1)) == INTEGER_CST
+              && cst_and_fits_in_hwi (TREE_OPERAND (mult, 1))
               && get_shiftadd_cost (expr, mode, cost0, cost1, mult, speed,
                                     &sa_cost))
             return sa_cost;