summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-22 03:49:00 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-22 03:49:00 +0000
commit4d5b4e6addc17d8ee8a3d62b0d7a1db01c5ca8dc (patch)
treeacd635446a64407453a2f7688ccccc3c965f09f8 /gcc/function.c
parent8efbf92d9e06a89662fda66b872ea5e175e5b451 (diff)
downloadgcc-4d5b4e6addc17d8ee8a3d62b0d7a1db01c5ca8dc.tar.gz
PR debug/46724
* function.c (assign_parms_augmented_arg_list): Name and mark DECL of result address as NAMELESS rather than IGNORED. (assign_parms): Set DECL_VALUE_EXPR for indirect result. * tree.h (tree_decl_common::decl_flag_2): Document RESULT_DECL. (DECL_HAS_VALUE_EXPR_P): Accept RESULT_DECL. * dwarf2out.c (loc_list_from_tree) <RESULT_DECL>: Use DECL_VALUE_EXPR. * dbxout.c (dbxout_expand_expr) <RESULT_DECL>: Likewise. * var-tracking.c (vt_add_function_parameter): New, split out of... (vt_add_function_parameters): ... this. Handle incoming pointer to hold result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168160 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 7fa3b0c0aac..0c4d5f82464 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2253,10 +2253,11 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all)
tree decl;
decl = build_decl (DECL_SOURCE_LOCATION (fndecl),
- PARM_DECL, NULL_TREE, type);
+ PARM_DECL, get_identifier (".result_ptr"), type);
DECL_ARG_TYPE (decl) = type;
DECL_ARTIFICIAL (decl) = 1;
- DECL_IGNORED_P (decl) = 1;
+ DECL_NAMELESS (decl) = 1;
+ TREE_CONSTANT (decl) = 1;
DECL_CHAIN (decl) = all->orig_fnargs;
all->orig_fnargs = decl;
@@ -3418,13 +3419,22 @@ assign_parms (tree fndecl)
rtx x;
if (DECL_BY_REFERENCE (result))
- x = addr;
+ {
+ SET_DECL_VALUE_EXPR (result, all.function_result_decl);
+ x = addr;
+ }
else
{
+ SET_DECL_VALUE_EXPR (result,
+ build1 (INDIRECT_REF, TREE_TYPE (result),
+ all.function_result_decl));
addr = convert_memory_address (Pmode, addr);
x = gen_rtx_MEM (DECL_MODE (result), addr);
set_mem_attributes (x, result, 1);
}
+
+ DECL_HAS_VALUE_EXPR_P (result) = 1;
+
SET_DECL_RTL (result, x);
}