From b6dae84928a112b2f176ad168d8c5b7e0ecdd5cb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 31 Jan 2017 09:33:36 +0100 Subject: 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 --- gcc/value-prof.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/value-prof.c') 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 (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); -- cgit v1.1