Patchwork [PR43513,2/3] Replace vla with array - Test case.

login
register
mail settings
Submitter Tom de Vries
Date July 30, 2011, 7:36 a.m.
Message ID <4E33B48D.1060707@codesourcery.com>
Download mbox | patch
Permalink /patch/107483/
State New
Headers show

Comments

Tom de Vries - July 30, 2011, 7:36 a.m.
On 07/27/2011 01:55 PM, Tom de Vries wrote:
> On 07/27/2011 01:54 PM, Tom de Vries wrote:
>> 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.
>>>
> 
> Sorry, with patch this time.
> 
>>
>> This patch adds the testcase from the bug report, modified not to
>> need includes.
>>

Updated test case, tranformation should happen during ccp2.

OK for trunk?

Thanks,
- Tom

2011-07-30  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/43513
	* gcc.dg/pr43513.c: New test.

Patch

Index: gcc/testsuite/gcc.dg/pr43513.c
===================================================================
--- gcc/testsuite/gcc.dg/pr43513.c	(revision 0)
+++ gcc/testsuite/gcc.dg/pr43513.c	(revision 0)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp2" } */
+
+void bar (int *);
+void foo (char *, int);
+
+void
+foo3 ()
+{
+  const int kIterations = 10;
+  int results[kIterations];
+  int i;
+  bar (results);
+  for (i = 0; i < kIterations; i++)
+    foo ("%d ", results[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "alloca" 0 "ccp2"} } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */