aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-scalar-evolution.c
diff options
context:
space:
mode:
authorSebastian Pop <pop@cri.ensmp.fr>2005-08-15 14:26:12 +0200
committerSebastian Pop <spop@gcc.gnu.org>2005-08-15 12:26:12 +0000
commit7e0923cdbfa6810a361b86b7b76c9124cd911fc5 (patch)
tree4d471877a47c52da8db1b99983435baf60e9e7e7 /gcc/tree-scalar-evolution.c
parent852c19aae40795aff2dabaee47422e65f99b116a (diff)
downloadgcc-7e0923cdbfa6810a361b86b7b76c9124cd911fc5.zip
gcc-7e0923cdbfa6810a361b86b7b76c9124cd911fc5.tar.gz
gcc-7e0923cdbfa6810a361b86b7b76c9124cd911fc5.tar.bz2
re PR tree-optimization/23391 (Tree checking failure due to scev)
PR 23391 * Makefile.in (tree-chrec.o): Depends on real.h. * tree-chrec.c: Include real.h. (chrec_fold_plus_poly_poly, chrec_fold_multiply_poly_poly, chrec_fold_plus_1): Use build_real for SCALAR_FLOAT_TYPE_P. * tree-scalar-evolution.c (add_to_evolution_1, interpret_rhs_modify_expr): Ditto. From-SVN: r103109
Diffstat (limited to 'gcc/tree-scalar-evolution.c')
-rw-r--r--gcc/tree-scalar-evolution.c8
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: