aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-02-10 16:06:20 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-02-10 16:06:20 +0100
commite199dd0a2fc0d1ffea997f2ba5e42d4bc4c32518 (patch)
treed04fa6cffeb76dd4444658f8e2f8360ed9d03342 /gcc/cgraphunit.c
parentd6b38027a031b8a4b74ff54129e0689822f483fc (diff)
downloadgcc-e199dd0a2fc0d1ffea997f2ba5e42d4bc4c32518.zip
gcc-e199dd0a2fc0d1ffea997f2ba5e42d4bc4c32518.tar.gz
gcc-e199dd0a2fc0d1ffea997f2ba5e42d4bc4c32518.tar.bz2
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 <ppalka@gcc.gnu.org> From-SVN: r233271
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c5
1 files changed, 3 insertions, 2 deletions
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),