diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-06-06 19:12:25 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-06-06 19:12:25 +0200 |
commit | a9d245448f2529fe9a4aba63d9cd97059a17a121 (patch) | |
tree | 49149b6774ee1bc9cd12c2261a21557049cfe8b3 /gcc/tree-inline.c | |
parent | 9a2fc6ada427baaff5b41dcad27861fe28255c82 (diff) | |
download | gcc-a9d245448f2529fe9a4aba63d9cd97059a17a121.zip gcc-a9d245448f2529fe9a4aba63d9cd97059a17a121.tar.gz gcc-a9d245448f2529fe9a4aba63d9cd97059a17a121.tar.bz2 |
re PR c++/49264 (Internal compiler error: segmentation fault)
PR c++/49264
* gimple-fold.c (fold_stmt_1): Don't try to fold *& on the lhs
if stmt folded into nothing.
* tree-inline.c (fold_marked_statements): If a builtin at the
end of a bb folded into nothing, just update cgraph edges
and move to next bb.
* cgraph.c (cgraph_update_edges_for_call_stmt_node): Allow new_stmt
to be NULL. Don't compute count and frequency if new_call is NULL.
* g++.dg/opt/pr49264.C: New test.
From-SVN: r174711
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 0e553c8..dc3288b 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4055,6 +4055,14 @@ fold_marked_statements (int first, struct pointer_set_t *statements) if (fold_stmt (&gsi)) { gimple new_stmt; + /* If a builtin at the end of a bb folded into nothing, + the following loop won't work. */ + if (gsi_end_p (gsi)) + { + cgraph_update_edges_for_call_stmt (old_stmt, + old_decl, NULL); + break; + } if (gsi_end_p (i2)) i2 = gsi_start_bb (BASIC_BLOCK (first)); else |