aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorSebastian Pop <pop@cri.ensmp.fr>2005-08-21 12:48:23 +0200
committerSebastian Pop <spop@gcc.gnu.org>2005-08-21 10:48:23 +0000
commita1596edc4b46231e18e86e225fb19ecb0a1437e1 (patch)
treee7c1b97bd3fb20b67e45a396257d670957faddf4 /gcc/tree-ssa-loop-niter.c
parent429268fc04441a4a6e31bc9e3c303a8f355f7c43 (diff)
downloadgcc-a1596edc4b46231e18e86e225fb19ecb0a1437e1.zip
gcc-a1596edc4b46231e18e86e225fb19ecb0a1437e1.tar.gz
gcc-a1596edc4b46231e18e86e225fb19ecb0a1437e1.tar.bz2
re PR tree-optimization/23434 (ICE: Segmentation fault compiling gsl1.5 at -O2)
PR tree-optimization/23434 * tree-ssa-loop-niter.c (proved_non_wrapping_p): Give up when the iteration bound is not an INTEGER_CST. From-SVN: r103315
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index fc5491b..a8e4737 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1653,6 +1653,10 @@ proved_non_wrapping_p (tree at_stmt,
else
valid_niter = fold_convert (TREE_TYPE (bound), valid_niter);
+ /* Give up if BOUND was not folded to an INTEGER_CST, as in PR23434. */
+ if (TREE_CODE (bound) != INTEGER_CST)
+ return false;
+
/* After the statement niter_bound->at_stmt we know that anything is
executed at most BOUND times. */
if (at_stmt && stmt_dominates_stmt_p (niter_bound->at_stmt, at_stmt))