diff options
author | Jeff Law <law@redhat.com> | 2014-01-24 13:51:22 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2014-01-24 13:51:22 -0700 |
commit | 3d75049621434125a972a3fc738437d33d35ca8a (patch) | |
tree | 8b1664fb93585f97779d04af6d25654ac1f830b8 /gcc/tree-vrp.c | |
parent | bb393514d5be4d683a72fa4bfda938943368505a (diff) | |
download | gcc-3d75049621434125a972a3fc738437d33d35ca8a.zip gcc-3d75049621434125a972a3fc738437d33d35ca8a.tar.gz gcc-3d75049621434125a972a3fc738437d33d35ca8a.tar.bz2 |
re PR tree-optimization/59919 (ICE in process_assert_insertions_for, at tree-vrp.c:6096)
PR tree-optimization/59919
* tree-vrp.c (find_assert_locations_1): Do not register asserts
for non-returning calls.
PR tree-optimization/59919
* gcc.c-torture/compile/pr59919.c: New test.
From-SVN: r207061
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index f6da192..7aa732d 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4534,12 +4534,21 @@ infer_value_range (gimple stmt, tree op, enum tree_code *comp_code_p, tree *val_ if (stmt_could_throw_p (stmt)) return false; - /* If STMT is the last statement of a basic block with no + /* If STMT is the last statement of a basic block with no normal 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 (gimple_bb (stmt)->succs) == 0) - return false; + if (stmt_ends_bb_p (stmt)) + { + edge_iterator ei; + edge e; + + FOR_EACH_EDGE (e, ei, gimple_bb (stmt)->succs) + if (!(e->flags & EDGE_ABNORMAL)) + break; + if (e == NULL) + return false; + } if (infer_nonnull_range (stmt, op, true, true)) { |