* 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
+2005-08-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ 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.
+
2005-08-03 Jan Hubicka <jh@suse.cz>
* cfgloop.h (DLTHE_FLAG_COMPLETTE_PEEL): New flag.
$(GGC_H) $(TREE_H) tree-chrec.h tree-pass.h $(PARAMS_H) \
$(DIAGNOSTIC_H) $(VARRAY_H) $(CFGLOOP_H) $(TREE_FLOW_H)
tree-scalar-evolution.o: tree-scalar-evolution.c $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) \
+ coretypes.h $(TM_H) $(GGC_H) $(TREE_H) real.h $(RTL_H) \
$(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
$(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h
tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+2005-08-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR tree-optimization/19899
+ * gcc.dg/tree-ssa/scev-1.c: New test.
+ * gcc.dg/tree-ssa/scev-2.c: New test.
+
2005-08-03 Richard Sandiford <richard@codesourcery.com>
PR target/18582
--- /dev/null
+/* PR tree-optimization/19899 */
+/* Decrementing a floating-point variable in a loop caused an ICE. */
+
+/* { dg-do run } */
+/* { dg-options "-O -ftree-vectorize" } */
+
+extern void abort (void);
+
+int main()
+{
+ float i=1;
+
+ while (i>=0)
+ --i;
+
+ if (i != -1)
+ abort();
+ return 0;
+}
--- /dev/null
+/* PR tree-optimization/19899 */
+/* Decrementing a floating-point variable in a loop caused an ICE. */
+
+/* { dg-do run } */
+/* { dg-options "-O -ftree-vectorize" } */
+
+extern void abort (void);
+
+int main()
+{
+ double a = 20;
+ int i;
+
+ for (i = 0; i < 10; ++i)
+ a -= 2;
+
+ if (a)
+ abort();
+ return 0;
+}
#include "tm.h"
#include "ggc.h"
#include "tree.h"
+#include "real.h"
/* These RTL headers are needed for basic-block.h. */
#include "rtl.h"
}
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);