aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-02-06 21:47:20 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-02-06 21:47:20 +0100
commitbbd1bae29c33b55ac449730b3b9eaaa44de3f3e8 (patch)
tree33b02403ed135a9f640d6f193b2bca059259f232 /gcc/cgraphunit.c
parent091790a7f083f246d6975b0d9bf4bd236ed106cd (diff)
downloadgcc-bbd1bae29c33b55ac449730b3b9eaaa44de3f3e8.zip
gcc-bbd1bae29c33b55ac449730b3b9eaaa44de3f3e8.tar.gz
gcc-bbd1bae29c33b55ac449730b3b9eaaa44de3f3e8.tar.bz2
re PR ipa/64896 (ICE in get_address_mode, at rtlanal.c:5442)
PR ipa/64896 * cgraphunit.c (cgraph_node::expand_thunk): If restype is not is_gimple_reg_type nor the thunk_fndecl returns aggregate_value_p, set restmp to a temporary variable instead of resdecl. * g++.dg/ipa/pr64896.C: New test. From-SVN: r220489
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index a2650f7..35b244e 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1609,11 +1609,16 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
}
else if (!is_gimple_reg_type (restype))
{
- restmp = resdecl;
+ if (aggregate_value_p (resdecl, TREE_TYPE (thunk_fndecl)))
+ {
+ restmp = resdecl;
- if (TREE_CODE (restmp) == VAR_DECL)
- add_local_decl (cfun, restmp);
- BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp;
+ if (TREE_CODE (restmp) == VAR_DECL)
+ add_local_decl (cfun, restmp);
+ BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp;
+ }
+ else
+ restmp = create_tmp_var (restype, "retval");
}
else
restmp = create_tmp_reg (restype, "retval");