This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR 63721 IPA ICF cause atomic-comp-swap-release-acquire.c ICE
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Martin Liška <mliska at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, "hubic >> Jan Hubicka" <hubicka at ucw dot cz>
- Date: Fri, 7 Nov 2014 14:25:40 +0100
- Subject: Re: [PATCH] PR 63721 IPA ICF cause atomic-comp-swap-release-acquire.c ICE
- Authentication-results: sourceware.org; auth=none
- References: <545A2FB4 dot 8060509 at arm dot com> <545C02C0 dot 2020805 at redhat dot com> <20141107095229 dot GC25817 at atrey dot karlin dot mff dot cuni dot cz> <545CC0E4 dot 7050602 at suse dot cz>
> >> jeff
>
> Hello.
>
> I think the bug is a duplicate of PR63580 and there's working patch that can bootstrap on x86_64-linux and no regression has been seen.
>
> Ready for trunk?
> Thanks,
> Martin
> gcc/ChangeLog:
>
> 2014-11-07 Martin Liska <mliska@suse.cz>
>
> * cgraphunit.c (cgraph_node::create_wrapper):
> TREE_ADDRESSABLE is set to false for a newly created thunk.
OK,
thanks!
Honza
>
> gcc/testsuite/ChangeLog:
>
> 2014-11-07 Martin Liska <mliska@suse.cz>
>
> * g++.dg/ipa/pr63580.C: New test.
> diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
> index 6f61f5c..89c96dc 100644
> --- a/gcc/cgraphunit.c
> +++ b/gcc/cgraphunit.c
> @@ -2342,6 +2342,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/g++.dg/ipa/pr63580.C b/gcc/testsuite/g++.dg/ipa/pr63580.C
> new file mode 100644
> index 0000000..904195a
> --- /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 <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" } } */