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 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


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