This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix guality/nrv-1.c LTO failure
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Aldy Hernandez <aldyher at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 18 Aug 2014 12:32:52 +0200
- Subject: Re: [patch] fix guality/nrv-1.c LTO failure
- Authentication-results: sourceware.org; auth=none
- References: <53EE6DB5 dot 3090801 at gmail dot com>
On Fri, Aug 15, 2014 at 10:29 PM, Aldy Hernandez <aldyher@gmail.com> wrote:
> This test is failing with LTO because in the LTRANS phase (DCE) we realize
> that the call to f() is useless, so we don't generate it. This leads to an
> uncalled f() which also gets deleted. We end up with an empty main(), and
> rightly so, gdb has nothing good to print.
>
> Marking `a1' as used keeps things in good enough shape so everyone is happy.
>
> OK for mainline?
Ok.
Thanks,
Richard.
> * guality/nrv-1.c: Add `used' attribute to a1.
>
> diff --git a/gcc/testsuite/gcc.dg/guality/nrv-1.c
> b/gcc/testsuite/gcc.dg/guality/nrv-1.c
> index 6e70050..2f4e654 100644
> --- a/gcc/testsuite/gcc.dg/guality/nrv-1.c
> +++ b/gcc/testsuite/gcc.dg/guality/nrv-1.c
> @@ -8,7 +8,7 @@ struct A
> int i[100];
> };
>
> -struct A a1, a3;
> +struct A a1 __attribute__((used)), a3;
>
> __attribute__((noinline)) struct A
> f ()
>