aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-01-23 11:07:56 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-01-23 11:07:56 +0000
commit39791fb62f536e77e0c4bc6bf2fdc6f2bcdf7f05 (patch)
tree5febf9df2afc9efe3f7010a454a9c820322a53c4 /gcc/cgraphunit.c
parentb3e5901b625df90e3618b2e5a06cccc36cd84b6a (diff)
downloadgcc-39791fb62f536e77e0c4bc6bf2fdc6f2bcdf7f05.zip
gcc-39791fb62f536e77e0c4bc6bf2fdc6f2bcdf7f05.tar.gz
gcc-39791fb62f536e77e0c4bc6bf2fdc6f2bcdf7f05.tar.bz2
cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that returns by reference...
* cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that returns by reference, use the type of the return object of the thunk instead of that of the alias to build the dereference. From-SVN: r268182
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 1cf9ac5..a7c9b9a 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1916,10 +1916,9 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
restmp = gimple_fold_indirect_ref (resdecl);
if (!restmp)
restmp = build2 (MEM_REF,
- TREE_TYPE (TREE_TYPE (DECL_RESULT (alias))),
+ TREE_TYPE (TREE_TYPE (resdecl)),
resdecl,
- build_int_cst (TREE_TYPE
- (DECL_RESULT (alias)), 0));
+ build_int_cst (TREE_TYPE (resdecl), 0));
}
else if (!is_gimple_reg_type (restype))
{