diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-05-19 12:46:17 +0100 |
---|---|---|
committer | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-05-19 13:15:13 +0100 |
commit | 92ea8e1bccc6a703407570471f6323bfa554af99 (patch) | |
tree | e17b2e12afa712a1295057b7f6303dafeff04712 /gcc/testsuite/gcc.dg | |
parent | e107157171af25f6c89be02d62b0a7235a5c988d (diff) | |
download | gcc-92ea8e1bccc6a703407570471f6323bfa554af99.zip gcc-92ea8e1bccc6a703407570471f6323bfa554af99.tar.gz gcc-92ea8e1bccc6a703407570471f6323bfa554af99.tar.bz2 |
TESTSUITE: Fix tests for 16-bit targets
gcc/ChangeLog:
2020-05-19 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* doc/sourcebuild.texi: Document new short_eq_int, ptr_eq_short,
msp430_small, msp430_large and size24plus DejaGNU effective
targets.
Improve grammar in descriptions for size20plus and size32plus effective
targets.
gcc/testsuite/ChangeLog:
2020-05-19 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* c-c++-common/builtin-has-attribute-7.c: Require size24plus.
* c-c++-common/cpp/pr63831-1.c: Store result in _has_cpp_attribute in a
long.
* c-c++-common/pr81376.c: Skip scan-tree-dump for short_eq_int. Extend
test for short_eq_int.
* g++.dg/abi/scoped1.C: Skip dg-warning tests for short_eq_int.
* g++.dg/cpp0x/constexpr-70001-1.C: Require size24plus.
* g++.dg/cpp0x/constexpr-bitfield3.C: Require int32plus.
* g++.dg/cpp0x/enum13.C: Skip dg-warning for short_eq_int.
* g++.dg/cpp0x/initlist5.C: Add dg-error for short_eq_int.
* g++.dg/cpp0x/initlist7.C: Add dg-warning for !int32plus.
* g++.dg/cpp0x/nullptr04.C: Skip dg-error for ptr_eq_short.
* g++.dg/cpp0x/variadic-value1.C: Add typedef for int32_t.
* g++.dg/cpp1y/constexpr-arith-overflow.C: Fix test for
sizeof(int) == sizeof(short).
* g++.dg/cpp1y/digit-sep-neg.C: Add typedef for int32_t.
* g++.dg/cpp1y/pr57644.C: Add typedef for uint32_t.
* g++.dg/cpp1y/pr77321.C: Require size24plus.
* g++.dg/cpp1y/var-templ4.C: Add typedef for int32_t.
* g++.dg/cpp1z/direct-enum-init1.C: Skip dg-error for short_eq_int.
* g++.dg/delayedfold/fwrapv1.C: Skip for int16.
* g++.dg/expr/bitfield9.C: Add typedef for int32_t.
* g++.dg/ext/attribute-test-1.C: Add typedef for uint32_t.
* g++.dg/ext/bitfield1.C: Add typedef for int32_t.
* g++.dg/ext/flexary13.C: Add typedef for int32_t.
* g++.dg/ext/utf-cvt.C: Adjust dg-warning for int16.
* g++.dg/ext/vector28.C: Add typedef for int32_t.
* g++.dg/ext/vla15.C: Add typedef for int32_t.
* g++.dg/init/array11.C: Require size32plus.
* g++.dg/init/array15.C: Require size24plus.
* g++.dg/init/array4.C: Require size20plus.
* g++.dg/init/const7.C: Skip dg-message for ptr_eq_short.
* g++.dg/init/new38.C: Relax regex in dg-error.
* g++.dg/init/new44.C: Skip dg-error for msp430_small.
Adjust test for 16-bit size_t.
Add special case for msp430 -mlarge.
* g++.dg/init/value9.C: Add typedef for int32_t.
* g++.dg/ipa/pr77333.C: Add typedef for int32_t.
* g++.dg/lto/20080908-1_0.C: Add typedef for int32_t.
* g++.dg/opt/pr55717.C: Add typedef for uint32_t.
* g++.dg/opt/pr60597.C: Add typedef for int32_t.
* g++.dg/opt/pr81715.C: Require size20plus.
* g++.dg/opt/reload3.C: Add typedef for uint32_t.
* g++.dg/opt/temp2.C: Require size20plus.
* g++.dg/opt/thunk1.C: Likewise.
* g++.dg/other/error23.C: Dont assume __SIZEOF_INT__ == 4.
* g++.dg/other/pr31078.C: Adjust typedef for 32-bit int.
* g++.dg/parse/concat1.C: Skip dg-error for size20plus.
* g++.dg/parse/defarg5.C: Add typedef for int32_t and uint32_t.
* g++.dg/pr48484.C: Add typedef for int32_t.
* g++.dg/pr53037-2.C: Likewise.
* g++.dg/pr53037-3.C: Likewise.
* g++.dg/pr66655.C: Use int32_t.
* g++.dg/pr66655.h: Add typedef for int32_t.
* g++.dg/pr66655_1.cc: Use int32_t.
* g++.dg/pr67351.C: Define 32-bit uint.
* g++.dg/template/array30.C: Add typedef for int32_t.
* g++.dg/template/constant1.C: Extend test for 8-bit and 16-bit int.
* g++.dg/template/constant2.C: Likewise.
* g++.dg/template/friend18.C: Add typedef for int32_t.
* g++.dg/template/pr68978.C: Likewise.
* g++.dg/torture/pr37421.C: Require int_eq_float.
* g++.dg/torture/pr88861.C: Handle 16-bit int.
* g++.dg/tree-ssa/pr19807.C: Likewise.
* g++.dg/tree-ssa/pr27291.C: Fix typedef for uint32_t.
* g++.dg/tree-ssa/pr49516.C: Fix typedefs for int{16,32}_t and
uint{32,64}_t.
* g++.dg/warn/Wconversion-integer.C: Add typedefs for {u,}int32_t.
* g++.dg/warn/Wconversion-null-2.C: Adjust g() declaration.
* g++.dg/warn/Wconversion-null.C: Likewise.
* g++.dg/warn/Wconversion3.C: Skip dg-warning for short_eq_int.
* g++.dg/warn/Wduplicated-branches1.C: Add dg-warning for short_eq_int.
* g++.dg/warn/Wplacement-new-size-5.C: Add typedef for int32_t.
* g++.dg/warn/Wplacement-new-size.C: Likewise.
* g++.dg/warn/Wstrict-aliasing-5.C: Add typedef for uint32_t.
* g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C: Add typedef for
{u,}int32_t.
* g++.dg/warn/Wtype-limits-Wextra.C: Adjust dg-warning for
short_eq_int.
* g++.dg/warn/Wtype-limits.C: Likewise.
* g++.old-deja/g++.brendan/enum11.C: Add typedef for uint32_t.
* g++.old-deja/g++.bugs/900227_01.C: Skip dg-error for ptr_eq_short.
* g++.old-deja/g++.mike/ns15.C: Require size20plus.
* g++.old-deja/g++.other/exprstmt1.C: Add typedef for uint32_t.
* g++.old-deja/g++.other/inline12.C: Adjust udword typedef.
* g++.old-deja/g++.other/new6.C: Add typedef for int32_t.
* g++.old-deja/g++.pt/crash16.C: Skip for int16.
* g++.old-deja/g++.robertl/eb76.C: Likewise.
* g++.old-deja/g++.warn/flow1.C: Add typedef for int32_t.
* gcc.dg/Walloca-14.c: Adjust -Walloca-larger-than= parameter for
!ptr32plus.
* gcc.dg/Warray-bounds-32.c: Adjust dg-warning for size20plus.
* gcc.dg/Wbuiltin-declaration-mismatch-4.c: Adjust dg-warning for
short_eq_int.
Handle case where ptrdiff_t/size_t is __int20.
* gcc.dg/concat2.c: Skip dg-error for size20plus.
* gcc.dg/fold-convmaxconv-1.c: Add typedef for {u,}int32_t.
* gcc.dg/fold-convminconv-1.c: Likewise.
* gcc.dg/graphite/scop-4.c: Require size20plus.
* gcc.dg/loop-versioning-1.c: Adjust test for small size_t.
* gcc.dg/loop-versioning-2.c: Require size20plus.
* gcc.dg/lto/20081210-1_0.c: Adjust typedef for uintptr_t.
* gcc.dg/lto/pr85870_0.c: Add typedef for uint32_t.
* gcc.dg/lto/pr85870_1.c: Likewise.
* gcc.dg/pr36227.c: Adjust typedef for ptrcast.
* gcc.dg/pr42611.c: First check for size_t equality with void *
before trying other types.
* gcc.dg/pr59963-2.c: Skip dg-warning for int16 instead of
xfail.
* gcc.dg/pr68317.c: Add typedef for int32_t.
* gcc.dg/pr78973.c: Adjust dg-warning for int16.
* gcc.dg/pr85859.c: Cast using __INTPTR_TYPE__ instead of long.
* gcc.dg/pr86179.c: Add typedef for {u,}int32_t.
* gcc.dg/torture/20181024-1.c: Require size32plus.
* gcc.dg/torture/pr71598-2.c: Skip for short_eq_int.
* gcc.dg/torture/pr86034.c: Add typedef for int32_t.
* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Adjust dg-warning
for int16 and msp430 -mlarge.
* gcc.dg/tree-ssa/integer-addr.c: Use __INTPTR_MAX__ for a large
constant that is a valid address.
* gcc.dg/tree-ssa/loop-interchange-10.c: Add typedef for
int32_t.
* gcc.dg/tree-ssa/pr84436-3.c: Adjust dg-final for int16.
* gcc.dg/tree-ssa/pr84648.c: Add typedef for uint32_t.
* gcc.dg/tree-ssa/scev-8.c: Cast to char if sizeof(int) ==
sizeof(short).
* gcc.dg/tree-ssa/ssa-dom-thread-8.c: Adjust test for msp430 -mlarge.
* lib/target-supports.exp (check_effective_target_size24plus): New.
(check_effective_target_short_eq_int): New.
(check_effective_target_ptr_eq_short): New.
(check_effective_target_msp430_small): New.
(check_effective_target_msp430_large): New.
Diffstat (limited to 'gcc/testsuite/gcc.dg')
29 files changed, 107 insertions, 84 deletions
diff --git a/gcc/testsuite/gcc.dg/Walloca-14.c b/gcc/testsuite/gcc.dg/Walloca-14.c index 657402f..51362b2d 100644 --- a/gcc/testsuite/gcc.dg/Walloca-14.c +++ b/gcc/testsuite/gcc.dg/Walloca-14.c @@ -2,7 +2,8 @@ /* { dg-do compile } */ /* { dg-require-effective-target alloca } */ /* { dg-skip-if "small address space" { "pdp11-*-*" } } */ -/* { dg-options "-O2 -Walloca-larger-than=126812070" } */ +/* { dg-options "-O2 -Walloca-larger-than=126812070" { target ptr32plus } } */ +/* { dg-options "-O2 -Walloca-larger-than=12070" { target { ! ptr32plus } } } */ void g (int *p) diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-32.c b/gcc/testsuite/gcc.dg/Warray-bounds-32.c index 54b09bc9..9b5f333 100644 --- a/gcc/testsuite/gcc.dg/Warray-bounds-32.c +++ b/gcc/testsuite/gcc.dg/Warray-bounds-32.c @@ -150,8 +150,8 @@ void wide_ptr_index_range_chain (void) T (p3[0]); /* { dg-warning "array subscript \\\[3, 6] is outside array bounds of .\[a-z \]+\\\[3]." } */ T (p3[1]); /* { dg-warning "array subscript \\\[4, 7] is outside array bounds of .\[a-z \]+\\\[3]." } */ - T (p3[9999]); /* { dg-warning "array subscript \\\[10002, 10005] is outside array bounds of .\[a-z \]+\\\[3]." } */ - + T (p3[9999]); /* { dg-warning "array subscript \\\[10002, 10005] is outside array bounds of .\[a-z \]+\\\[3]." "" { target size20plus} } */ + /* { dg-warning "array subscript \\\[-6382, -6379] is outside array bounds of .\[a-z \]+\\\[3]." "" { target { ! size20plus } } .-1 } */ /* Large offsets are indistinguishable from negative values. */ T (p3[DIFF_MAX]); /* { dg-warning "array subscript" "bug" { xfail *-*-* } } */ } diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c index 856166c..e845b43 100644 --- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c +++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c @@ -41,7 +41,7 @@ void test_integer_conversion_abs (void) i = abs (uc); i = abs (si); - i = abs (usi); + i = abs (usi); /* { dg-warning ".abs. argument 1 promotes to .unsigned int. where .int. is expected in a call to built-in function declared without prototype" "" { target short_eq_int } } */ i = abs (i); i = abs (ui); /* { dg-warning ".abs. argument 1 type is .unsigned int. where .int. is expected in a call to built-in function declared without prototype" } */ @@ -77,9 +77,9 @@ void test_integer_conversion_memset (void *d) /* Passing a ptrdiff_t where size_t is expected may not be unsafe but because GCC may emits suboptimal code for such calls warning for them helps improve efficiency. */ - memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)?int.} where .\(long \)?unsigned int. is expected" } */ + memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)?\(int\)?\(__int20\)?.} where .\(long \)?\(__int20 \)?unsigned\( int\)?. is expected" } */ - memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)?unsigned int' is expected" } */ + memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)?\(__int20 \)?unsigned\( int\)?' is expected" } */ /* Verify that the same call as above but to the built-in doesn't trigger a warning. */ diff --git a/gcc/testsuite/gcc.dg/concat2.c b/gcc/testsuite/gcc.dg/concat2.c index e9fa216..62f45d4 100644 --- a/gcc/testsuite/gcc.dg/concat2.c +++ b/gcc/testsuite/gcc.dg/concat2.c @@ -11,4 +11,4 @@ #define e4 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 #define e5 e4 e4 e4 e4 e4 e4 e4 e4 e4 e4 -void foo() { (void)(e5); } /* { dg-error "size of string literal is too large" "" { target { ! size32plus } } } */ +void foo() { (void)(e5); } /* { dg-error "size of string literal is too large" "" { target { ! size20plus } } } */ diff --git a/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c b/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c index 3ffff8b..f8157e9 100644 --- a/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c +++ b/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c @@ -1,9 +1,12 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-optimized" } */ -int foo (short a[], int x) +typedef int int32_t __attribute__((mode (__SI__))); +typedef unsigned uint32_t __attribute__((mode (__SI__))); + +int32_t foo (short a[], int32_t x) { - unsigned int i; + uint32_t i; for (i = 0; i < 1000; i++) { x = a[i]; diff --git a/gcc/testsuite/gcc.dg/fold-convminconv-1.c b/gcc/testsuite/gcc.dg/fold-convminconv-1.c index f4a048e..7070ecf 100644 --- a/gcc/testsuite/gcc.dg/fold-convminconv-1.c +++ b/gcc/testsuite/gcc.dg/fold-convminconv-1.c @@ -1,9 +1,12 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-optimized" } */ -int foo (unsigned short a[], unsigned int x) +typedef int int32_t __attribute__((mode (__SI__))); +typedef unsigned uint32_t __attribute__((mode (__SI__))); + +int32_t foo (unsigned short a[], uint32_t x) { - unsigned int i; + uint32_t i; for (i = 0; i < 1000; i++) { x = a[i]; diff --git a/gcc/testsuite/gcc.dg/graphite/scop-4.c b/gcc/testsuite/gcc.dg/graphite/scop-4.c index eeaa7fa..a691eea 100644 --- a/gcc/testsuite/gcc.dg/graphite/scop-4.c +++ b/gcc/testsuite/gcc.dg/graphite/scop-4.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target size20plus } */ + void bar (); int toto() diff --git a/gcc/testsuite/gcc.dg/loop-versioning-1.c b/gcc/testsuite/gcc.dg/loop-versioning-1.c index 17e95fd..2f2c1ee 100644 --- a/gcc/testsuite/gcc.dg/loop-versioning-1.c +++ b/gcc/testsuite/gcc.dg/loop-versioning-1.c @@ -45,7 +45,11 @@ f6 (double *x, int stepx, unsigned int limit) *y = 100; } +#if __SIZEOF_SIZE_T__ < 4 +double x[1000]; +#else double x[10000]; +#endif void g1 (int stepx, int n) diff --git a/gcc/testsuite/gcc.dg/loop-versioning-2.c b/gcc/testsuite/gcc.dg/loop-versioning-2.c index 3d07f83..d9a1a99 100644 --- a/gcc/testsuite/gcc.dg/loop-versioning-2.c +++ b/gcc/testsuite/gcc.dg/loop-versioning-2.c @@ -1,5 +1,5 @@ /* { dg-options "-O3 -fdump-tree-lversion-details" } */ -/* { dg-require-effective-target size32plus } */ +/* { dg-require-effective-target size20plus } */ /* Versioning for step == 1 in these loops would allow loop interchange, but otherwise isn't worthwhile. At the moment we decide not to version. */ diff --git a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c index 80a1e9a..8048b26 100644 --- a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c @@ -1,10 +1,4 @@ -#if defined(_LP64) -typedef unsigned long int uintptr_t; -#elif defined (_WIN64) -typedef unsigned long long int uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif +typedef __UINTPTR_TYPE__ uintptr_t; extern void srand (uintptr_t); diff --git a/gcc/testsuite/gcc.dg/lto/pr85870_0.c b/gcc/testsuite/gcc.dg/lto/pr85870_0.c index b57ac7c..b1b71c6 100644 --- a/gcc/testsuite/gcc.dg/lto/pr85870_0.c +++ b/gcc/testsuite/gcc.dg/lto/pr85870_0.c @@ -3,16 +3,18 @@ /* { dg-lto-options { { -flto -O2 } } } */ /* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */ +typedef unsigned uint32_t __attribute__((mode (__SI__))); + typedef struct abc_s { char a1; short a2; - unsigned int a3; - unsigned int a4; + uint32_t a3; + uint32_t a4; } abc; typedef struct xyz_s { - unsigned x1; - unsigned x2; + uint32_t x1; + uint32_t x2; abc *x3; } xyz; diff --git a/gcc/testsuite/gcc.dg/lto/pr85870_1.c b/gcc/testsuite/gcc.dg/lto/pr85870_1.c index cd1cd31..c035bbb 100644 --- a/gcc/testsuite/gcc.dg/lto/pr85870_1.c +++ b/gcc/testsuite/gcc.dg/lto/pr85870_1.c @@ -1,14 +1,16 @@ +typedef unsigned uint32_t __attribute__((mode (__SI__))); + typedef struct abc_s { char a1; short a2; - unsigned int a3; - unsigned int a4; + uint32_t a3; + uint32_t a4; } abc; typedef struct xyz_s { - unsigned int x1; - unsigned int x2; + uint32_t x1; + uint32_t x2; abc *x3; } xyz; diff --git a/gcc/testsuite/gcc.dg/pr36227.c b/gcc/testsuite/gcc.dg/pr36227.c index 27fe001..ba0d722 100644 --- a/gcc/testsuite/gcc.dg/pr36227.c +++ b/gcc/testsuite/gcc.dg/pr36227.c @@ -1,14 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-overflow=3" } */ -#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__) -typedef unsigned long long ptrcast; -#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__) -typedef unsigned long ptrcast; -#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__) -typedef unsigned int ptrcast; -#else -#error Add target support here -#endif +typedef __UINTPTR_TYPE__ ptrcast; volatile unsigned long * sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end) diff --git a/gcc/testsuite/gcc.dg/pr42611.c b/gcc/testsuite/gcc.dg/pr42611.c index 0426ce2..f502fea 100644 --- a/gcc/testsuite/gcc.dg/pr42611.c +++ b/gcc/testsuite/gcc.dg/pr42611.c @@ -3,7 +3,8 @@ /* { dg-options "" } */ #define L \ - (sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__ \ + (sizeof (__SIZE_TYPE__) == sizeof (void *) ? __INTPTR_MAX__ \ + : sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__ \ : sizeof (__SIZE_TYPE__) == sizeof (short) ? __SHRT_MAX__ \ : sizeof (__SIZE_TYPE__) == sizeof (int) ? __INT_MAX__ \ : sizeof (__SIZE_TYPE__) == sizeof (long) ? __LONG_MAX__ \ diff --git a/gcc/testsuite/gcc.dg/pr59963-2.c b/gcc/testsuite/gcc.dg/pr59963-2.c index f54a312..9344566 100644 --- a/gcc/testsuite/gcc.dg/pr59963-2.c +++ b/gcc/testsuite/gcc.dg/pr59963-2.c @@ -32,6 +32,6 @@ foo (int i) -7, /* { dg-warning "15:-Wsign-conversion" } */ -8); /* { dg-warning "16:-Wsign-conversion" } */ bazu (i, i); /* { dg-warning "9:conversion" } */ - bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "first" { xfail int16 } } */ + bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "first" { target { ! int16 } } } */ /* { dg-warning "overflow in conversion from" "second" { target int16 } .-1 } */ } diff --git a/gcc/testsuite/gcc.dg/pr68317.c b/gcc/testsuite/gcc.dg/pr68317.c index 9ba6fb0..891d129 100644 --- a/gcc/testsuite/gcc.dg/pr68317.c +++ b/gcc/testsuite/gcc.dg/pr68317.c @@ -1,15 +1,17 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ -void bar (int); +typedef int int32_t __attribute__((mode (__SI__))); + +void bar (int32_t); void foo () { - int index = 0; + int32_t index = 0; - for (index; index <= 10; index--) + for (index; index <= 10; index--) // expected warning here /* Result of the following multiply will overflow - when converted to signed int. */ + when converted to signed int32_t. */ bar ((0xcafe + index) * 0xdead); /* { dg-warning "iteration \[0-9\]+ invokes undefined behavior" } */ } diff --git a/gcc/testsuite/gcc.dg/pr78973.c b/gcc/testsuite/gcc.dg/pr78973.c index d0ecba4..6f4f643 100644 --- a/gcc/testsuite/gcc.dg/pr78973.c +++ b/gcc/testsuite/gcc.dg/pr78973.c @@ -9,7 +9,7 @@ static void f (void *p, int n) { if (n <= 4) - __builtin_memset (p, 0, n); /* { dg-warning "exceeds maximum object size" "pr79073" { xfail ilp32 } } */ + __builtin_memset (p, 0, n); /* { dg-warning "exceeds maximum object size" "pr79073" { xfail { ilp32 || { int16 && { ! msp430_large } } } } } */ } void g (void *d, unsigned n) diff --git a/gcc/testsuite/gcc.dg/pr85859.c b/gcc/testsuite/gcc.dg/pr85859.c index b1476ba..7a57a09 100644 --- a/gcc/testsuite/gcc.dg/pr85859.c +++ b/gcc/testsuite/gcc.dg/pr85859.c @@ -15,6 +15,6 @@ int main (void) { b = (unsigned char) __builtin_parity (d); - e ? foo (0) : (long) &c; + e ? foo (0) : (__INTPTR_TYPE__) &c; return 0; } diff --git a/gcc/testsuite/gcc.dg/pr86179.c b/gcc/testsuite/gcc.dg/pr86179.c index 6a90f09..f3dd367 100644 --- a/gcc/testsuite/gcc.dg/pr86179.c +++ b/gcc/testsuite/gcc.dg/pr86179.c @@ -1,14 +1,17 @@ /* { dg-do compile } */ /* { dg-options "-O3" } */ -void c(int *d, char *g) +typedef int int32_t __attribute__((mode (__SI__))); +typedef unsigned uint32_t __attribute__((mode (__SI__))); + +void c(int32_t *d, char *g) { char *a, *b, *e; int f; for (; f; f -= 8) { - *d++ = *e++ | (unsigned)*g++ << 8 | (unsigned)*b++ << 16 | - (unsigned)*a++ << 24; - *d++ = *e++ | (unsigned)*g++ << 8 | (unsigned)*b++ << 16 | - (unsigned)*a++ << 24; + *d++ = *e++ | (uint32_t)*g++ << 8 | (uint32_t)*b++ << 16 | + (uint32_t)*a++ << 24; + *d++ = *e++ | (uint32_t)*g++ << 8 | (uint32_t)*b++ << 16 | + (uint32_t)*a++ << 24; } } diff --git a/gcc/testsuite/gcc.dg/torture/20181024-1.c b/gcc/testsuite/gcc.dg/torture/20181024-1.c index a3cce24..9cc97a9 100644 --- a/gcc/testsuite/gcc.dg/torture/20181024-1.c +++ b/gcc/testsuite/gcc.dg/torture/20181024-1.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target size32plus } */ /* { dg-additional-options "-march=core-avx2" { target { x86_64-*-* i?86-*-* } } } */ +/* { dg-require-effective-target size32plus } */ typedef enum { C = 0, N, S, E, W, T, B, NE, NW, SE, SW, NT, NB, ST, SB, ET, EB, WT, WB, FLAGS, N_CELL_ENTRIES} CELL_ENTRIES; diff --git a/gcc/testsuite/gcc.dg/torture/pr71598-2.c b/gcc/testsuite/gcc.dg/torture/pr71598-2.c index 44b23f5..8b57a50 100644 --- a/gcc/testsuite/gcc.dg/torture/pr71598-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr71598-2.c @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-prune-output "use of enum values across objects may fail" } */ /* { dg-additional-options "-fshort-enums" } */ +/* { dg-skip-if "" short_eq_int } */ enum e1 { c1 = -__INT_MAX__ }; diff --git a/gcc/testsuite/gcc.dg/torture/pr86034.c b/gcc/testsuite/gcc.dg/torture/pr86034.c index d83ea39..30912ca 100644 --- a/gcc/testsuite/gcc.dg/torture/pr86034.c +++ b/gcc/testsuite/gcc.dg/torture/pr86034.c @@ -3,15 +3,17 @@ /* { dg-do run } */ +typedef int int32_t __attribute__((mode (__SI__))); + struct A { - int b; - __INT32_TYPE__ c:24; - int d:10; - int e; + int32_t b; + int32_t c:24; + int32_t d:10; + int32_t e; } f; -int g; +int32_t g; void h () { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c index 39d89db..999f55e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c @@ -360,35 +360,35 @@ NOIPA void test_too_large (char *d, int x, __builtin_va_list va) const size_t imax_p1 = imax + 1; __builtin_snprintf (d, imax, "%c", x); - __builtin_snprintf (d, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ + __builtin_snprintf (d, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */ __builtin_vsnprintf (d, imax, "%c", va); - __builtin_vsnprintf (d, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ + __builtin_vsnprintf (d, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */ __builtin___snprintf_chk (d, imax, 0, imax, "%c", x); - __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ + __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */ __builtin___vsnprintf_chk (d, imax, 0, imax, "%c", va); - __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ + __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */ const size_t ptrmax = __PTRDIFF_MAX__; const size_t ptrmax_m1 = ptrmax - 1; - __builtin_snprintf (d, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */ - __builtin_snprintf (d, ptrmax, " %c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */ + __builtin_snprintf (d, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */ + __builtin_snprintf (d, ptrmax, " %c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */ - __builtin_vsnprintf (d, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */ - __builtin_vsnprintf (d, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */ + __builtin_vsnprintf (d, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */ + __builtin_vsnprintf (d, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */ - __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */ - __builtin___snprintf_chk (d, ptrmax, 0, ptrmax, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */ + __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */ + __builtin___snprintf_chk (d, ptrmax, 0, ptrmax, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */ - __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */ - __builtin___vsnprintf_chk (d, ptrmax, 0, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */ + __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */ + __builtin___vsnprintf_chk (d, ptrmax, 0, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */ } /* Exercise ordinary sprintf with malloc. */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c b/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c index a8a9de4..ed94f6b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized -fno-strict-aliasing" } */ /* Test with fixed address */ -static int *foo = (int *) (unsigned long) 0x7800000; +static int *foo = (int *) (unsigned long) __INTPTR_MAX__; int func(void) __attribute__ ((noinline)); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c index 8f5a9a0..621f48f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c @@ -3,16 +3,18 @@ /* { dg-require-effective-target size20plus } */ /* { dg-skip-if "too big data segment" { visium-*-* } } */ +typedef int int32_t __attribute__((mode (__SI__))); + #define M 256 int a[M][M], b[M][M]; -int __attribute__((noinline)) +int32_t __attribute__((noinline)) double_reduc (int n) { - int sum = 0; + int32_t sum = 0; for (int j = 0; j < n; j++) { for (int i = 0; i < n; i++) - sum = sum + a[i][j]*b[i][j]; + sum = sum + (int32_t)a[i][j]*(int32_t)b[i][j]; } return sum; } @@ -34,7 +36,7 @@ int main (void) for (int i = 0; i < M; ++i) init (i); - int sum = double_reduc (M); + int32_t sum = double_reduc (M); if (sum != 1065369600) abort (); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c index 87937f3..48740dd 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c @@ -20,5 +20,5 @@ void f() { h(g); } -/* { dg-final { scan-tree-dump-times ".* \\+ 4294967247" 1 "switchconv" } } */ +/* { dg-final { scan-tree-dump-times ".* \\+ (?:4294967247|65487)" 1 "switchconv" } } */ /* { dg-final { scan-tree-dump-not "switch" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c b/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c index 6ff5a07..7832ffa 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c @@ -1,8 +1,10 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-cddce1-details" } */ +typedef unsigned uint32_t __attribute__((mode (__SI__))); + int main() { - for (unsigned i = 0; i < (1u << 31); ++i) { + for (uint32_t i = 0; i < (1UL << 31); ++i) { } return 0; } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c index 666dd30..a5b2ff7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c @@ -3,6 +3,12 @@ int *a; +#if __SIZEOF_INT__ == __SIZEOF_SHORT__ +typedef char small_t; +#else +typedef short small_t; +#endif + int foo1 (long long s, long long l) { @@ -10,7 +16,7 @@ foo1 (long long s, long long l) for (i = s; i < l; i++) { - a[(short)i] = 0; + a[(small_t)i] = 0; } return 0; } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c index c456d73..95c936c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c @@ -300,10 +300,10 @@ f2 (struct C *x) else { o = f2 (x); -#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ +#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__ if (((unsigned long) o > (unsigned long) -4000L)) -#elif __SIZEOF_POINTER__ == __SIZEOF_INT__ - if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U)) +#else + if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000UL)) #endif { e = 5; @@ -388,10 +388,10 @@ f2 (struct C *x) break; case 19: o = f2 (x); -#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ +#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__ if (((unsigned long) o > (unsigned long) -4000L)) -#elif __SIZEOF_POINTER__ == __SIZEOF_INT__ - if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U)) +#else + if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000UL)) #endif { e = 6; |