Commit c718820a by Richard Guenther Committed by Richard Biener

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
parent 4b414c93
2010-04-28 Richard Guenther <rguenther@suse.de>
PR c++/43880
* tree-inline.c (copy_bind_expr): Also copy bind expr vars
value-exprs.
2010-04-27 Manuel López-Ibáñez <manu@gcc.gnu.org> 2010-04-27 Manuel López-Ibáñez <manu@gcc.gnu.org>
Jan Hubicka <hubicka@ucw.cz> Jan Hubicka <hubicka@ucw.cz>
......
2010-04-28 Richard Guenther <rguenther@suse.de>
PR c++/43880
* g++.dg/torture/pr43880.C: New testcase.
2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org> 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/9335 PR c++/9335
......
// { dg-do compile }
extern void xread(void *);
class test
{
public:
test(void);
};
test::test(void)
{
union {
char pngpal[1];
};
xread(pngpal);
}
...@@ -665,9 +665,23 @@ copy_bind_expr (tree *tp, int *walk_subtrees, copy_body_data *id) ...@@ -665,9 +665,23 @@ copy_bind_expr (tree *tp, int *walk_subtrees, copy_body_data *id)
} }
if (BIND_EXPR_VARS (*tp)) if (BIND_EXPR_VARS (*tp))
/* This will remap a lot of the same decls again, but this should be {
harmless. */ tree t;
BIND_EXPR_VARS (*tp) = remap_decls (BIND_EXPR_VARS (*tp), NULL, id);
/* 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);
}
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment