[PATCH] for gcc/testsuite/gcc.dg/20020411-1.c

D.Venkatasubramanian, Noida dvenkat@noida.hcltech.com
Thu Oct 3 06:26:00 GMT 2002


Hi,

I found the test case gcc/testsuite/gcc.dg/20020411-1.c producing
compilation
warnings when I compiled it with an h8300-elf cross-compiler built on an
ix86
host. On investigation, I found an unsigned int variable being right shifted

by 16, and as the sizeof h8300-elf for -mh target is 16 bits, a warning is 
flashed. Hence, make check reports a failure. By this patch, I preclude 
targets which have INT_MAX <= 32767 or sizeof unsigned int in bits <=16.

Thanks and regards,

Venky

Entry for Change Log

Thu Oct  3 18:53:06 IST 2002  D.Venkatasubramanian
<dvenkat@noida.hcltech.com>

        * gcc.dg/20020411-1.c : If the sizeof(unsigned int) is less than
          or equal to 16 bits, then the test case displays a warning on
          compilation, as a variable of type unsigned int is right shifted
          by 16.


*** gcc/testsuite/gcc.dg/20020411-1.c.new        Fri Apr 12 02:21:38 2002
--- gcc/testsuite/gcc.dg/20020411-1.c.modified   Thu Oct  3 18:31:15 2002
***************
*** 5,10 ****
--- 5,11 ----
  /* { dg-options "-O2" } */
  /* { dg-options "-O2 -march=i686" { target i?86-*-* } } */

+ #include <limits.h>
  typedef struct
  {
    unsigned a : 16;
*************** typedef struct
*** 19,24 ****
--- 20,26 ----
    unsigned j : 1;
  } T;

+ #if (INT_MAX > 32767)
  inline void
  foo (T *x, unsigned int y)
  {
*************** baz (unsigned int x, unsigned char y)
*** 48,50 ****
--- 50,53 ----
      foo (&t, 1);
    bar (&t);
  }
+ #endif



More information about the Gcc-patches mailing list