diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-15 12:26:12 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-15 12:26:12 +0000 |
commit | eb105b17547a635a89cfece14ba96f170e817664 (patch) | |
tree | 4d471877a47c52da8db1b99983435baf60e9e7e7 /gcc/tree-chrec.c | |
parent | 18369c3d30104cebb1f1382a25c78e029ddc8f15 (diff) | |
download | gcc-eb105b17547a635a89cfece14ba96f170e817664.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103109 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r-- | gcc/tree-chrec.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 1a229225f80..87cc148c1a7 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -30,6 +30,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "tm.h" #include "ggc.h" #include "tree.h" +#include "real.h" #include "diagnostic.h" #include "varray.h" #include "cfgloop.h" @@ -119,7 +120,9 @@ chrec_fold_plus_poly_poly (enum tree_code code, (CHREC_VARIABLE (poly1), chrec_fold_minus (type, poly0, CHREC_LEFT (poly1)), chrec_fold_multiply (type, CHREC_RIGHT (poly1), - build_int_cst_type (type, -1))); + SCALAR_FLOAT_TYPE_P (type) + ? build_real (type, dconstm1) + : build_int_cst_type (type, -1))); } if (CHREC_VARIABLE (poly0) > CHREC_VARIABLE (poly1)) @@ -208,7 +211,9 @@ chrec_fold_multiply_poly_poly (tree type, CHREC_RIGHT (poly1))); /* "2*b*d". */ t2 = chrec_fold_multiply (type, CHREC_RIGHT (poly0), CHREC_RIGHT (poly1)); - t2 = chrec_fold_multiply (type, build_int_cst_type (type, 2), t2); + t2 = chrec_fold_multiply (type, SCALAR_FLOAT_TYPE_P (type) + ? build_real (type, dconst2) + : build_int_cst_type (type, 2), t2); var = CHREC_VARIABLE (poly0); return build_polynomial_chrec (var, t0, @@ -284,8 +289,10 @@ chrec_fold_plus_1 (enum tree_code code, return build_polynomial_chrec (CHREC_VARIABLE (op1), chrec_fold_minus (type, op0, CHREC_LEFT (op1)), - chrec_fold_multiply (type, CHREC_RIGHT (op1), - build_int_cst_type (type, -1))); + chrec_fold_multiply (type, CHREC_RIGHT (op1), + SCALAR_FLOAT_TYPE_P (type) + ? build_real (type, dconstm1) + : build_int_cst_type (type, -1))); default: { |