aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2010-12-22 03:49:00 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2010-12-22 03:49:00 +0000
commit8dcfef8f2b2ad81873c1d2bb55182125e3190557 (patch)
treeacd635446a64407453a2f7688ccccc3c965f09f8 /gcc/function.c
parent16a9afdc664f58ab8ad5e4bd2468cda18375d121 (diff)
downloadgcc-8dcfef8f2b2ad81873c1d2bb55182125e3190557.zip
gcc-8dcfef8f2b2ad81873c1d2bb55182125e3190557.tar.gz
gcc-8dcfef8f2b2ad81873c1d2bb55182125e3190557.tar.bz2
re PR debug/46724 (Wrong debug info: Invalid variable location)
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. From-SVN: r168160
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 7fa3b0c..0c4d5f8 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);
}