This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] fix guality/nrv-1.c LTO failure


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 ()
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]