diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-09-30 21:21:56 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-09-30 21:21:56 +0000 |
commit | 8ba78f92f2218224d1831d01677c4ccc14a806fd (patch) | |
tree | 30622788bbcd93f8af7300ff9ff76c12c53c2c92 /gcc/sese.h | |
parent | 99e557492e6917ecdf5a1cbd9cb658040cc714de (diff) | |
download | gcc-8ba78f92f2218224d1831d01677c4ccc14a806fd.tar.gz |
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
Diffstat (limited to 'gcc/sese.h')
-rw-r--r-- | gcc/sese.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/sese.h b/gcc/sese.h index 8277f68ae7e..61f3a17b9b7 100644 --- a/gcc/sese.h +++ b/gcc/sese.h @@ -386,9 +386,22 @@ nb_common_loops (sese region, gimple_bb_p gbb1, gimple_bb_p gbb2) static inline bool scev_analyzable_p (tree def, sese region) { - gimple stmt = SSA_NAME_DEF_STMT (def); - loop_p loop = loop_containing_stmt (stmt); - tree scev = scalar_evolution_in_region (region, loop, def); + loop_p loop; + tree scev; + 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) && TREE_CODE (scev) != SSA_NAME |