re PR ipa/63580 (ICE : error: invalid argument to gimple call)

PR ipa/63580
        * cgraphunit.c (cgraph_node::create_wrapper):
	TREE_ADDRESSABLE is set to false for a newly created thunk.
	* g++.dg/ipa/pr63580.C: New test.

From-SVN: r217222
This commit is contained in:
Martin Liska 2014-11-07 14:37:41 +01:00 committed by Martin Liska
parent 6343f5d75b
commit d862b3439d
4 changed files with 45 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2014-11-07 Martin Liska <mliska@suse.cz>
PR ipa/63580
* cgraphunit.c (cgraph_node::create_wrapper):
TREE_ADDRESSABLE is set to false for a newly created thunk.
2014-11-07 Martin Liska <mliska@suse.cz>
PR ipa/63747

View File

@ -2369,6 +2369,14 @@ cgraph_node::create_wrapper (cgraph_node *target)
cgraph_edge *e = create_edge (target, NULL, 0, CGRAPH_FREQ_BASE);
tree arguments = DECL_ARGUMENTS (decl);
while (arguments)
{
TREE_ADDRESSABLE (arguments) = false;
arguments = TREE_CHAIN (arguments);
}
expand_thunk (false, true);
e->call_stmt_cannot_inline_p = true;

View File

@ -1,3 +1,8 @@
2014-11-07 Martin Liska <mliska@suse.cz>
PR ipa/63580
* g++.dg/ipa/pr63580.C: New test.
2014-11-07 Martin Liska <mliska@suse.cz>
PR ipa/63747

View File

@ -0,0 +1,26 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-icf" } */
struct A
{
};
template <class L, class R> A operator%(L, R);
template <class A0, class A1, class A2, class A3>
void make_tuple (A0 &, A1, A2, A3);
A
bar (int p1, char p2, int p3, double p4)
{
A a;
make_tuple (p1, p2, p3, p4);
return "int; char; string; double; " % a;
}
A
foo (int p1, char p2, int p3, double p4)
{
A b;
make_tuple (p1, p2, p3, p4);
return "int; char; string; double; " % b;
}
/* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */
/* { dg-final { cleanup-ipa-dump "icf" } } */