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]

[patch] Make execute/20040331-1.c compatible with 16-bit targets.


Hi,

Attached is a patch to make execute/20040331-1.c compatible with
16-bit targets.

On 16-bit targets, we cannot have a bit-field wider than 16 bits.  The
patch supplies a 16-bit version of the testcase.

Tested on h8300-elf.  OK to apply?

Kazu Hirata

2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>

	* gcc.c-torture/execute/20040331-1.c: Don't use too wide a
	bit-field on 16-bit targets.

Index: 20040331-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20040331-1.c,v
retrieving revision 1.1
diff -u -r1.1 20040331-1.c
--- 20040331-1.c	1 Apr 2004 15:50:11 -0000	1.1
+++ 20040331-1.c	30 Apr 2004 02:20:36 -0000
@@ -5,8 +5,16 @@
 int
 main (void)
 {
+#if __INT_MAX__ >= 2147483647
   struct { int count: 31; } s = { 0 };
   while (s.count--)
     abort ();
+#elif __INT_MAX__ >= 32767
+  struct { int count: 15; } s = { 0 };
+  while (s.count--)
+    abort ();
+#else
+  /* Don't bother because __INT_MAX__ is too small.  */
+#endif
   exit (0);
 }


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