builtin-return-1.c: Add an inline assembly read to make sure dummy is not optimized...
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Tue, 8 Dec 2015 10:01:45 +0000 (10:01 +0000)
committerThomas Preud'homme <thopre01@gcc.gnu.org>
Tue, 8 Dec 2015 10:01:45 +0000 (10:01 +0000)
2015-12-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Joern Rennecke  <joern.rennecke@embecosm.com>

    gcc/testsuite/
    * gcc.dg/torture/stackalign/builtin-return-1.c: Add an
    inline assembly read to make sure dummy is not optimized
    away by LTO.

Co-Authored-By: Joern Rennecke <joern.rennecke@embecosm.com>
From-SVN: r231401

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c

index 5e95e2aef35906afe269ee4d707d2c4ed8b9155e..b84899fc60bf028e62e790a361f68fe9b9311455 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+           Joern Rennecke  <joern.rennecke@embecosm.com>
+
+       * gcc.dg/torture/stackalign/builtin-return-1.c: Add an
+       inline assembly read to make sure dummy is not optimized
+       away by LTO.
+
 2015-12-08  Ilya Enkovich  <enkovich.gnu@gmail.com>
 
        PR tree-optimization/68766
index af017532aeb3878ef7ad717a2743661a87a56b7d..ec4fd8a9ef33a5e755bdb33e4faa41cab0f16a60 100644 (file)
@@ -26,15 +26,13 @@ int bar(int n)
                                   STACK_ARGUMENTS_SIZE));
 }
 
-char *g;
-
 int main(void)
 {
   /* Allocate 64 bytes on the stack to make sure that __builtin_apply
      can read at least 64 bytes above the return address.  */
   char dummy[64];
 
-  g = dummy;
+  __asm__ ("" : : "" (dummy));
 
   if (bar(1) != 2)
     abort();