From: Martin Liska Date: Fri, 7 Nov 2014 13:37:41 +0000 (+0100) Subject: re PR ipa/63580 (ICE : error: invalid argument to gimple call) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d862b3439d1996c99a532476a181b6f3c0c69257;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e721a68b20..c418283e84a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-07 Martin Liska + + 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 PR ipa/63747 diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 75d414024a7..25af2347f42 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 036d59d3013..6bd9aed5ec2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-07 Martin Liska + + PR ipa/63580 + * g++.dg/ipa/pr63580.C: New test. + 2014-11-07 Martin Liska PR ipa/63747 diff --git a/gcc/testsuite/g++.dg/ipa/pr63580.C b/gcc/testsuite/g++.dg/ipa/pr63580.C new file mode 100644 index 00000000000..904195a70be --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr63580.C @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-icf" } */ + +struct A +{ +}; +template A operator%(L, R); +template +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" } } */