diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-12-07 20:10:50 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-12-07 20:10:50 +0100 |
commit | 77f1efdbe8fe401040adb9b2b43aac85916682ac (patch) | |
tree | d7b5af4b797553f6965b1acd08878728c2806364 /gcc/cgraph.c | |
parent | 9c4e96eb1e305a9f35e4dbafb0a1fe29ef226265 (diff) | |
download | gcc-77f1efdbe8fe401040adb9b2b43aac85916682ac.zip gcc-77f1efdbe8fe401040adb9b2b43aac85916682ac.tar.gz gcc-77f1efdbe8fe401040adb9b2b43aac85916682ac.tar.bz2 |
re PR tree-optimization/78692 (ICE (segfault))
PR c++/78692
* cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Set lhs
var to lhs of new_stmt right before noreturn handling rather than to
lhs of e->call_stmt early.
* g++.dg/torture/pr78692.C: New test.
From-SVN: r243377
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 867e371..fd2465e 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1271,7 +1271,6 @@ cgraph_edge::redirect_call_stmt_to_callee (void) cgraph_edge *e = this; tree decl = gimple_call_fndecl (e->call_stmt); - tree lhs = gimple_call_lhs (e->call_stmt); gcall *new_stmt; gimple_stmt_iterator gsi; bool skip_bounds = false; @@ -1526,6 +1525,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void) gimple_call_set_fntype (new_stmt, TREE_TYPE (e->callee->decl)); /* If the call becomes noreturn, remove the LHS if possible. */ + tree lhs = gimple_call_lhs (new_stmt); if (lhs && gimple_call_noreturn_p (new_stmt) && (VOID_TYPE_P (TREE_TYPE (gimple_call_fntype (new_stmt))) |