diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2014-06-06 08:13:24 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2014-06-06 08:13:24 +0000 |
commit | 3fd48b121a654c914b2784334650d23095d938e4 (patch) | |
tree | a57bf7572560464ca1f1c66047de9e49d3a81f12 /gcc/tree-nested.c | |
parent | 9b7a11e15385db8fe350c7b3f90f8530c18f2a11 (diff) | |
download | gcc-3fd48b121a654c914b2784334650d23095d938e4.zip gcc-3fd48b121a654c914b2784334650d23095d938e4.tar.gz gcc-3fd48b121a654c914b2784334650d23095d938e4.tar.bz2 |
re PR debug/53927 (wrong value for DW_AT_static_link)
PR debug/53927
* function.c (instantiate_decls): Process the saved static chain.
(expand_function_start): If not optimizing, save the static chain
onto the stack.
* tree-nested.c (convert_all_function_calls): Always create the static
chain for nested functions if not optimizing.
From-SVN: r211308
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r-- | gcc/tree-nested.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index ba2cc76..85c6a03 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -2220,11 +2220,21 @@ convert_all_function_calls (struct nesting_info *root) struct nesting_info *n; /* First, optimistically clear static_chain for all decls that haven't - used the static chain already for variable access. */ + used the static chain already for variable access. But always create + it if not optimizing. This makes it possible to reconstruct the static + nesting tree at run time and thus to resolve up-level references from + within the debugger. */ FOR_EACH_NEST_INFO (n, root) { tree decl = n->context; - if (!n->outer || (!n->chain_decl && !n->chain_field)) + if (!optimize) + { + if (n->inner) + (void) get_frame_type (n); + if (n->outer) + (void) get_chain_decl (n); + } + else if (!n->outer || (!n->chain_decl && !n->chain_field)) { DECL_STATIC_CHAIN (decl) = 0; if (dump_file && (dump_flags & TDF_DETAILS)) |