aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-split.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-02-12 12:59:00 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-02-12 12:59:00 +0100
commit06ff700018a769b76d4ec39b487fff46738ce84b (patch)
tree0247bb31639a9cd236d1d18a2093f70a95038354 /gcc/ipa-split.c
parentb69539cbf58a1d0c918759dc12cf384922661753 (diff)
downloadgcc-06ff700018a769b76d4ec39b487fff46738ce84b.zip
gcc-06ff700018a769b76d4ec39b487fff46738ce84b.tar.gz
gcc-06ff700018a769b76d4ec39b487fff46738ce84b.tar.bz2
re PR ipa/69241 (ICE with noreturn and function that return non-POD)
PR ipa/69241 * ipa-split.c (split_function): If split part returns TREE_ADDRESSABLE type by reference, force lhs on the call. * g++.dg/ipa/pr69241-4.C: New test. From-SVN: r233375
Diffstat (limited to 'gcc/ipa-split.c')
-rw-r--r--gcc/ipa-split.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 2528a79..ac8b478 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -629,7 +629,18 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
4) For non-SSA we need to look where the var is computed. */
retval = find_retval (return_bb);
if (!retval)
- current->split_part_set_retval = true;
+ {
+ /* If there is a return_bb with no return value in function returning
+ value by reference, also make the split part return void, otherwise
+ we expansion would try to create a non-POD temporary, which is
+ invalid. */
+ if (return_bb != EXIT_BLOCK_PTR_FOR_FN (cfun)
+ && DECL_RESULT (current_function_decl)
+ && DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
+ current->split_part_set_retval = false;
+ else
+ current->split_part_set_retval = true;
+ }
else if (is_gimple_min_invariant (retval))
current->split_part_set_retval = false;
/* Special case is value returned by reference we record as if it was non-ssa