summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-25 16:15:38 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-25 16:15:38 +0000
commitcd3ece5320bbe2462d7f17d39ae81e0398f2c252 (patch)
treead9e7454c414627ffdd7dd66d6dfc5825128c0a9 /gcc/tree-inline.c
parent78af26dcfa6f511ad1c98690f8f81c9e9074b395 (diff)
downloadgcc-cd3ece5320bbe2462d7f17d39ae81e0398f2c252.tar.gz
PR debug/42801
* tree-inline.c (remap_decls): Remap DECL_VALUE_EXPR here... (copy_bind_expr): ... instead of here. (copy_tree_body_r): If id->remapping_type_depth clear TREE_BLOCK if the block hasn't been remapped. * dwarf2out.c (gen_formal_parameter_die, gen_variable_die): When emitting concrete instance of abstract VLA, add DW_AT_type attribute. * gcc.dg/guality/sra-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159826 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 4c51f3b10c8..342b5a5f082 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -574,6 +574,19 @@ remap_decls (tree decls, VEC(tree,gc) **nonlocalized_list, copy_body_data *id)
gcc_assert (DECL_P (new_var));
TREE_CHAIN (new_var) = new_decls;
new_decls = new_var;
+
+ /* Also copy value-expressions. */
+ if (TREE_CODE (new_var) == VAR_DECL
+ && DECL_HAS_VALUE_EXPR_P (new_var))
+ {
+ tree tem = DECL_VALUE_EXPR (new_var);
+ bool old_regimplify = id->regimplify;
+ id->remapping_type_depth++;
+ walk_tree (&tem, copy_tree_body_r, id, NULL);
+ id->remapping_type_depth--;
+ id->regimplify = old_regimplify;
+ SET_DECL_VALUE_EXPR (new_var, tem);
+ }
}
}
@@ -665,23 +678,9 @@ copy_bind_expr (tree *tp, int *walk_subtrees, copy_body_data *id)
}
if (BIND_EXPR_VARS (*tp))
- {
- tree t;
-
- /* This will remap a lot of the same decls again, but this should be
- harmless. */
- BIND_EXPR_VARS (*tp) = remap_decls (BIND_EXPR_VARS (*tp), NULL, id);
-
- /* Also copy value-expressions. */
- for (t = BIND_EXPR_VARS (*tp); t; t = TREE_CHAIN (t))
- if (TREE_CODE (t) == VAR_DECL
- && DECL_HAS_VALUE_EXPR_P (t))
- {
- tree tem = DECL_VALUE_EXPR (t);
- walk_tree (&tem, copy_tree_body_r, id, NULL);
- SET_DECL_VALUE_EXPR (t, tem);
- }
- }
+ /* This will remap a lot of the same decls again, but this should be
+ harmless. */
+ BIND_EXPR_VARS (*tp) = remap_decls (BIND_EXPR_VARS (*tp), NULL, id);
}
@@ -1116,8 +1115,9 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
tree *n;
n = (tree *) pointer_map_contains (id->decl_map,
TREE_BLOCK (*tp));
- gcc_assert (n);
- new_block = *n;
+ gcc_assert (n || id->remapping_type_depth != 0);
+ if (n)
+ new_block = *n;
}
TREE_BLOCK (*tp) = new_block;
}