diff options
author | Diego Novillo <dnovillo@redhat.com> | 2005-11-15 02:59:03 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2005-11-14 21:59:03 -0500 |
commit | 8c5285e1cbc832dee329364e1c4690a7d28a313f (patch) | |
tree | 01472ccbe2e961644ad8b9fcf25f37493140d337 /gcc/tree-vrp.c | |
parent | 1f4c2c57da3143ef0a5e9943c8e16ab05a0883d9 (diff) | |
download | gcc-8c5285e1cbc832dee329364e1c4690a7d28a313f.zip gcc-8c5285e1cbc832dee329364e1c4690a7d28a313f.tar.gz gcc-8c5285e1cbc832dee329364e1c4690a7d28a313f.tar.bz2 |
re PR tree-optimization/24840 (ICE process_assert_insertions_for, at tree-vrp.c:2807)
PR 24840
* tree-vrp.c (infer_value_range): Return false if STMT is a
block terminator and its basic block has no successors.
testsuite/
PR 24840
* gcc.dg/tree-ssa/pr24840.c: New test.
From-SVN: r106930
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index d49c4d4..f88b23e 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -2221,6 +2221,13 @@ infer_value_range (tree stmt, tree op, enum tree_code *comp_code_p, tree *val_p) if (tree_could_throw_p (stmt)) return false; + /* If STMT is the last statement of a basic block with no + successors, there is no point inferring anything about any of its + operands. We would not be able to find a proper insertion point + for the assertion, anyway. */ + if (stmt_ends_bb_p (stmt) && EDGE_COUNT (bb_for_stmt (stmt)->succs) == 0) + return false; + if (POINTER_TYPE_P (TREE_TYPE (op))) { bool is_store; |