diff options
author | Richard Guenther <rguenther@suse.de> | 2010-04-28 10:28:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-04-28 10:28:24 +0000 |
commit | c718820a974fa2cbd5a181e02d8d19ac2b3dd8f6 (patch) | |
tree | 7999d339ebaee84237dd0f4491fd8a82fb8f6cb1 /gcc/tree-inline.c | |
parent | 4b414c93f0d6e1e70bff5eaca0fb8f066f793883 (diff) | |
download | gcc-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.c | 20 |
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); + } + } } |