This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix ICE with -Walloca-larger-than=[>INT_MAX] (PR middle-end/79809)


On Mär 02 2017, Marek Polacek <polacek@redhat.com> wrote:

> diff --git gcc/testsuite/g++.dg/Walloca1.C gcc/testsuite/g++.dg/Walloca1.C
> index e69de29..23b97e8 100644
> --- gcc/testsuite/g++.dg/Walloca1.C
> +++ gcc/testsuite/g++.dg/Walloca1.C
> @@ -0,0 +1,6 @@
> +/* PR middle-end/79809 */
> +/* { dg-do compile } */
> +/* { dg-options "-Walloca-larger-than=4207115063 -Wvla-larger-than=1233877270 -O2" } */
> +
> +int a;
> +char *b = static_cast<char *>(__builtin_alloca (a)); // { dg-warning "argument to .alloca. may be too large" }

FAIL: g++.dg/Walloca1.C  -std=gnu++11  (test for warnings, line 6)
FAIL: g++.dg/Walloca1.C  -std=gnu++11 (test for excess errors)
Excess errors:
/daten/aranym/gcc/gcc-20170308/gcc/testsuite/g++.dg/Walloca1.C:6:48: warning: unbounded use of 'alloca' [-Walloca-larger-than=]

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]