diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-03 14:18:56 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-03 14:18:56 +0000 |
commit | 4a1dfa2c2f7af6c2b2e225363cde44d4b5c64635 (patch) | |
tree | bac0d1350104882338d136860782796fa710de2b /gcc/tree-scalar-evolution.c | |
parent | 27b016fb33afae44c2dea54fe07a6a338890bded (diff) | |
download | gcc-4a1dfa2c2f7af6c2b2e225363cde44d4b5c64635.tar.gz |
PR tree-optimization/19899
* Makefile.in (tree-scalar-evolution.o): Add real.h.
* tree-scalar-evolution.c: Include real.h.
(add_to_evolution): Build constant -1 of correct type.
* gcc.dg/tree-ssa/scev-1.c: New test.
* gcc.dg/tree-ssa/scev-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102695 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-scalar-evolution.c')
-rw-r--r-- | gcc/tree-scalar-evolution.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 52a2d1a612c..507e3e91947 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -237,6 +237,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "tm.h" #include "ggc.h" #include "tree.h" +#include "real.h" /* These RTL headers are needed for basic-block.h. */ #include "rtl.h" @@ -866,8 +867,9 @@ add_to_evolution (unsigned loop_nb, } if (code == MINUS_EXPR) - to_add = chrec_fold_multiply (type, to_add, - build_int_cst_type (type, -1)); + to_add = chrec_fold_multiply (type, to_add, SCALAR_FLOAT_TYPE_P (type) + ? build_real (type, dconstm1) + : build_int_cst_type (type, -1)); res = add_to_evolution_1 (loop_nb, chrec_before, to_add); |