diff options
Diffstat (limited to 'gcc/tree-scalar-evolution.c')
-rw-r--r-- | gcc/tree-scalar-evolution.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index db798c0..e749047 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -676,7 +676,9 @@ add_to_evolution_1 (unsigned loop_nb, { var = loop_nb; left = chrec_before; - right = build_int_cst (type, 0); + right = SCALAR_FLOAT_TYPE_P (type) + ? build_real (type, dconst0) + : build_int_cst (type, 0); } else { @@ -1680,7 +1682,9 @@ interpret_rhs_modify_expr (struct loop *loop, tree at_stmt, opnd10 = TREE_OPERAND (opnd1, 0); chrec10 = analyze_scalar_evolution (loop, opnd10); chrec10 = chrec_convert (type, chrec10, at_stmt); - res = chrec_fold_minus (type, build_int_cst (type, 0), chrec10); + res = chrec_fold_multiply (type, chrec10, SCALAR_FLOAT_TYPE_P (type) + ? build_real (type, dconstm1) + : build_int_cst_type (type, -1)); break; case MULT_EXPR: |