From 4c90724737ae14a9d11e6713ea50ad7409cdc8fe Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Fri, 29 Aug 2014 19:16:29 -0400 Subject: [PATCH] target-supports.exp (check_effective_target_size32plus): Increase size to avoid false positives on 24-bit address spaces. * lib/target-supports.exp (check_effective_target_size32plus): Increase size to avoid false positives on 24-bit address spaces. * gcc.c-torture/compile/limits-stringlit.c: Skip if msp430. * gcc.dg/lto/pr54709_1.c: Fix memcpy prototype. * gcc.dg/torture/pta-ptrarith-3.c: Use __SIZE_TYPE__ instead of "int". * gcc.dg/torture/pr36373-10.c: Use __SIZE_TYPE__ if present. * gcc.dg/torture/pr57864.c: Use __SIZE_TYPE__. * gcc.dg/torture/pr26763-2.c: Use __SIZE_TYPE__ instead of "int". * gcc.dg/tree-ssa/isolate-3.c: Use __SIZE_TYPE__ instead of "long unsigned int". * gcc.dg/pr52549.c: Use __SIZE_TYPE__ if present. From-SVN: r214746 --- gcc/testsuite/ChangeLog | 13 +++++++++++++ .../gcc.c-torture/compile/limits-stringlit.c | 2 +- gcc/testsuite/gcc.dg/lto/pr54709_1.c | 2 +- gcc/testsuite/gcc.dg/pr52549.c | 7 ++++++- gcc/testsuite/gcc.dg/torture/pr26763-2.c | 2 +- gcc/testsuite/gcc.dg/torture/pr36373-10.c | 4 +++- gcc/testsuite/gcc.dg/torture/pr57864.c | 4 ++-- gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c | 2 +- gcc/testsuite/lib/target-supports.exp | 5 +++-- 10 files changed, 32 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 564b821f7c5..b2f1bb2fcdd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2014-08-29 DJ Delorie + + * lib/target-supports.exp (check_effective_target_size32plus): + Increase size to avoid false positives on 24-bit address spaces. + * gcc.c-torture/compile/limits-stringlit.c: Skip if msp430. + * gcc.dg/lto/pr54709_1.c: Fix memcpy prototype. + * gcc.dg/torture/pta-ptrarith-3.c: Use __SIZE_TYPE__ instead of "int". + * gcc.dg/torture/pr36373-10.c: Use __SIZE_TYPE__ if present. + * gcc.dg/torture/pr57864.c: Use __SIZE_TYPE__. + * gcc.dg/torture/pr26763-2.c: Use __SIZE_TYPE__ instead of "int". + * gcc.dg/tree-ssa/isolate-3.c: Use __SIZE_TYPE__ instead of "long unsigned int". + * gcc.dg/pr52549.c: Use __SIZE_TYPE__ if present. + 2014-08-29 Paolo Carlini PR c++/54002 diff --git a/gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c b/gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c index 41fa2f14022..4ad761235e1 100644 --- a/gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c +++ b/gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c @@ -1,4 +1,4 @@ -/* { dg-skip-if "Array too big" { avr-*-* picochip-*-* m32c-*-* pdp11-*-* } { "*" } { "" } } */ +/* { dg-skip-if "Array too big" { avr-*-* picochip-*-* m32c-*-* pdp11-*-* msp430-*-* } { "*" } { "" } } */ #define STR2 "012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789" diff --git a/gcc/testsuite/gcc.dg/lto/pr54709_1.c b/gcc/testsuite/gcc.dg/lto/pr54709_1.c index 59c137d6f9e..59f3dbf8a55 100644 --- a/gcc/testsuite/gcc.dg/lto/pr54709_1.c +++ b/gcc/testsuite/gcc.dg/lto/pr54709_1.c @@ -1,4 +1,4 @@ -void * memcpy (void *, void *, long); +void * memcpy (void *, void *, __SIZE_TYPE__); void bar (void *p, void *q, unsigned s) { memcpy (p, q, s); diff --git a/gcc/testsuite/gcc.dg/pr52549.c b/gcc/testsuite/gcc.dg/pr52549.c index 90936529d8d..4d0a3e00a5a 100644 --- a/gcc/testsuite/gcc.dg/pr52549.c +++ b/gcc/testsuite/gcc.dg/pr52549.c @@ -1,6 +1,11 @@ /* { dg-do compile } */ -#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ +#ifdef __SIZE_TYPE__ +_mark (__SIZE_TYPE__ obj, int i, char *a) +{ + (char *)&(((long *)(obj)) [i]) - a; +} +#elif __SIZEOF_POINTER__ == __SIZEOF_LONG__ _mark (long obj, int i, char *a) { (char *)&(((long *)(obj)) [i]) - a; diff --git a/gcc/testsuite/gcc.dg/torture/pr26763-2.c b/gcc/testsuite/gcc.dg/torture/pr26763-2.c index d8155fb0831..7e9dc39bc18 100644 --- a/gcc/testsuite/gcc.dg/torture/pr26763-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr26763-2.c @@ -2,7 +2,7 @@ extern void abort(void); -int try (char *a, int d) +int try (char *a, __SIZE_TYPE__ d) { return a + d > a; } diff --git a/gcc/testsuite/gcc.dg/torture/pr36373-10.c b/gcc/testsuite/gcc.dg/torture/pr36373-10.c index ed701772828..d18b4e8432e 100644 --- a/gcc/testsuite/gcc.dg/torture/pr36373-10.c +++ b/gcc/testsuite/gcc.dg/torture/pr36373-10.c @@ -1,6 +1,8 @@ /* { dg-do run } */ -#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__) +#ifdef __SIZE_TYPE__ +typedef __SIZE_TYPE__ uintptr_t; +#elif (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__) typedef unsigned long long uintptr_t; #elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__) typedef unsigned long uintptr_t; diff --git a/gcc/testsuite/gcc.dg/torture/pr57864.c b/gcc/testsuite/gcc.dg/torture/pr57864.c index 93962c20e3f..fda1844fc37 100644 --- a/gcc/testsuite/gcc.dg/torture/pr57864.c +++ b/gcc/testsuite/gcc.dg/torture/pr57864.c @@ -15,12 +15,12 @@ static void fn1(union U *p1, int p2, _Bool p3) union U *e; if (p2 == 0) - a = ((union U*)((unsigned long)p1 & ~1))->val; + a = ((union U*)((__SIZE_TYPE__)p1 & ~1))->val; if (b) { e = p1; } else if (c) { - e = ((union U*)((unsigned long)p1 & ~1))->ptr; + e = ((union U*)((__SIZE_TYPE__)p1 & ~1))->ptr; d = e; } else { e = 0; diff --git a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c index 938fb296b40..4b18e1aa3ac 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c +++ b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c @@ -9,7 +9,7 @@ struct X { int *r; }; int __attribute__((noinline)) -foo(int i, int j, int k, int off) +foo(int i, int j, int k, __SIZE_TYPE__ off) { struct X x; int **p, *q; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c b/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c index 9c2c5d55c27..1a10e334a45 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c @@ -3,7 +3,7 @@ /* { dg-skip-if "" keeps_null_pointer_checks } */ -typedef long unsigned int size_t; +typedef __SIZE_TYPE__ size_t; extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1))); struct rtx_def; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f96d78281b4..92c30926897 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1809,11 +1809,12 @@ proc check_effective_target_ptr32plus { } { } # Return 1 if we support 32-bit or larger array and structure sizes -# using default options, 0 otherwise. +# using default options, 0 otherwise. Avoid false positive on +# targets with 20 or 24 bit address spaces. proc check_effective_target_size32plus { } { return [check_no_compiler_messages size32plus object { - char dummy[65537]; + char dummy[16777217L]; }] } -- 2.30.2