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: Marek Polacek <polacek at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 8 Mar 2017 13:56:32 +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> <877f400zv0.fsf@linux-m68k.org>
On Wed, Mar 08, 2017 at 12:30:59PM +0100, Andreas Schwab wrote:
> 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=]
Ok, this should help:
2017-03-08 Marek Polacek <polacek@redhat.com>
* g++.dg/Walloca1.C: Adjust dg-warning.
diff --git gcc/testsuite/g++.dg/Walloca1.C gcc/testsuite/g++.dg/Walloca1.C
index 23b97e8..818c6f0 100644
--- gcc/testsuite/g++.dg/Walloca1.C
+++ gcc/testsuite/g++.dg/Walloca1.C
@@ -3,4 +3,4 @@
/* { 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" }
+char *b = static_cast<char *>(__builtin_alloca (a)); // { dg-warning "argument to .alloca. may be too large|unbounded use of" }
Marek