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 PR middle-end/37669


On Mon, Oct 20, 2008 at 02:58:45PM -0700, Adam Nemet wrote:
> > Also, you should include a testcase with the patch, e.g.
> > following testcase reproduces it well for me:
> > 
> > --- gcc/testsuite/gcc.c-torture/compile/pr37669.c	2008-09-30 10:18:57.740011359 +0200
> > +++ gcc/testsuite/gcc.c-torture/compile/pr37669.c	2008-10-20 23:44:27.000000000 +0200
> > @@ -0,0 +1,14 @@
> > +/* PR middle-end/37669 */
> > +
> > +#define FMT10 "%d%d%d%d%d%d%d%d%d%d"
> > +#define FMT100 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10
> > +#define FMT1000 FMT100 FMT100 FMT100 FMT100 FMT100 \
> > +		FMT100 FMT100 FMT100 FMT100 FMT100
> > +#define ARG10 , i, i, i, i, i, i, i, i, i, i
> > +#define ARG100 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10
> > +#define ARG1000 ARG100 ARG100 ARG100 ARG100 ARG100 \
> > +		ARG100 ARG100 ARG100 ARG100 ARG100
> > +void foo (char *s, int i, int j)
> > +{
> > +  __builtin___snprintf_chk (s, i, 1, j, FMT1000 ARG1000);
> > +}
> 
> The testcase is already in the testsuite per
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37669#c8

You're right, but that testcase clearly FAILs only on a few arches,
with 1000 args it fails everywhere, reproduceably.
So IMHO it doesn't hurt to add it too, just it will have to be
called pr37669-2.c or similarly.

	Jakub


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