aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-loop-interchange.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-23 09:35:38 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-23 09:35:38 +0100
commit37aa68563b3af16a1623490ae81f0712062f39e0 (patch)
tree93869e71f9b44de0864469f28a8179d033d501fd /gcc/gimple-loop-interchange.cc
parent4a75460b0099618b2d79ffda615a9516dcd5c224 (diff)
downloadgcc-37aa68563b3af16a1623490ae81f0712062f39e0.zip
gcc-37aa68563b3af16a1623490ae81f0712062f39e0.tar.gz
gcc-37aa68563b3af16a1623490ae81f0712062f39e0.tar.bz2
re PR tree-optimization/88964 (ICE in wide_int_to_tree_1, at tree.c:1561)
PR tree-optimization/88964 * gimple-loop-interchange.cc (loop_cand::analyze_induction_var): Use build_zero_cst instead of build_int_cst. Return false for loop invariants which honor signed zeros. * gfortran.dg/pr88964.f90: New test. From-SVN: r268179
Diffstat (limited to 'gcc/gimple-loop-interchange.cc')
-rw-r--r--gcc/gimple-loop-interchange.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc
index bb01a9b..1f0e49d 100644
--- a/gcc/gimple-loop-interchange.cc
+++ b/gcc/gimple-loop-interchange.cc
@@ -688,11 +688,16 @@ loop_cand::analyze_induction_var (tree var, tree chrec)
/* Var is loop invariant, though it's unlikely to happen. */
if (tree_does_not_contain_chrecs (chrec))
{
+ /* Punt on floating point invariants if honoring signed zeros,
+ representing that as + 0.0 would change the result if init
+ is -0.0. */
+ if (HONOR_SIGNED_ZEROS (chrec))
+ return false;
struct induction *iv = XCNEW (struct induction);
iv->var = var;
iv->init_val = init;
iv->init_expr = chrec;
- iv->step = build_int_cst (TREE_TYPE (chrec), 0);
+ iv->step = build_zero_cst (TREE_TYPE (chrec));
m_inductions.safe_push (iv);
return true;
}