diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-07 17:40:10 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-07 17:40:10 +0000 |
commit | 806e4c12395ae2ebbd374d91880204c498ae4c0b (patch) | |
tree | 252b73c82d55d0b8da42cb892207cf89b9b2d1bc /gcc/gimplify.c | |
parent | 8223629e6c6c40e59d68e94e9fc2b7eca7848dd5 (diff) | |
download | gcc-806e4c12395ae2ebbd374d91880204c498ae4c0b.tar.gz |
Make return in memory explicit.
* function.c (aggregate_value_p): Check DECL_BY_REFERENCE.
(assign_parm_find_data_types): Remove code for old front end
invisible reference handling.
(assign_parms): Handle DECL_BY_REFERENCE on the RESULT_DECL.
(expand_function_end): Likewise.
* gimplify.c (gimplify_return_expr): Handle a dereferenced
RESULT_DECL.
* tree-inline.c (copy_body_r): Don't bother looking for &* anymore.
(declare_return_variable): Handle DECL_BY_REFERENCE.
* cp/cp-gimplify.c (is_invisiref_parm): Also handle RESULT_DECL.
(cp_genericize_r): Use convert_from_reference.
Don't dereference a RESULT_DECL directly inside a RETURN_EXPR.
(cp_genericize): Handle the RESULT_DECL. Unset TREE_ADDRESSABLE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85675 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index cd2a4a0beec..c6478ec40f5 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -895,6 +895,9 @@ gimplify_return_expr (tree stmt, tree *pre_p) else { result_decl = TREE_OPERAND (ret_expr, 0); + if (TREE_CODE (result_decl) == INDIRECT_REF) + /* See through a return by reference. */ + result_decl = TREE_OPERAND (result_decl, 0); #ifdef ENABLE_CHECKING if ((TREE_CODE (ret_expr) != MODIFY_EXPR && TREE_CODE (ret_expr) != INIT_EXPR) |