Commit bec63208 by Martin Jambor Committed by Martin Jambor

re PR middle-end/61654 (ICE in release_function_body, at cgraph.c:1699)

2014-09-10  Martin Jambor  <mjambor@suse.cz>

	PR ipa/61654
	* cgraphclones.c (duplicate_thunk_for_node): Copy arguments of the
	new decl properly.  Analyze the new thunk if it is expanded.

gcc/testsuite/
	* g++.dg/ipa/pr61654.C: New test.

From-SVN: r215122
parent f3955ea3
2014-09-10 Martin Jambor <mjambor@suse.cz>
PR ipa/61654
* cgraphclones.c (duplicate_thunk_for_node): Copy arguments of the
new decl properly. Analyze the new thunk if it is expanded.
2014-09-10 Andreas Schwab <schwab@suse.de>
* coretypes.h (struct _dont_use_rtx_insn_here_, rtx_insn)
......@@ -334,6 +334,22 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node)
node->clone.args_to_skip,
false);
}
tree *link = &DECL_ARGUMENTS (new_decl);
int i = 0;
for (tree pd = DECL_ARGUMENTS (thunk->decl); pd; pd = DECL_CHAIN (pd), i++)
{
if (!node->clone.args_to_skip
|| !bitmap_bit_p (node->clone.args_to_skip, i))
{
tree nd = copy_node (pd);
DECL_CONTEXT (nd) = new_decl;
*link = nd;
link = &DECL_CHAIN (nd);
}
}
*link = NULL_TREE;
gcc_checking_assert (!DECL_STRUCT_FUNCTION (new_decl));
gcc_checking_assert (!DECL_INITIAL (new_decl));
gcc_checking_assert (!DECL_RESULT (new_decl));
......@@ -357,6 +373,11 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node)
symtab->call_edge_duplication_hooks (thunk->callees, e);
if (!new_thunk->expand_thunk (false, false))
new_thunk->analyzed = true;
else
{
new_thunk->thunk.thunk_p = false;
new_thunk->analyze ();
}
symtab->call_cgraph_duplication_hooks (thunk, new_thunk);
return new_thunk;
......
2014-09-10 Martin Jambor <mjambor@suse.cz>
PR ipa/61654
* g++.dg/ipa/pr61654.C: New test.
2014-09-10 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/ubsan/attrib-3.c: New test.
......
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* The bug only presented itself on a 32 bit i386 but in theory it might also
pop up elsewhere and we do not want to put -m32 options to testcase
options. */
struct A
{
virtual int a (int, int = 0) = 0;
void b ();
void c ();
int d;
};
struct B : virtual A
{
int a (int, int);
int e;
};
int f;
void
A::b ()
{
a (0);
}
void
A::c ()
{
a (f);
}
int
B::a (int, int)
{
return e;
}
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