From ceeb21ef31825ce5f7fca47797e2c724f406c444 Mon Sep 17 00:00:00 2001 From: Andre Vieira Date: Tue, 8 Dec 2015 10:01:45 +0000 Subject: [PATCH] builtin-return-1.c: Add an inline assembly read to make sure dummy is not optimized away by LTO. 2015-12-08 Andre Vieira Joern Rennecke 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 From-SVN: r231401 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e95e2aef35..b84899fc60b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-12-08 Andre Vieira + Joern Rennecke + + * 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 PR tree-optimization/68766 diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c index af017532aeb..ec4fd8a9ef3 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c @@ -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(); -- 2.30.2