Hi Guys,

  Several tests in the gcc.c-torture/compile directory need a target
  with 32-bit integers and/or 32-bit pointers.  The patch below adds
  "dg-require-effective-target in32plus" to these tests.  This fixes
  ~200 unexpected failures for the MSP430, RL78 and XSTORMY16 targets.

  Note - I have used "dg-require-effective-target int32plus" in
  preference to "dg-require-effective-target ptr32plus" even if it 
  would appear that a pointer size test would be more appropriate.  This
  is because the check_effective_target_ptr32_plus test is broken for
  targets that use PSImode (eg the MSP430 in large mode).  On the MSP430
  for example a PSImode pointer is 20-bits long, but when it is stored
  in memory it occupies 32-bits.  So "sizeof(void *)" returns 4 but
  really a pointer cannot hold an entire 32-bit address.

  Tested with no regressions on msp430-elf, rl78-elf and xstormy16-elf
  targets.

  OK to apply ?

Cheers
  Nick

gcc/testsuite/ChangeLog
2013-09-30  Nick Clifton  <ni...@redhat.com>

        * gcc.c-torture/compile/20010327-1.c: Only run the test for
        int32plus targets.
        * gcc.c-torture/compile/990617-1.c: Likewise.
        * gcc.c-torture/compile/calls.c: Likewise.
        * gcc.c-torture/compile/limits-externdecl.c: Likewise.
        * gcc.c-torture/compile/pr41181.c: Likewise.
        * gcc.c-torture/compile/pr55955.c: Likewise.

Index: gcc/testsuite/gcc.c-torture/compile/20010327-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20010327-1.c    (revision 203032)
+++ gcc/testsuite/gcc.c-torture/compile/20010327-1.c    (working copy)
@@ -1,7 +1,4 @@
-/* { dg-skip-if "non-SI pointers" { m32c-*-* } { "*" } { "" } } */
-/* { dg-skip-if "HI mode pointer for avr" { "avr-*-*" } { "*" } { "" } } */ 
-/* { dg-skip-if "HI mode pointer for pdp11" { "pdp11-*-*" } { "*" } { "" } } 
*/ 
-/* { dg-skip-if "non-SI pointers for w64" { "x86_64-*-mingw*" } { "*" } { "" } 
} */ 
+/* { dg-require-effective-target int32plus } */
 
 /* This testcase tests whether GCC can produce static initialized data
    that references addresses of size 'unsigned long', even if that's not
Index: gcc/testsuite/gcc.c-torture/compile/20020604-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20020604-1.c    (revision 203032)
+++ gcc/testsuite/gcc.c-torture/compile/20020604-1.c    (working copy)
@@ -1,7 +1,6 @@
 /* { dg-do assemble } */
-/* { dg-skip-if "The array is too big" { "avr-*-*" "pdp11-*-*" } { "*" } { "" 
} } */ 
+/* { dg-require-effective-target ptr32plus } */
 /* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } 
} */
-/* { dg-skip-if "" { m32c-*-* } { } { } } */
 
 /* PR c/6957
    This testcase ICEd at -O2 on IA-32, because
Index: gcc/testsuite/gcc.c-torture/compile/20080625-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20080625-1.c    (revision 203032)
+++ gcc/testsuite/gcc.c-torture/compile/20080625-1.c    (working copy)
@@ -1,4 +1,5 @@
-/* { dg-skip-if "too much data" { "avr-*-*" "m32c-*-*" "pdp11-*-*" } { "*" } { 
"" } } */
+/* { dg-require-effective-target int32plus } */
+
 struct peakbufStruct {
     unsigned int lnum [5000];
     int lscan [5000][4000];
Index: gcc/testsuite/gcc.c-torture/compile/990617-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/990617-1.c      (revision 203032)
+++ gcc/testsuite/gcc.c-torture/compile/990617-1.c      (working copy)
@@ -1,7 +1,5 @@
-/* 0x70000000 is too large a constant to become a pointer on
-   xstormy16. */
 /* { dg-do assemble } */
-/* { dg-xfail-if "" { xstormy16-*-* } { "*" } { "" } } */
+/* { dg-require-effective-target int32plus } */
 
 int main()
 {
Index: gcc/testsuite/gcc.c-torture/compile/calls.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/calls.c (revision 203032)
+++ gcc/testsuite/gcc.c-torture/compile/calls.c (working copy)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 typedef void  *(*T)(void);
 f1 ()
 {
Index: gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c     (revision 
203032)
+++ gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c     (working copy)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 /* Inspired by the test case for PR middle-end/52640.  */
 
 typedef struct
@@ -52,4 +53,4 @@
 REFERENCE references[] = {
   LIM5 (X)
   0
-}; /* { dg-error "size of array is too large" "" { target avr-*-* } } */
+};
Index: gcc/testsuite/gcc.c-torture/compile/pr41181.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr41181.c       (revision 203032)
+++ gcc/testsuite/gcc.c-torture/compile/pr41181.c       (working copy)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 /* { dg-skip-if "The array is too big" { "avr-*-*" "pdp11-*-*" } { "*" } { "" 
} } */ 
 char paths[1024];
 static void x264_slicetype_path(char (*best_paths)[250], int n, int length)
Index: gcc/testsuite/gcc.c-torture/compile/pr55955.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr55955.c       (revision 203032)
+++ gcc/testsuite/gcc.c-torture/compile/pr55955.c       (working copy)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 /* PR tree-optimization/55955 */
 
 int b;
        

Reply via email to