re PR tree-optimization/27830 (ICE: verify_stmts failed (invalid operand to unary operator))

2006-06-13  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/27830
	* tree-inline.c (copy_body_r): For copying the operand
	of an ADDR_EXPR make sure to fold &* afterwards.

	* g++.dg/tree-ssa/pr27830.C: New testcase.

From-SVN: r114600
This commit is contained in:
Richard Guenther 2006-06-13 07:22:04 +00:00 committed by Richard Biener
parent c67ed86a4a
commit 8e85fd14bf
4 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-06-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/27830
* tree-inline.c (copy_body_r): For copying the operand
of an ADDR_EXPR make sure to fold &* afterwards.
2006-06-12 Eric Botcazou <ebotcazou@adacore.com>
* gimplify.c (gimplify_expr): Treat VIEW_CONVERT_EXPR like other

View File

@ -1,3 +1,8 @@
2006-06-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/27830
* g++.dg/tree-ssa/pr27830.C: New testcase.
2006-06-13 Matthew Sachs <msachs@apple.com>
* lib/target-supports-dg.exp (check-flags): Include TOOL_OPTIONS in

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
/* { dg-options "-O" } */
struct gc{};
struct transform:public gc
{
double x, y, z, t;
transform (void){}
};
inline transform f (void)
{
return transform ();
};
void transformed (void)
{
new transform (f());
}

View File

@ -659,7 +659,12 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
else if (TREE_CODE (*tp) == ADDR_EXPR)
{
walk_tree (&TREE_OPERAND (*tp, 0), copy_body_r, id, NULL);
recompute_tree_invariant_for_addr_expr (*tp);
/* Handle the case where we substituted an INDIRECT_REF
into the operand of the ADDR_EXPR. */
if (TREE_CODE (TREE_OPERAND (*tp, 0)) == INDIRECT_REF)
*tp = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
else
recompute_tree_invariant_for_addr_expr (*tp);
*walk_subtrees = 0;
}
}