On 07/27/2011 01:50 PM, Tom de Vries wrote:
> Hi Richard,
> 
> I have a patch set for bug 43513 - The stack pointer is adjusted twice.
> 
> 01_pr43513.3.patch
> 02_pr43513.3.test.patch
> 03_pr43513.3.mudflap.patch
> 
> The patch set has been bootstrapped and reg-tested on x86_64.
> 
> I will sent out the patches individually.
> 

The testcase
http://gcc.gnu.org/svn/gcc/trunk/libmudflap/testsuite/libmudflap.c/fail31-frag.c
contains a vla and a dead and illegal store to that vla.
Dead because the contents of the array is not read during it's lifetime, illegal
because it writes past the array end.

Normally, the store is not removed by pass_cd_dce because
is_hidden_global_store.  With the alloca folded into an array declaration, this
is no longer the case, the store is removed and mudflap no longer complains.

Adding the attribute ensures that the alloca is not folded.

OK for trunk?

Thanks,
- Tom

2011-07-27  Tom de Vries  <t...@codesourcery.com>

        PR middle-end/43513
        * testsuite/libmudflap.c/fail31-frag.c: Adapt testcase to prevent
        folding of alloca.
Index: libmudflap/testsuite/libmudflap.c/fail31-frag.c
===================================================================
--- libmudflap/testsuite/libmudflap.c/fail31-frag.c	(revision 176554)
+++ libmudflap/testsuite/libmudflap.c/fail31-frag.c	(working copy)
@@ -9,6 +9,7 @@ int main ()
   return 0;
 }
 int *p;
+__attribute__((noinline))
 int h (int i, int j)
 {
   int k[i];

Reply via email to