From: Richard Guenther Date: Tue, 26 Apr 2011 13:00:53 +0000 (+0000) Subject: re PR c/48731 (regression: __attribute__((flatten)) produces error with function... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e6e26e59a357e5e6d5a6d19e2c8142bbe8af86cd;p=gcc.git re PR c/48731 (regression: __attribute__((flatten)) produces error with function calling variadic functions) 2011-04-26 Richard Guenther PR tree-optimization/48731 * gcc.dg/torture/pr48731.c: New testcase. From-SVN: r172964 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b44671a651..03af544fef4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-26 Richard Guenther + + PR tree-optimization/48731 + * gcc.dg/torture/pr48731.c: New testcase. + 2011-04-26 Richard Guenther 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 index 00000000000..74b77f67c52 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr48731.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ + +#include + +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); +}