mirror of git://gcc.gnu.org/git/gcc.git
re PR tree-optimization/37568 (ICE returning a struct)
PR c++/37568 * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of setting it to error_mark_node. * testsuite/libmudflap.c++/pass66-frag.cxx: New test. From-SVN: r141010
This commit is contained in:
parent
1692ae7eda
commit
2d18853048
|
|
@ -1,3 +1,9 @@
|
|||
2008-10-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/37568
|
||||
* semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
|
||||
setting it to error_mark_node.
|
||||
|
||||
2008-10-07 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* decl.c (start_cleanup_fn): Declare as inline.
|
||||
|
|
|
|||
|
|
@ -3310,13 +3310,11 @@ finalize_nrv_r (tree* tp, int* walk_subtrees, void* data)
|
|||
tree init;
|
||||
if (DECL_INITIAL (dp->var)
|
||||
&& DECL_INITIAL (dp->var) != error_mark_node)
|
||||
{
|
||||
init = build2 (INIT_EXPR, void_type_node, dp->result,
|
||||
DECL_INITIAL (dp->var));
|
||||
DECL_INITIAL (dp->var) = error_mark_node;
|
||||
}
|
||||
init = build2 (INIT_EXPR, void_type_node, dp->result,
|
||||
DECL_INITIAL (dp->var));
|
||||
else
|
||||
init = build_empty_stmt ();
|
||||
DECL_INITIAL (dp->var) = NULL_TREE;
|
||||
SET_EXPR_LOCUS (init, EXPR_LOCUS (*tp));
|
||||
*tp = init;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2008-10-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/37568
|
||||
* testsuite/libmudflap.c++/pass66-frag.cxx: New test.
|
||||
|
||||
2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
|
||||
Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
// PR c++/37568
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fmudflap -O" }
|
||||
|
||||
struct A
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
A
|
||||
foo ()
|
||||
{
|
||||
A a = { 1 };
|
||||
return a;
|
||||
}
|
||||
|
||||
A a = foo ();
|
||||
Loading…
Reference in New Issue