re PR c/48731 (regression: __attribute__((flatten)) produces error with function...
authorRichard Guenther <rguenther@suse.de>
Tue, 26 Apr 2011 13:00:53 +0000 (13:00 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 26 Apr 2011 13:00:53 +0000 (13:00 +0000)
2011-04-26  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/48731
* gcc.dg/torture/pr48731.c: New testcase.

From-SVN: r172964

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr48731.c [new file with mode: 0644]

index 8b44671a6512ce6190bb15ea1461cfb71d3bc90c..03af544fef4e5400fd6ff1346781d7590e569252 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-26  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/48731
+       * gcc.dg/torture/pr48731.c: New testcase.
+
 2011-04-26  Richard Guenther  <rguenther@suse.de>
 
        PR testsuite/48753
diff --git a/gcc/testsuite/gcc.dg/torture/pr48731.c b/gcc/testsuite/gcc.dg/torture/pr48731.c
new file mode 100644 (file)
index 0000000..74b77f6
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+int blah(int a, ...)
+{
+  va_list va;
+  va_start(va,a);
+  if (a == 0)
+    return -1;
+  else 
+    {
+      int i;
+      for (i = 0; i < a; i++)
+       va_arg(va,int);
+      return va_arg(va,int);
+    }
+}
+
+__attribute((flatten))
+int blah2(int b, int c)
+{
+  return blah(2, b, c);
+}