aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-01-31 09:33:36 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-01-31 09:33:36 +0100
commitb6dae84928a112b2f176ad168d8c5b7e0ecdd5cb (patch)
tree4e48957da84e536c6dd21300b0f28f58c8e79ec8 /gcc/value-prof.c
parent40fb9c89e1599b2f13d1403820a9e0fb2c1129c1 (diff)
downloadgcc-b6dae84928a112b2f176ad168d8c5b7e0ecdd5cb.zip
gcc-b6dae84928a112b2f176ad168d8c5b7e0ecdd5cb.tar.gz
gcc-b6dae84928a112b2f176ad168d8c5b7e0ecdd5cb.tar.bz2
re PR c++/79267 (internal compiler error with -O3 or -O2 -finline-functions)
PR tree-optimization/79267 * value-prof.c (gimple_ic): Only drop lhs for noreturn calls if should_remove_lhs_p is true. * g++.dg/opt/pr79267.C: New test. From-SVN: r245053
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index d4da8c4..097e409 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1358,7 +1358,8 @@ gimple_ic (gcall *icall_stmt, struct cgraph_node *direct_call,
dcall_stmt = as_a <gcall *> (gimple_copy (icall_stmt));
gimple_call_set_fndecl (dcall_stmt, direct_call->decl);
dflags = flags_from_decl_or_type (direct_call->decl);
- if ((dflags & ECF_NORETURN) != 0)
+ if ((dflags & ECF_NORETURN) != 0
+ && should_remove_lhs_p (gimple_call_lhs (dcall_stmt)))
gimple_call_set_lhs (dcall_stmt, NULL_TREE);
gsi_insert_before (&gsi, dcall_stmt, GSI_SAME_STMT);