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] Add guality [p]type test.


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

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;


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