This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit targets
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Jul 2007 14:35:50 -0700
- Subject: Re: RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit targets
- References: <20070528092935.GZ5690@sygehus.dk> <20070528123444.GD5690@sygehus.dk> <20070529173642.GB5168@us.ibm.com> <20070721092054.GA5690@sygehus.dk>
- Reply-to: janis187 at us dot ibm dot com
On Sat, 2007-07-21 at 11:20 +0200, Rask Ingemann Lambertsen wrote:
> On Tue, May 29, 2007 at 10:36:42AM -0700, Janis Johnson wrote:
>
> > Or you could check the value of INT_MAX:
> >
> > --- dump-noaddr.c.orig 2007-05-29 10:29:08.992247040 -0700
> > +++ dump-noaddr.c 2007-05-29 10:28:08.908194752 -0700
> > @@ -1,10 +1,21 @@
> > +#include <limits.h>
> > +
> > #if MASK & 1
> > +#define t11(x) x x x x x x x x x x x
> > #define t16(x) x x x x x x x x x x x x x x x x
> > +#if INT_MAX < 2147483647
> > +#define M (sizeof (t11(t11(t16(t16(" "))))) - 1)
> > +#else
> > #define M (sizeof (t16(t16(t16(t16(t16(" ")))))) - 1)
> > #endif
> > +#endif
> > #if MASK & 2
> > +#if INT_MAX < 2147483647
> > +#define M 30976
> > +#else
> > #define M 1048576
> > #endif
> > +#endif
> >
> > typedef struct s {
> > int c;
> >
> > Janis
>
> Your patch fixes it. I checked on m32c-unkonwn-elf, i686-pc-linux-gnu and
> x86_64-unknown-linux-gnu and it passes on all three.
This is OK for mainline.
Janis