On Tue, Aug 19, 2014 at 1:05 PM, Mark Wielaard <m...@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 <m...@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; >