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
This commit is contained in:
Richard Guenther 2010-04-28 10:28:24 +00:00 committed by Richard Biener
parent 4b414c93f0
commit c718820a97
4 changed files with 44 additions and 3 deletions

View File

@ -1,3 +1,9 @@
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>
Jan Hubicka <hubicka@ucw.cz>

View File

@ -1,3 +1,8 @@
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>
PR c++/9335

View File

@ -0,0 +1,16 @@
// { dg-do compile }
extern void xread(void *);
class test
{
public:
test(void);
};
test::test(void)
{
union {
char pngpal[1];
};
xread(pngpal);
}

View File

@ -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);
}
}
}