Commit 8ba78f92 by Sebastian Pop Committed by Sebastian Pop

Fix miscompilation of 416.gamess.

2010-09-23  Sebastian Pop  <sebastian.pop@amd.com>

	* sese.h (scev_analyzable_p): Return false for real or floating
	point.  Only handle INTEGRAL_TYPE_P and POINTER_TYPE_P.

From-SVN: r164812
parent 99e55749
2010-09-30 Sebastian Pop <sebastian.pop@amd.com> 2010-09-30 Sebastian Pop <sebastian.pop@amd.com>
* sese.h (scev_analyzable_p): Return false for real or floating
point. Only handle INTEGRAL_TYPE_P and POINTER_TYPE_P.
2010-09-30 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (compute_bounds_for_level): Free le * graphite-clast-to-gimple.c (compute_bounds_for_level): Free le
and ps. and ps.
* graphite-poly.c (pbb_number_of_iterations_at_time): Free le and * graphite-poly.c (pbb_number_of_iterations_at_time): Free le and
2010-09-23 Sebastian Pop <sebastian.pop@amd.com> 2010-09-23 Sebastian Pop <sebastian.pop@amd.com>
* sese.h (scev_analyzable_p): Return false for real or floating
point. Only handle INTEGRAL_TYPE_P and POINTER_TYPE_P.
2010-09-23 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/45758 PR middle-end/45758
* gfortran.dg/graphite/pr45758.f90: New. * gfortran.dg/graphite/pr45758.f90: New.
......
...@@ -386,9 +386,22 @@ nb_common_loops (sese region, gimple_bb_p gbb1, gimple_bb_p gbb2) ...@@ -386,9 +386,22 @@ nb_common_loops (sese region, gimple_bb_p gbb1, gimple_bb_p gbb2)
static inline bool static inline bool
scev_analyzable_p (tree def, sese region) scev_analyzable_p (tree def, sese region)
{ {
gimple stmt = SSA_NAME_DEF_STMT (def); loop_p loop;
loop_p loop = loop_containing_stmt (stmt); tree scev;
tree scev = scalar_evolution_in_region (region, loop, def); tree type = TREE_TYPE (def);
/* When Graphite generates code for a scev, the code generator
expresses the scev in function of a single induction variable.
This is unsafe for floating point computations, as it may replace
a floating point sum reduction with a multiplication. The
following test returns false for non integer types to avoid such
problems. */
if (!INTEGRAL_TYPE_P (type)
&& !POINTER_TYPE_P (type))
return false;
loop = loop_containing_stmt (SSA_NAME_DEF_STMT (def));
scev = scalar_evolution_in_region (region, loop, def);
return !chrec_contains_undetermined (scev) return !chrec_contains_undetermined (scev)
&& TREE_CODE (scev) != SSA_NAME && TREE_CODE (scev) != SSA_NAME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment