aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/gimple-ssa-strength-reduction.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/gimple-ssa-strength-reduction.c')
-rw-r--r--gcc-4.8/gcc/gimple-ssa-strength-reduction.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc-4.8/gcc/gimple-ssa-strength-reduction.c b/gcc-4.8/gcc/gimple-ssa-strength-reduction.c
index 5cda3873e..a1d1a11f0 100644
--- a/gcc-4.8/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc-4.8/gcc/gimple-ssa-strength-reduction.c
@@ -735,16 +735,19 @@ create_mul_imm_cand (gimple gs, tree base_in, tree stride_in, bool speed)
X = Y * c
============================
X = (B + i') * (S * c) */
- base = base_cand->base_expr;
- index = base_cand->index;
temp = tree_to_double_int (base_cand->stride)
* tree_to_double_int (stride_in);
+ if (double_int_fits_to_tree_p (TREE_TYPE (stride_in), temp))
+ {
+ base = base_cand->base_expr;
+ index = base_cand->index;
stride = double_int_to_tree (TREE_TYPE (stride_in), temp);
ctype = base_cand->cand_type;
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
+ }
else if (base_cand->kind == CAND_ADD
&& operand_equal_p (base_cand->stride, integer_one_node, 0))
{