[PR43513,3/3] Replace vla with array - Adapt mudflap testcase.

Message ID 4E2FEF2A.7010200@codesourcery.com
State New
Headers show

Commit Message

Tom de Vries July 27, 2011, 10:57 a.m.
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
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?

- Tom

2011-07-27  Tom de Vries  <tom@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;
 int h (int i, int j)
   int k[i];