aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-04-28 10:28:24 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-04-28 10:28:24 +0000
commitc718820a974fa2cbd5a181e02d8d19ac2b3dd8f6 (patch)
tree7999d339ebaee84237dd0f4491fd8a82fb8f6cb1 /gcc/tree-inline.c
parent4b414c93f0d6e1e70bff5eaca0fb8f066f793883 (diff)
downloadgcc-c718820a974fa2cbd5a181e02d8d19ac2b3dd8f6.zip
gcc-c718820a974fa2cbd5a181e02d8d19ac2b3dd8f6.tar.gz
gcc-c718820a974fa2cbd5a181e02d8d19ac2b3dd8f6.tar.bz2
re PR middle-end/43880 (internal compiler error: in make_decl_rtl)
2010-04-28 Richard Guenther <rguenther@suse.de> PR c++/43880 * tree-inline.c (copy_bind_expr): Also copy bind expr vars value-exprs. * g++.dg/torture/pr43880.C: New testcase. From-SVN: r158824
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 9fb9faf..7f35c4d 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -665,9 +665,23 @@ copy_bind_expr (tree *tp, int *walk_subtrees, copy_body_data *id)
}
if (BIND_EXPR_VARS (*tp))
- /* 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);
+ {
+ 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);
+ }
+ }
}