public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit targets
@ 2007-05-28  9:54 Rask Ingemann Lambertsen
  2007-05-28 12:49 ` Rask Ingemann Lambertsen
  0 siblings, 1 reply; 5+ messages in thread
From: Rask Ingemann Lambertsen @ 2007-05-28  9:54 UTC (permalink / raw)
  To: gcc-patches

   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?

2007-05-27  Rask Ingemann Lambertsen  <rask@sygehus.dk>

	* gcc.c-torture/unsorted/dump-noaddr.c: Reduce string length to make
	  the test pass on 16-bit targets.

Index: gcc.c-torture/unsorted/dump-noaddr.c
===================================================================
--- gcc.c-torture/unsorted/dump-noaddr.c	(revision 125037)
+++ gcc.c-torture/unsorted/dump-noaddr.c	(working copy)
@@ -1,9 +1,10 @@
 #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
-#define M (sizeof (t16(t16(t16(t16(t16(" ")))))) - 1)
+#define M (sizeof (t11(t11(t16(t16(" "))))) - 1)
 #endif
 #if MASK & 2
-#define M 1048576
+#define M 30976
 #endif
 
 typedef struct s {

-- 
Rask Ingemann Lambertsen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit  targets
  2007-05-28  9:54 RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit targets Rask Ingemann Lambertsen
@ 2007-05-28 12:49 ` Rask Ingemann Lambertsen
  2007-05-29 17:41   ` Janis Johnson
  0 siblings, 1 reply; 5+ messages in thread
From: Rask Ingemann Lambertsen @ 2007-05-28 12:49 UTC (permalink / raw)
  To: gcc-patches

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.

-- 
Rask Ingemann Lambertsen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit targets
  2007-05-28 12:49 ` Rask Ingemann Lambertsen
@ 2007-05-29 17:41   ` Janis Johnson
  2007-07-21 10:08     ` Rask Ingemann Lambertsen
  0 siblings, 1 reply; 5+ messages in thread
From: Janis Johnson @ 2007-05-29 17:41 UTC (permalink / raw)
  To: Rask Ingemann Lambertsen; +Cc: gcc-patches

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit  targets
  2007-05-29 17:41   ` Janis Johnson
@ 2007-07-21 10:08     ` Rask Ingemann Lambertsen
  2007-07-24 22:44       ` Janis Johnson
  0 siblings, 1 reply; 5+ messages in thread
From: Rask Ingemann Lambertsen @ 2007-07-21 10:08 UTC (permalink / raw)
  To: Janis Johnson; +Cc: gcc-patches

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.

-- 
Rask Ingemann Lambertsen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit  targets
  2007-07-21 10:08     ` Rask Ingemann Lambertsen
@ 2007-07-24 22:44       ` Janis Johnson
  0 siblings, 0 replies; 5+ messages in thread
From: Janis Johnson @ 2007-07-24 22:44 UTC (permalink / raw)
  To: Rask Ingemann Lambertsen; +Cc: gcc-patches

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-24 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-28  9:54 RFA: Fixing gcc.c-torture/unsorted/dump-noaddr.c for 16-bit targets Rask Ingemann Lambertsen
2007-05-28 12:49 ` Rask Ingemann Lambertsen
2007-05-29 17:41   ` Janis Johnson
2007-07-21 10:08     ` Rask Ingemann Lambertsen
2007-07-24 22:44       ` Janis Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).