aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-06-06 19:12:25 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-06-06 19:12:25 +0200
commita9d245448f2529fe9a4aba63d9cd97059a17a121 (patch)
tree49149b6774ee1bc9cd12c2261a21557049cfe8b3 /gcc/cgraph.c
parent9a2fc6ada427baaff5b41dcad27861fe28255c82 (diff)
downloadgcc-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/cgraph.c')
-rw-r--r--gcc/cgraph.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index a6d5482..02bf6eb 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1233,13 +1233,17 @@ cgraph_make_edge_direct (struct cgraph_edge *edge, struct cgraph_node *callee,
/* Update or remove the corresponding cgraph edge if a GIMPLE_CALL
OLD_STMT changed into NEW_STMT. OLD_CALL is gimple_call_fndecl
- of OLD_STMT if it was previously call statement. */
+ of OLD_STMT if it was previously call statement.
+ If NEW_STMT is NULL, the call has been dropped without any
+ replacement. */
static void
cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
- gimple old_stmt, tree old_call, gimple new_stmt)
+ gimple old_stmt, tree old_call,
+ gimple new_stmt)
{
- tree new_call = (is_gimple_call (new_stmt)) ? gimple_call_fndecl (new_stmt) : 0;
+ tree new_call = (new_stmt && is_gimple_call (new_stmt))
+ ? gimple_call_fndecl (new_stmt) : 0;
/* We are seeing indirect calls, then there is nothing to update. */
if (!new_call && !old_call)
@@ -1277,7 +1281,7 @@ cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
frequency = e->frequency;
cgraph_remove_edge (e);
}
- else
+ else if (new_call)
{
/* We are seeing new direct call; compute profile info based on BB. */
basic_block bb = gimple_bb (new_stmt);