aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-10-05 21:25:58 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-10-05 21:25:58 +0200
commit94645a02dca8b5b103278ec48b4c7e0fe82ccfbf (patch)
tree524a43a3fca5dcb604a85f3dacf145ce7d43eaad /gcc/tree-inline.c
parent878eef4ad8aa6858fe270ccb589d3eed4a05c8e3 (diff)
downloadgcc-94645a02dca8b5b103278ec48b4c7e0fe82ccfbf.zip
gcc-94645a02dca8b5b103278ec48b4c7e0fe82ccfbf.tar.gz
gcc-94645a02dca8b5b103278ec48b4c7e0fe82ccfbf.tar.bz2
tree-inline.c (expand_call_inline): Move VAR_DECLs with PARM_DECL origins from remapped DECL_INITIAL's BLOCK_VARS...
* tree-inline.c (expand_call_inline): Move VAR_DECLs with PARM_DECL origins from remapped DECL_INITIAL's BLOCK_VARS into id->block's BLOCK_VARS. From-SVN: r192140
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 04f87a3..2c8071e 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -3952,7 +3952,29 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
initialize_inlined_parameters (id, stmt, fn, bb);
if (DECL_INITIAL (fn))
- prepend_lexical_block (id->block, remap_blocks (DECL_INITIAL (fn), id));
+ {
+ tree *var;
+
+ prepend_lexical_block (id->block, remap_blocks (DECL_INITIAL (fn), id));
+ gcc_checking_assert (BLOCK_SUBBLOCKS (id->block)
+ && (BLOCK_CHAIN (BLOCK_SUBBLOCKS (id->block))
+ == NULL_TREE));
+ /* Move vars for PARM_DECLs from DECL_INITIAL block to id->block,
+ otherwise for DWARF DW_TAG_formal_parameter will not be children of
+ DW_TAG_inlined_subroutine, but of a DW_TAG_lexical_block
+ under it. The parameters can be then evaluated in the debugger,
+ but don't show in backtraces. */
+ for (var = &BLOCK_VARS (BLOCK_SUBBLOCKS (id->block)); *var; )
+ if (TREE_CODE (DECL_ORIGIN (*var)) == PARM_DECL)
+ {
+ tree v = *var;
+ *var = TREE_CHAIN (v);
+ TREE_CHAIN (v) = BLOCK_VARS (id->block);
+ BLOCK_VARS (id->block) = v;
+ }
+ else
+ var = &TREE_CHAIN (*var);
+ }
/* Return statements in the function body will be replaced by jumps
to the RET_LABEL. */