From e199dd0a2fc0d1ffea997f2ba5e42d4bc4c32518 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 10 Feb 2016 16:06:20 +0100 Subject: re PR ipa/69241 (ICE with noreturn and function that return non-POD) PR ipa/69241 PR c++/69649 * gimplify.c (gimplify_modify_expr): Set lhs even for noreturn calls if the return type is TREE_ADDRESSABLE. * cgraphunit.c (cgraph_node::expand_thunk): Likewise. * ipa-split.c (split_function): Fix doubled "we" in comment. Use void return type for the split part even if !split_point->split_part_set_retval. * g++.dg/ipa/pr69241-1.C: New test. * g++.dg/ipa/pr69241-2.C: New test. * g++.dg/ipa/pr69241-3.C: New test. * g++.dg/ipa/pr69649.C: New test. Co-Authored-By: Patrick Palka From-SVN: r233271 --- gcc/cgraphunit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 2c49d7b..0a745f0 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1701,7 +1701,8 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) bsi = gsi_start_bb (bb); /* Build call to the function being thunked. */ - if (!VOID_TYPE_P (restype) && !alias_is_noreturn) + if (!VOID_TYPE_P (restype) + && (!alias_is_noreturn || TREE_ADDRESSABLE (restype))) { if (DECL_BY_REFERENCE (resdecl)) { @@ -1768,7 +1769,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) || DECL_BY_REFERENCE (resdecl))) gimple_call_set_return_slot_opt (call, true); - if (restmp && !alias_is_noreturn) + if (restmp) { gimple_call_set_lhs (call, restmp); gcc_assert (useless_type_conversion_p (TREE_TYPE (restmp), -- cgit v1.1