Message ID | 874n924ce2.fsf@redhat.com |
---|---|
State | New |
Headers | show |
On Sep 30, 2013, at 7:23 AM, Nick Clifton <nickc@redhat.com> wrote: > Several tests in the gcc.c-torture/compile directory need a target > with 32-bit integers and/or 32-bit pointers. > OK to apply ? Ok. It may be reasonable to special case ptr32plus to say no on your platform, from check_effective_target_tls_native, we see code like: proc check_effective_target_tls_native {} { # VxWorks uses emulated TLS machinery, but with non-standard helper # functions, so we fail to automatically detect it. if { [istarget *-*-vxworks*] } { return 0 } return [check_no_messages_and_pattern tls_native "!emutls" assembly { __thread int i; int f (void) { return i; } void g (int j) { i = j; } }] } so, instead of: proc check_effective_target_ptr32plus { } { return [check_no_compiler_messages ptr32plus object { int dummy[sizeof (void *) >= 4 ? 1 : -1]; }] } you could do something like: proc check_effective_target_ptr32plus { } { # msp430 never really has 32 or more bits in a pointer. if { [istarget msp430-*-*] } { return 0 } return [check_no_compiler_messages ptr32plus object { int dummy[sizeof (void *) >= 4 ? 1 : -1]; }] } Then, you don't have to worry about people adding tests with this predicate and those test cases failing. I don't have a good handle on wether this is better or not, so, I'll let you decide what you think is best.
On 09/30/13 13:42, Mike Stump wrote: > On Sep 30, 2013, at 7:23 AM, Nick Clifton <nickc@redhat.com> wrote: >> Several tests in the gcc.c-torture/compile directory need a target >> with 32-bit integers and/or 32-bit pointers. > >> OK to apply ? > > Ok. > > It may be reasonable to special case ptr32plus to say no on your platform, from check_effective_target_tls_native, we see code like: I'd tend to prefer this as well. It's really a failing that ptr32plus can't reasonably detect that when a target uses PSImode for pointers. Special casing the msp port in that code seems reasonable to me. jeff
Hi Mike, > It may be reasonable to special case ptr32plus to say no on your platform, from check_effective_target_tls_native, we see code like: > you could do something like: > > proc check_effective_target_ptr32plus { } { > # msp430 never really has 32 or more bits in a pointer. > if { [istarget msp430-*-*] } { > return 0 > } > return [check_no_compiler_messages ptr32plus object { > int dummy[sizeof (void *) >= 4 ? 1 : -1]; > }] > } > > Then, you don't have to worry about people adding tests with this predicate and those test cases failing. I don't have a good handle on wether this is better or not, so, I'll let you decide what you think is best. Thanks - that is a good idea. (I am embarrassed that I did not think of it myself). I have checked the patch in with this change added. Cheers Nick
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;