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, 29 May 2007 10:36:42 -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>
On Mon, May 28, 2007 at 02:34:44PM +0200, Rask Ingemann Lambertsen wrote:
> On Mon, May 28, 2007 at 11:29:35AM +0200, Rask Ingemann Lambertsen wrote:
> > This test generates around 300 bogus failures on 16-bit targets. The
> > attached patch, tested on m32-unknown-elf, i686-pc-linux-gnu and
> > mipsisa64-unknown-elf, reduces the length of the string enought to make the
> > tests pass on 16-bit targets, but I'd prefer a way which keeps the original
> > string length on targets where it ought to work. Any ideas?
>
> We have effective_target_int32plus and effective_target_int16. I'll
> submit a patch based on that.
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