This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE with -Walloca-larger-than=[>INT_MAX] (PR middle-end/79809)
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 08 Mar 2017 12:30:59 +0100
- Subject: Re: [PATCH] Fix ICE with -Walloca-larger-than=[>INT_MAX] (PR middle-end/79809)
- Authentication-results: sourceware.org; auth=none
- References: <20170302123223.GI3172@redhat.com>
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."