diff mbox

Add guality [p]type test.

Message ID 1408446359.3370.12.camel@bordewijk.wildebeest.org
State New
Headers show

Commit Message

Mark Wielaard Aug. 19, 2014, 11:05 a.m. UTC
On Mon, 2014-07-07 at 11:57 +0200, Richard Biener wrote:
> Btw, why doesn't it succeed with LTO?  I suspect it's because
> we drop the unused variables - try adding __attribute__((used)) to
> them.

You are right, this makes the whole new test PASS also with LTO:

2014-08-19  Mark Wielaard  <mjw@redhat.com>

    * gcc.dg/guality/const-volatile.c: Add `used' attribute to pi.

OK to commit?

Thanks,

Mark

Comments

Richard Biener Aug. 19, 2014, 11:22 a.m. UTC | #1
On Tue, Aug 19, 2014 at 1:05 PM, Mark Wielaard <mjw@redhat.com> wrote:
> On Mon, 2014-07-07 at 11:57 +0200, Richard Biener wrote:
>> Btw, why doesn't it succeed with LTO?  I suspect it's because
>> we drop the unused variables - try adding __attribute__((used)) to
>> them.
>
> You are right, this makes the whole new test PASS also with LTO:
>
> 2014-08-19  Mark Wielaard  <mjw@redhat.com>
>
>     * gcc.dg/guality/const-volatile.c: Add `used' attribute to pi.
>
> OK to commit?

Ok.

Thanks,
Richard.

> Thanks,
>
> Mark
>
> diff --git a/gcc/testsuite/gcc.dg/guality/const-volatile.c b/gcc/testsuite/gcc.dg/guality/const-volatile.c
> index 6c2b617..86460e4 100644
> --- a/gcc/testsuite/gcc.dg/guality/const-volatile.c
> +++ b/gcc/testsuite/gcc.dg/guality/const-volatile.c
> @@ -7,7 +7,7 @@ const int ci;
>  volatile int vi;
>  const volatile int cvi;
>
> -int *pi;
> +int *pi __attribute__((used));
>  const int *pci;
>  volatile int *pvi;
>  const volatile int *pcvi;
>
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/guality/const-volatile.c b/gcc/testsuite/gcc.dg/guality/const-volatile.c
index 6c2b617..86460e4 100644
--- a/gcc/testsuite/gcc.dg/guality/const-volatile.c
+++ b/gcc/testsuite/gcc.dg/guality/const-volatile.c
@@ -7,7 +7,7 @@  const int ci;
 volatile int vi;
 const volatile int cvi;
 
-int *pi;
+int *pi __attribute__((used));
 const int *pci;
 volatile int *pvi;
 const volatile int *pcvi;