This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Enable 20040130-1.c and 961203-1.c only when __INT_MAX__>= 2147483647L.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 09 Feb 2004 21:00:59 -0500 (EST)
- Subject: [patch] Enable 20040130-1.c and 961203-1.c only when __INT_MAX__>= 2147483647L.
Hi,
Attached is a patch to enable 20040130-1.c and 961203-1.c only when
__INT_MAX__ >= 2147483647L.
For 20040130-1.c, bit-fields of width greater than 16 have problems on
16-bit int.
For 961203-1.c, the same applies, but the situation is a little more
complicated. As you can see from the patch, there is my past attempt
to XFAIL in certain cases, but that's wrong. The options -mno-h and
-mn on H8/300 indicate that a pointer is 16-bit wide, but the point is
rather whether int is 32-bit wide or narrower. This int issue must
also apply to xstormy16 and m68hc1[12] as their int is also 16-bit.
(Well, to be precise, on m68hc1[12], -mshort controls the int size.
Tested on h8300-hms. OK to apply?
Kazu Hirata
2004-02-09 Kazu Hirata <kazu@cs.umass.edu>
* gcc.c-torture/compile/20040130-1.c: Enable only when
__INT_MAX__ >= 2147483647L.
* gcc.c-torture/compile/961203-1.c: Likewise.
Index: 20040130-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/compile/20040130-1.c,v
retrieving revision 1.1
diff -u -r1.1 20040130-1.c
--- 20040130-1.c 30 Jan 2004 07:00:45 -0000 1.1
+++ 20040130-1.c 9 Feb 2004 16:14:21 -0000
@@ -12,9 +12,13 @@
unsigned int :4;
unsigned short :14;
unsigned int G938:8;
+#if __INT_MAX__ >= 2147483647L
unsigned int :30;
+#endif
unsigned short :16;
+#if __INT_MAX__ >= 2147483647L
unsigned int :18;
+#endif
unsigned short G939:9;
} G928b;
Index: 961203-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/compile/961203-1.c,v
retrieving revision 1.5
diff -u -r1.5 961203-1.c
--- 961203-1.c 23 Dec 2003 20:36:59 -0000 1.5
+++ 961203-1.c 9 Feb 2004 16:14:21 -0000
@@ -1,8 +1,8 @@
/* The structure is too large for the xstormy16 - won't fit in 16
bits. */
-/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } } */
-/* { dg-do assemble { xfail xstormy16-*-* m6811-*-* m6812-*-* } } */
+/* { dg-do assemble } */
+#if __INT_MAX__ >= 2147483647L
struct s {
char a[0x32100000];
int x:30, y:30;
@@ -17,3 +17,6 @@
if (p->x == p->y)
exit (1);
}
+#else
+int g;
+#endif