Commit ceeb21ef by Andre Vieira Committed by Thomas Preud'homme

builtin-return-1.c: Add an inline assembly read to make sure dummy is not optimized away by LTO.

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
parent 5b688993
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> 2015-12-08 Ilya Enkovich <enkovich.gnu@gmail.com>
PR tree-optimization/68766 PR tree-optimization/68766
......
...@@ -26,15 +26,13 @@ int bar(int n) ...@@ -26,15 +26,13 @@ int bar(int n)
STACK_ARGUMENTS_SIZE)); STACK_ARGUMENTS_SIZE));
} }
char *g;
int main(void) int main(void)
{ {
/* Allocate 64 bytes on the stack to make sure that __builtin_apply /* Allocate 64 bytes on the stack to make sure that __builtin_apply
can read at least 64 bytes above the return address. */ can read at least 64 bytes above the return address. */
char dummy[64]; char dummy[64];
g = dummy; __asm__ ("" : : "" (dummy));
if (bar(1) != 2) if (bar(1) != 2)
abort(); abort();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment