diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
127 files changed, 1672 insertions, 380 deletions
diff --git a/gcc/testsuite/gcc.dg/Walloca-15.c b/gcc/testsuite/gcc.dg/Walloca-15.c new file mode 100644 index 00000000000..f34ffd98b61 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Walloca-15.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target alloca } */ +/* { dg-options "-Walloca-larger-than=128 -O2" } */ + +typedef __SIZE_TYPE__ size_t; + +void bar (void*); + +void foo1 (size_t len) +{ + bar (__builtin_alloca_with_align_and_max (len, 8, 128)); +} + +void foo2 (size_t len) +{ + bar (__builtin_alloca_with_align_and_max (len, 8, 256)); /* { dg-warning "may be too large" } */ +} diff --git a/gcc/testsuite/gcc.dg/asan/pr82517.c b/gcc/testsuite/gcc.dg/asan/pr82517.c new file mode 100644 index 00000000000..c7743ecb8b1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/asan/pr82517.c @@ -0,0 +1,43 @@ +/* PR sanitizer/82517. */ + +static int *pp; + +void +baz () +{ + return; +} + +void +bar (int *p) +{ + *p = 1; +} + +void +foo (int a) +{ + if (a == 2) + { + lab: + baz (); + return; + } + if (a > 1) + { + int x __attribute__ ((aligned (256))); + pp = &x; + bar (&x); + if (!x) + goto lab; + } +} + +int +main (int argc, char **argv) +{ + foo (4); + foo (3); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/asan/pr82545.c b/gcc/testsuite/gcc.dg/asan/pr82545.c new file mode 100644 index 00000000000..8870db3653f --- /dev/null +++ b/gcc/testsuite/gcc.dg/asan/pr82545.c @@ -0,0 +1,17 @@ +/* PR sanitizer/82545. */ +/* { dg-do compile } */ + +extern void c(int); +extern void d(void); + +void *buf[5]; + +void a(void) { + { + int b; + &b; + __builtin_setjmp(buf); + c(b); + } + d(); +} diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c index fe6154a0d77..6e109955183 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c @@ -47,8 +47,8 @@ typedef __SIZE_TYPE__ size_t; /* The following tests fail because of missing range information. The xfail exclusions are PR79356. */ -TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390*-*-* } } } } */ -TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390x-*-* } } } } */ +TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* } } } } */ +TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* } } } } */ TEST (int, INT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */ TEST (int, -3, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */ TEST (int, -2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */ diff --git a/gcc/testsuite/gcc.dg/c17-version-1.c b/gcc/testsuite/gcc.dg/c17-version-1.c new file mode 100644 index 00000000000..4e69a6eec11 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c17-version-1.c @@ -0,0 +1,9 @@ +/* Test __STDC_VERSION__ for C17. Test -std=c17. */ +/* { dg-do compile } */ +/* { dg-options "-std=c17 -pedantic-errors" } */ + +#if __STDC_VERSION__ == 201710L +int i; +#else +#error "Bad __STDC_VERSION__." +#endif diff --git a/gcc/testsuite/gcc.dg/c17-version-2.c b/gcc/testsuite/gcc.dg/c17-version-2.c new file mode 100644 index 00000000000..3f367204094 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c17-version-2.c @@ -0,0 +1,9 @@ +/* Test __STDC_VERSION__ for C17. Test -std=iso9899:2017. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:2017 -pedantic-errors" } */ + +#if __STDC_VERSION__ == 201710L +int i; +#else +#error "Bad __STDC_VERSION__." +#endif diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-11.c b/gcc/testsuite/gcc.dg/c90-const-expr-11.c index e4f2aff7874..a2720c47bf4 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-11.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-11.c @@ -20,7 +20,7 @@ f (void) /* Overflow. */ struct t b = { INT_MAX + 1 }; /* { dg-warning "integer overflow in expression" } */ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */ - struct t c = { DBL_MAX }; /* { dg-warning "overflow in conversion from .double. to .int. chages value " } */ + struct t c = { DBL_MAX }; /* { dg-warning "overflow in conversion from .double. to .int. changes value " } */ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */ /* Bad operator outside sizeof. */ struct s d = { 1 ? 1.0 : atan (a.d) }; /* { dg-error "is not a constant expression|near initialization" } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c index 3773e1c83c3..aebfcad6008 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c @@ -1,6 +1,6 @@ /* PR debug/50983 */ /* { dg-do compile { target *-*-gnu* } } */ -/* { dg-options "-O0 -gdwarf" } */ +/* { dg-options "-O0 -gdwarf -gno-column-info" } */ /* { dg-final { scan-assembler "is_stmt 1" } } */ int i; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c b/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c index b77f7b1bfff..fa24de8d7d4 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c @@ -1,7 +1,7 @@ /* HAVE_AS_DWARF2_DEBUG_LINE macro needs to be defined to pass the unittest. However, dg cannot access it, so we restrict to GNU targets. */ /* { dg-do compile { target *-*-gnu* } } */ -/* { dg-options "-O0 -gdwarf" } */ +/* { dg-options "-O0 -gdwarf -gno-column-info" } */ /* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])?\n" } } */ /* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])? discriminator 2\n" } } */ /* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])? discriminator 1\n" } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c index 0ec3e84d704..4485e19c1cd 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c @@ -1,7 +1,7 @@ /* Test that we have line information for the line with local variable initializations. */ /* { dg-options "-O0 -gdwarf -dA" } */ -/* { dg-final { scan-assembler ".loc 1 8 0|\[#/!\]\[ \t\]+line 8" } } */ +/* { dg-final { scan-assembler ".loc 1 8 \[0-9\]|\[#/!\]\[ \t\]+line 8" } } */ int f (register int a, register int b) { diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/sso.c b/gcc/testsuite/gcc.dg/debug/dwarf2/sso-1.c index 698c636a130..698c636a130 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/sso.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/sso-1.c diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/sso-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/sso-2.c new file mode 100644 index 00000000000..0965084d260 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/sso-2.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-gdwarf-3 -dA" } */ + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define REVERSE_SSO __attribute__((scalar_storage_order("big-endian"))); +#else +#define REVERSE_SSO __attribute__((scalar_storage_order("little-endian"))); +#endif + +struct reverse +{ + int i; + short a[4]; +} REVERSE_SSO; + +struct native +{ + int i; + short a[4]; +}; + +struct reverse R; +struct native N; + +/* Verify that we have endianity on the common base type of 'i' and the + * element of 'a' in the first 2 structures. */ +/* { dg-final { scan-assembler-times " DW_AT_endianity" 2 } } */ +/* { dg-final { scan-assembler-times "DIE \\(\[0-9a-z\]*\\) DW_TAG_base_type" 5 } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/sso-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/sso-3.c new file mode 100644 index 00000000000..004327c78ad --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/sso-3.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-gdwarf-3 -dA" } */ + +typedef int int_t; +typedef short short_t; + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define REVERSE_SSO __attribute__((scalar_storage_order("big-endian"))); +#else +#define REVERSE_SSO __attribute__((scalar_storage_order("little-endian"))); +#endif + +struct reverse +{ + int_t i; + short_t a[4]; +} REVERSE_SSO; + +struct native +{ + int_t i; + short_t a[4]; +}; + +struct reverse R; +struct native N; + +/* Verify that we have endianity on the common base type of 'i' and the + * element of 'a' in the first 2 structures. */ +/* { dg-final { scan-assembler-times " DW_AT_endianity" 2 } } */ +/* { dg-final { scan-assembler-times "DIE \\(\[0-9a-z\]*\\) DW_TAG_base_type" 5 } } */ diff --git a/gcc/testsuite/gcc.dg/fold-cond_expr-1.c b/gcc/testsuite/gcc.dg/fold-cond-2.c index 68ec75480ad..68ec75480ad 100644 --- a/gcc/testsuite/gcc.dg/fold-cond_expr-1.c +++ b/gcc/testsuite/gcc.dg/fold-cond-2.c diff --git a/gcc/testsuite/gcc.dg/fold-cond-3.c b/gcc/testsuite/gcc.dg/fold-cond-3.c new file mode 100644 index 00000000000..fe0ba65ebac --- /dev/null +++ b/gcc/testsuite/gcc.dg/fold-cond-3.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-original" } */ + +unsigned long f1 (int x) +{ + return x > 0 ? (unsigned long) x : 0; +} + +unsigned long f2 (int x, int y) +{ + return x > y ? (unsigned long) x : (unsigned long) y; +} + +unsigned long f3 (int x) +{ + return x < 0 ? (unsigned long) x : 0; +} + +unsigned long f4 (int x, int y) +{ + return x < y ? (unsigned long) x : (unsigned long) y; +} + +unsigned long f5 (unsigned int x, unsigned int y) +{ + return x > y ? (unsigned long) x : (unsigned long) y; +} + +unsigned long f6 (unsigned int x, unsigned int y) +{ + return x < y ? (unsigned long) x : (unsigned long) y; +} + +/* { dg-final { scan-tree-dump-times "MAX_EXPR" 3 "original"} } */ +/* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "original"} } */ diff --git a/gcc/testsuite/gcc.dg/gimplefe-27.c b/gcc/testsuite/gcc.dg/gimplefe-27.c new file mode 100644 index 00000000000..604a2cc2fcc --- /dev/null +++ b/gcc/testsuite/gcc.dg/gimplefe-27.c @@ -0,0 +1,9 @@ +/* { dg-options "-O -fgimple" } */ + +int __GIMPLE () +p (int n) +{ + int _2; + _2 = n_1(D) != 0 ? 2 : 0; + return _2; +} diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-3.c b/gcc/testsuite/gcc.dg/graphite/interchange-3.c index 4aec824183a..cb93f5d0920 100644 --- a/gcc/testsuite/gcc.dg/graphite/interchange-3.c +++ b/gcc/testsuite/gcc.dg/graphite/interchange-3.c @@ -47,4 +47,4 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump "tiled" "graphite" } } */ +/* { dg-final { scan-tree-dump "tiled" "graphite" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-7.c b/gcc/testsuite/gcc.dg/graphite/interchange-7.c index 81a6d832327..81a0a4daf55 100644 --- a/gcc/testsuite/gcc.dg/graphite/interchange-7.c +++ b/gcc/testsuite/gcc.dg/graphite/interchange-7.c @@ -46,4 +46,4 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump "tiled" "graphite" } } */ +/* { dg-final { scan-tree-dump "tiled" "graphite" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-9.c b/gcc/testsuite/gcc.dg/graphite/interchange-9.c index 88a357893e9..75d269e4527 100644 --- a/gcc/testsuite/gcc.dg/graphite/interchange-9.c +++ b/gcc/testsuite/gcc.dg/graphite/interchange-9.c @@ -44,4 +44,4 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump "tiled" "graphite" } } */ +/* { dg-final { scan-tree-dump "tiled" "graphite" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/pr35356-3.c b/gcc/testsuite/gcc.dg/graphite/pr35356-3.c index f2827a2bb6d..8db042ffc6f 100644 --- a/gcc/testsuite/gcc.dg/graphite/pr35356-3.c +++ b/gcc/testsuite/gcc.dg/graphite/pr35356-3.c @@ -36,4 +36,5 @@ match (void) "Y[winner].y > 0". This could be fixed when we will use predicates for such cases. */ -/* { dg-final { scan-tree-dump-times "loop_1" 0 "graphite" } } */ +/* { dg-final { scan-tree-dump-times "loop_1" 0 "graphite" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "number of SCoPs: 0" "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/pr81373-2.c b/gcc/testsuite/gcc.dg/graphite/pr81373-2.c new file mode 100644 index 00000000000..6a654bec977 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr81373-2.c @@ -0,0 +1,40 @@ +/* { dg-options "-fno-tree-scev-cprop -floop-nest-optimize -fgraphite-identity -O -fdump-tree-graphite-all" } */ + +void bar (void); + +int toto() +{ + int i, j, k; + int a[101][100]; + int b[100]; + + for (i = 1; i < 100; i++) + { + for (j = 1; j < 100; j++) + for (k = 1; k < 100; k++) + a[j][k] = a[j+1][i-1] + 2; + + b[i] = b[i-1] + 2; + + bar (); + + for (j = 1; j < 100; j++) + a[j][i] = a[j+1][i-1] + 2; + + b[i] = b[i-1] + 2; + + bar (); + + for (j = 1; j < 100; j++) + a[j][i] = a[j+1][i-1] + 2; + + b[i] = a[i-1][i] + 2; + + for (j = 1; j < 100; j++) + a[j][i] = a[j+1][i-1] + 2; + } + + return a[3][5] + b[1]; +} + +/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */ diff --git a/gcc/testsuite/gcc.dg/graphite/pr82563.c b/gcc/testsuite/gcc.dg/graphite/pr82563.c new file mode 100644 index 00000000000..cd492fa79c8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr82563.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -floop-nest-optimize" } */ + +int tj, cw, xf; + +void +zp (int *ei) +{ + for (;;) + { + int hd = 0; + + if (cw != 0 && xf != 0) + { + for (hd = 0; hd < 3; ++hd) + cw = (tj != 0) ? 0 : *ei; + for (;;) + ; + } + + while (tj != 0) + tj = (__UINTPTR_TYPE__)&hd; + } +} diff --git a/gcc/testsuite/gcc.dg/graphite/scop-10.c b/gcc/testsuite/gcc.dg/graphite/scop-10.c index 39ed5d7ea7b..20d53510b4e 100644 --- a/gcc/testsuite/gcc.dg/graphite/scop-10.c +++ b/gcc/testsuite/gcc.dg/graphite/scop-10.c @@ -4,7 +4,7 @@ int toto() { int i, j, k; int a[100][100]; - int b[100]; + int b[200]; for (i = 1; i < 100; i++) { diff --git a/gcc/testsuite/gcc.dg/graphite/scop-7.c b/gcc/testsuite/gcc.dg/graphite/scop-7.c index 3e337d0c603..2f0a50470e9 100644 --- a/gcc/testsuite/gcc.dg/graphite/scop-7.c +++ b/gcc/testsuite/gcc.dg/graphite/scop-7.c @@ -4,7 +4,7 @@ int toto() { int i, j, k; int a[100][100]; - int b[100]; + int b[200]; for (i = 1; i < 100; i++) { diff --git a/gcc/testsuite/gcc.dg/graphite/scop-8.c b/gcc/testsuite/gcc.dg/graphite/scop-8.c index 71d5c531fb8..3ceb5d874d6 100644 --- a/gcc/testsuite/gcc.dg/graphite/scop-8.c +++ b/gcc/testsuite/gcc.dg/graphite/scop-8.c @@ -4,7 +4,7 @@ int toto() { int i, j, k; int a[100][100]; - int b[100]; + int b[200]; for (i = 1; i < 100; i++) { diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c index cc108c2bbc3..fb36afe003e 100644 --- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c +++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c @@ -45,4 +45,4 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump "tiled" "graphite" } } */ +/* { dg-final { scan-tree-dump "tiled" "graphite" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/propmalloc-1.c b/gcc/testsuite/gcc.dg/ipa/propmalloc-1.c new file mode 100644 index 00000000000..9a95f817079 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/propmalloc-1.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-pure-const-details" } */ + +__attribute__((noinline, no_icf, used)) +static void *f(__SIZE_TYPE__ n) +{ + void *p = __builtin_malloc (n); + if (p == 0) + __builtin_abort (); + return p; +} + +__attribute__((noinline, no_icf, used)) +static void *bar(__SIZE_TYPE__ n) +{ + void *p = f (n); + return p; +} + +/* { dg-final { scan-ipa-dump "Function f found to be malloc" "pure-const" } } */ +/* { dg-final { scan-ipa-dump "Function bar found to be malloc" "pure-const" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/propmalloc-2.c b/gcc/testsuite/gcc.dg/ipa/propmalloc-2.c new file mode 100644 index 00000000000..95b2fd74a7a --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/propmalloc-2.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-pure-const-details" } */ + +__attribute__((noinline, used, no_icf)) +static void *foo (__SIZE_TYPE__ n) +{ + return __builtin_malloc (n * 10); +} + +__attribute__((noinline, used, no_icf)) +static void *bar(__SIZE_TYPE__ n, int cond) +{ + void *p; + if (cond) + p = foo (n); + else + p = __builtin_malloc (n); + + return p; +} + +/* { dg-final { scan-ipa-dump "Function foo found to be malloc" "pure-const" } } */ +/* { dg-final { scan-ipa-dump "Function bar found to be malloc" "pure-const" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/propmalloc-3.c b/gcc/testsuite/gcc.dg/ipa/propmalloc-3.c new file mode 100644 index 00000000000..13558ddd07d --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/propmalloc-3.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-pure-const-details" } */ + +static void *foo(__SIZE_TYPE__, int) __attribute__((noinline, no_icf, used)); + +__attribute__((noinline, used, no_icf)) +static void *bar(__SIZE_TYPE__ n, int m) +{ + return foo (n, m); +} + +static void *foo(__SIZE_TYPE__ n, int m) +{ + void *p; + if (m > 0) + p = bar (n, --m); + else + p = __builtin_malloc (n); + + return p; +} + +/* { dg-final { scan-ipa-dump "Function foo found to be malloc" "pure-const" } } */ +/* { dg-final { scan-ipa-dump "Function bar found to be malloc" "pure-const" } } */ diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-3.c b/gcc/testsuite/gcc.dg/no-strict-overflow-3.c index fd4defbd447..d68008a3dde 100644 --- a/gcc/testsuite/gcc.dg/no-strict-overflow-3.c +++ b/gcc/testsuite/gcc.dg/no-strict-overflow-3.c @@ -9,7 +9,7 @@ int foo (int i, int j) { - return i + 100 < j + 1000; + return i + 100 < j + 1234; } -/* { dg-final { scan-tree-dump "1000" "optimized" } } */ +/* { dg-final { scan-tree-dump "1234" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/920923-1.c b/gcc/testsuite/gcc.dg/noncompile/920923-1.c index 1cb140ebabc..006a07131f9 100644 --- a/gcc/testsuite/gcc.dg/noncompile/920923-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/920923-1.c @@ -1,5 +1,6 @@ /* { dg-message "undeclared identifier is reported only once" "reminder for mmu_base" { target *-*-* } 0 } */ typedef BYTE unsigned char; /* { dg-error "expected" } */ +/* { dg-warning "useless type name in empty declaration" "" { target *-*-* } .-1 } */ typedef int item_n; typedef int perm_set; struct PENT { caddr_t v_addr; };/* { dg-error "unknown type name" } */ diff --git a/gcc/testsuite/gcc.dg/overflow-warn-5.c b/gcc/testsuite/gcc.dg/overflow-warn-5.c index b2c8dc31d95..1a5aa0c6059 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-5.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-5.c @@ -3,5 +3,5 @@ /* { dg-options "-Woverflow" } */ unsigned char rx_async(unsigned char p) { - return p & 512; /* { dg-warning "overflow in conversion from .int. to .unsigned char. chages value" } */ + return p & 512; /* { dg-warning "overflow in conversion from .int. to .unsigned char. changes value" } */ } diff --git a/gcc/testsuite/gcc.dg/overflow-warn-8.c b/gcc/testsuite/gcc.dg/overflow-warn-8.c index ace605517dc..e76bcac5e07 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-8.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-8.c @@ -7,7 +7,7 @@ void foo (int j) int i3 = 1 + INT_MAX; /* { dg-warning "integer overflow" } */ int i4 = +1 + INT_MAX; /* { dg-warning "integer overflow" } */ int i5 = (int)((double)1.0 + INT_MAX); - int i6 = (double)1.0 + INT_MAX; /* { dg-warning "overflow in conversion from .double. to .int. chages value" } */ + int i6 = (double)1.0 + INT_MAX; /* { dg-warning "overflow in conversion from .double. to .int. changes value" } */ int i7 = 0 ? (int)(double)1.0 + INT_MAX : 1; int i8 = 1 ? 1 : (int)(double)1.0 + INT_MAX; int i9 = j ? (int)(double)1.0 + INT_MAX : 1; /* { dg-warning "integer overflow" } */ diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_show_trees.c b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_show_trees.c index f025f963e69..0bdd877dbd5 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_show_trees.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_show_trees.c @@ -45,14 +45,14 @@ show_tree (tree node) if (richloc.get_num_locations () < 2) { - error_at_rich_loc (&richloc, "range not found"); + error_at (&richloc, "range not found"); return; } enum tree_code code = TREE_CODE (node); location_range *range = richloc.get_range (1); - inform_at_rich_loc (&richloc, "%s", get_tree_code_name (code)); + inform (&richloc, "%s", get_tree_code_name (code)); /* Recurse. */ int min_idx = 0; diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c index 0a8eeba1846..9751e1cd25e 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c @@ -176,7 +176,7 @@ test_show_locus (function *fun) rich_location richloc (line_table, get_loc (line, 15)); add_range (&richloc, get_loc (line, 10), get_loc (line, 14), false); add_range (&richloc, get_loc (line, 16), get_loc (line, 16), false); - warning_at_rich_loc (&richloc, 0, "test"); + warning_at (&richloc, 0, "test"); } if (0 == strcmp (fnname, "test_simple_2")) @@ -185,7 +185,7 @@ test_show_locus (function *fun) rich_location richloc (line_table, get_loc (line, 24)); add_range (&richloc, get_loc (line, 6), get_loc (line, 22), false); add_range (&richloc, get_loc (line, 26), get_loc (line, 43), false); - warning_at_rich_loc (&richloc, 0, "test"); + warning_at (&richloc, 0, "test"); } if (0 == strcmp (fnname, "test_multiline")) @@ -195,7 +195,7 @@ test_show_locus (function *fun) add_range (&richloc, get_loc (line, 7), get_loc (line, 23), false); add_range (&richloc, get_loc (line + 1, 9), get_loc (line + 1, 26), false); - warning_at_rich_loc (&richloc, 0, "test"); + warning_at (&richloc, 0, "test"); } if (0 == strcmp (fnname, "test_many_lines")) @@ -205,7 +205,7 @@ test_show_locus (function *fun) add_range (&richloc, get_loc (line, 7), get_loc (line + 4, 65), false); add_range (&richloc, get_loc (line + 5, 9), get_loc (line + 10, 61), false); - warning_at_rich_loc (&richloc, 0, "test"); + warning_at (&richloc, 0, "test"); } /* Example of a rich_location where the range is larger than @@ -216,7 +216,7 @@ test_show_locus (function *fun) location_t start = get_loc (line, 12); location_t finish = get_loc (line, 16); rich_location richloc (line_table, make_location (start, start, finish)); - warning_at_rich_loc (&richloc, 0, "test"); + warning_at (&richloc, 0, "test"); } /* Example of a single-range location where the range starts @@ -251,7 +251,7 @@ test_show_locus (function *fun) add_range (&richloc, caret_b, caret_b, true); global_dc->caret_chars[0] = 'A'; global_dc->caret_chars[1] = 'B'; - warning_at_rich_loc (&richloc, 0, "test"); + warning_at (&richloc, 0, "test"); global_dc->caret_chars[0] = '^'; global_dc->caret_chars[1] = '^'; } @@ -265,7 +265,7 @@ test_show_locus (function *fun) rich_location richloc (line_table, make_location (start, start, finish)); richloc.add_fixit_insert_before ("{"); richloc.add_fixit_insert_after ("}"); - warning_at_rich_loc (&richloc, 0, "example of insertion hints"); + warning_at (&richloc, 0, "example of insertion hints"); } if (0 == strcmp (fnname, "test_fixit_insert_newline")) @@ -277,7 +277,7 @@ test_show_locus (function *fun) location_t case_loc = make_location (case_start, case_start, case_finish); rich_location richloc (line_table, case_loc); richloc.add_fixit_insert_before (line_start, " break;\n"); - warning_at_rich_loc (&richloc, 0, "example of newline insertion hint"); + warning_at (&richloc, 0, "example of newline insertion hint"); } if (0 == strcmp (fnname, "test_fixit_remove")) @@ -290,7 +290,7 @@ test_show_locus (function *fun) src_range.m_start = start; src_range.m_finish = finish; richloc.add_fixit_remove (src_range); - warning_at_rich_loc (&richloc, 0, "example of a removal hint"); + warning_at (&richloc, 0, "example of a removal hint"); } if (0 == strcmp (fnname, "test_fixit_replace")) @@ -303,7 +303,7 @@ test_show_locus (function *fun) src_range.m_start = start; src_range.m_finish = finish; richloc.add_fixit_replace (src_range, "gtk_widget_show_all"); - warning_at_rich_loc (&richloc, 0, "example of a replacement hint"); + warning_at (&richloc, 0, "example of a replacement hint"); } if (0 == strcmp (fnname, "test_mutually_exclusive_suggestions")) @@ -319,14 +319,14 @@ test_show_locus (function *fun) rich_location richloc (line_table, make_location (start, start, finish)); richloc.add_fixit_replace (src_range, "replacement_1"); richloc.fixits_cannot_be_auto_applied (); - warning_at_rich_loc (&richloc, 0, "warning 1"); + warning_at (&richloc, 0, "warning 1"); } { rich_location richloc (line_table, make_location (start, start, finish)); richloc.add_fixit_replace (src_range, "replacement_2"); richloc.fixits_cannot_be_auto_applied (); - warning_at_rich_loc (&richloc, 0, "warning 2"); + warning_at (&richloc, 0, "warning 2"); } } @@ -346,7 +346,7 @@ test_show_locus (function *fun) richloc.add_range (caret_b, true); global_dc->caret_chars[0] = '1'; global_dc->caret_chars[1] = '2'; - warning_at_rich_loc (&richloc, 0, "test"); + warning_at (&richloc, 0, "test"); global_dc->caret_chars[0] = '^'; global_dc->caret_chars[1] = '^'; } @@ -411,8 +411,8 @@ test_show_locus (function *fun) statically-allocated buffer in class rich_location, and then trigger a reallocation of the dynamic buffer. */ gcc_assert (richloc.get_num_locations () > 3 + (2 * 16)); - warning_at_rich_loc (&richloc, 0, "test of %i locations", - richloc.get_num_locations ()); + warning_at (&richloc, 0, "test of %i locations", + richloc.get_num_locations ()); } } diff --git a/gcc/testsuite/gcc.dg/plugin/poly-int-tests.h b/gcc/testsuite/gcc.dg/plugin/poly-int-tests.h index 9409ec7bc0f..b7a93856003 100644 --- a/gcc/testsuite/gcc.dg/plugin/poly-int-tests.h +++ b/gcc/testsuite/gcc.dg/plugin/poly-int-tests.h @@ -437,64 +437,6 @@ test_must_eq () ph::make (0, 3, 5))); } -/* Test known_zero. */ - -template<unsigned int N, typename C, typename T> -static void -test_known_zero () -{ - typedef poly_helper<T> ph; - - ASSERT_EQ (known_zero (ph::make (0, 0, 1)), N <= 2); - ASSERT_EQ (known_zero (ph::make (0, 1, 0)), N == 1); - ASSERT_TRUE (known_zero (ph::make (0, 0, 0))); - ASSERT_FALSE (known_zero (ph::make (1, 0, 0))); -} - -/* Test maybe_nonzero. */ - -template<unsigned int N, typename C, typename T> -static void -test_maybe_nonzero () -{ - typedef poly_helper<T> ph; - - ASSERT_EQ (maybe_nonzero (ph::make (0, 0, 1)), N == 3); - ASSERT_EQ (maybe_nonzero (ph::make (0, 1, 0)), N >= 2); - ASSERT_FALSE (maybe_nonzero (ph::make (0, 0, 0))); - ASSERT_TRUE (maybe_nonzero (ph::make (1, 0, 0))); -} - -/* Test known_one. */ - -template<unsigned int N, typename C, typename T> -static void -test_known_one () -{ - typedef poly_helper<T> ph; - - ASSERT_EQ (known_one (ph::make (1, 0, 1)), N <= 2); - ASSERT_EQ (known_one (ph::make (1, 1, 0)), N == 1); - ASSERT_TRUE (known_one (ph::make (1, 0, 0))); - ASSERT_FALSE (known_one (ph::make (0, 0, 0))); -} - -/* Test known_all_ones. */ - -template<unsigned int N, typename C, typename T> -static void -test_known_all_ones () -{ - typedef poly_helper<T> ph; - - ASSERT_EQ (known_all_ones (ph::make (-1, 0, -1)), N <= 2); - ASSERT_EQ (known_all_ones (ph::make (-1, -1, 0)), N == 1); - ASSERT_EQ (known_all_ones (ph::make (-1, -1, -1)), N == 1); - ASSERT_TRUE (known_all_ones (ph::make (-1, 0, 0))); - ASSERT_FALSE (known_all_ones (ph::make (0, 0, 0))); - ASSERT_FALSE (known_all_ones (ph::make (1, 0, 0))); -} - /* Test can_align_p. */ template<unsigned int N, typename C, typename T> @@ -903,44 +845,6 @@ test_must_ne_2 () ASSERT_TRUE (must_ne (T (11, 0), T (4, 2))); } -/* Test maybe_zero for poly_int<2, C>. */ - -template<typename C> -static void -test_maybe_zero_2 () -{ - typedef poly_int<2, C> T; - - ASSERT_TRUE (maybe_zero (T (0, 0))); - ASSERT_TRUE (maybe_zero (T (0, 1))); - ASSERT_TRUE (maybe_zero (T (0, -1))); - ASSERT_FALSE (maybe_zero (T (1, 0))); - ASSERT_FALSE (maybe_zero (T (1, 2))); - ASSERT_FALSE (maybe_zero (T (1, -2))); - ASSERT_FALSE (maybe_zero (T (-1, 0))); - ASSERT_FALSE (maybe_zero (T (-1, 2))); - ASSERT_FALSE (maybe_zero (T (-1, -2))); -} - -/* Test known_nonzero for poly_int<2, C>. */ - -template<typename C> -static void -test_known_nonzero_2 () -{ - typedef poly_int<2, C> T; - - ASSERT_FALSE (known_nonzero (T (0, 0))); - ASSERT_FALSE (known_nonzero (T (0, 1))); - ASSERT_FALSE (known_nonzero (T (0, -1))); - ASSERT_TRUE (known_nonzero (T (1, 0))); - ASSERT_TRUE (known_nonzero (T (1, 2))); - ASSERT_TRUE (known_nonzero (T (1, -2))); - ASSERT_TRUE (known_nonzero (T (-1, 0))); - ASSERT_TRUE (known_nonzero (T (-1, 2))); - ASSERT_TRUE (known_nonzero (T (-1, -2))); -} - /* Test may_le for both signed and unsigned C. */ template<unsigned int N, typename C, typename T> @@ -2235,6 +2139,22 @@ test_can_div_away_from_zero_p () ASSERT_EQ (const_quot, C (0)); } +/* Test known_size_p. */ + +template<unsigned int N, typename C, typename T> +static void +test_known_size_p () +{ + typedef poly_helper<T> ph; + + ASSERT_EQ (known_size_p (ph::make (-1, 0, -1)), N == 3); + ASSERT_EQ (known_size_p (ph::make (-1, -1, 0)), N >= 2); + ASSERT_EQ (known_size_p (ph::make (-1, -1, -1)), N >= 2); + ASSERT_FALSE (known_size_p (ph::make (-1, 0, 0))); + ASSERT_TRUE (known_size_p (ph::make (0, 0, 0))); + ASSERT_TRUE (known_size_p (ph::make (1, 0, 0))); +} + /* Test maybe_in_range_p for both signed and unsigned C. */ template<unsigned int N, typename C, typename T> @@ -2633,44 +2553,6 @@ test_signed_must_ne_2 () ASSERT_TRUE (must_ne (T (-3, 4), T (6, -1))); } -/* Test maybe_zero for poly_int<2, C>, given that C is signed. */ - -template<typename C> -static void -test_signed_maybe_zero_2 () -{ - typedef poly_int<2, C> T; - - ASSERT_TRUE (maybe_zero (T (3, -3))); - ASSERT_TRUE (maybe_zero (T (16, -4))); - ASSERT_TRUE (maybe_zero (T (-15, 5))); - ASSERT_FALSE (maybe_zero (T (3, -4))); - ASSERT_FALSE (maybe_zero (T (3, -6))); - ASSERT_FALSE (maybe_zero (T (15, -4))); - ASSERT_FALSE (maybe_zero (T (17, -4))); - ASSERT_FALSE (maybe_zero (T (-14, 5))); - ASSERT_FALSE (maybe_zero (T (-16, 5))); -} - -/* Test known_nonzero for poly_int<2, C>, given that C is signed. */ - -template<typename C> -static void -test_signed_known_nonzero_2 () -{ - typedef poly_int<2, C> T; - - ASSERT_FALSE (known_nonzero (T (3, -3))); - ASSERT_FALSE (known_nonzero (T (16, -4))); - ASSERT_FALSE (known_nonzero (T (-15, 5))); - ASSERT_TRUE (known_nonzero (T (3, -4))); - ASSERT_TRUE (known_nonzero (T (3, -6))); - ASSERT_TRUE (known_nonzero (T (15, -4))); - ASSERT_TRUE (known_nonzero (T (17, -4))); - ASSERT_TRUE (known_nonzero (T (-14, 5))); - ASSERT_TRUE (known_nonzero (T (-16, 5))); -} - /* Test negation for signed C, both via operators and wi::. */ template<unsigned int N, typename C, typename RC, typename T> @@ -4623,76 +4505,16 @@ test_uhwi () wi::uhwi (210, 16))); } -/* Test known_zero for non-polynomial T. */ - -template<typename T> -static void -test_nonpoly_known_zero () -{ - ASSERT_TRUE (known_zero (T (0))); - ASSERT_FALSE (known_zero (T (1))); - ASSERT_FALSE (known_zero (T (2))); - ASSERT_FALSE (known_zero (T (-1))); -} - -/* Test maybe_zero for non-polynomial T. */ - -template<typename T> -static void -test_nonpoly_maybe_zero () -{ - ASSERT_TRUE (maybe_zero (T (0))); - ASSERT_FALSE (maybe_zero (T (1))); - ASSERT_FALSE (maybe_zero (T (2))); - ASSERT_FALSE (maybe_zero (T (-1))); -} - -/* Test known_nonzero for non-polynomial T. */ - -template<typename T> -static void -test_nonpoly_known_nonzero () -{ - ASSERT_FALSE (known_nonzero (T (0))); - ASSERT_TRUE (known_nonzero (T (1))); - ASSERT_TRUE (known_nonzero (T (2))); - ASSERT_TRUE (known_nonzero (T (-1))); -} - -/* Test maybe_nonzero for non-polynomial T. */ - -template<typename T> -static void -test_nonpoly_maybe_nonzero () -{ - ASSERT_FALSE (maybe_nonzero (T (0))); - ASSERT_TRUE (maybe_nonzero (T (1))); - ASSERT_TRUE (maybe_nonzero (T (2))); - ASSERT_TRUE (maybe_nonzero (T (-1))); -} - -/* Test known_one for non-polynomial T. */ - -template<typename T> -static void -test_nonpoly_known_one () -{ - ASSERT_FALSE (known_one (T (0))); - ASSERT_TRUE (known_one (T (1))); - ASSERT_FALSE (known_one (T (2))); - ASSERT_FALSE (known_one (T (-1))); -} - -/* Test known_all_ones for non-polynomial T. */ +/* Test known_size_p for non-polynomial T. */ template<typename T> static void -test_nonpoly_known_all_ones () +test_nonpoly_known_size_p () { - ASSERT_FALSE (known_all_ones (T (0))); - ASSERT_FALSE (known_all_ones (T (1))); - ASSERT_FALSE (known_all_ones (T (2))); - ASSERT_TRUE (known_all_ones (T (-1))); + ASSERT_TRUE (known_size_p (T (0))); + ASSERT_TRUE (known_size_p (T (1))); + ASSERT_TRUE (known_size_p (T (2))); + ASSERT_FALSE (known_size_p (T (-1))); } /* Test poly-int.h operations on non-polynomial type T. */ @@ -4701,12 +4523,7 @@ template<typename T> static void test_nonpoly_type () { - test_nonpoly_known_zero<T> (); - test_nonpoly_maybe_zero<T> (); - test_nonpoly_known_nonzero<T> (); - test_nonpoly_maybe_nonzero<T> (); - test_nonpoly_known_one<T> (); - test_nonpoly_known_all_ones<T> (); + test_nonpoly_known_size_p<T> (); } /* Test poly-int.h operations on non-polynomial values. */ @@ -4747,10 +4564,6 @@ test_general () test_shift_left<N, C, T> (); test_may_ne<N, C, T> (); test_must_eq<N, C, T> (); - test_known_zero<N, C, T> (); - test_maybe_nonzero<N, C, T> (); - test_known_one<N, C, T> (); - test_known_all_ones<N, C, T> (); test_can_align_p<N, C, T> (); test_can_align_up<N, C, T> (); test_can_align_down<N, C, T> (); @@ -4764,6 +4577,7 @@ test_general () test_force_get_misalignment<N, C, T> (); test_known_alignment<N, C, T> (); test_can_ior_p<N, C, T> (); + test_known_size_p<N, C, T> (); } /* Test things that work for poly_int<2, C>, given that C is signed. */ @@ -4774,8 +4588,6 @@ test_ordered_2 () { test_may_eq_2<C> (); test_must_ne_2<C> (); - test_maybe_zero_2<C> (); - test_known_nonzero_2<C> (); } /* Test things that work for poly_int-based types T, given that the @@ -4829,8 +4641,6 @@ test_signed_2 () test_ordered_2<C> (); test_signed_may_eq_2<C> (); test_signed_must_ne_2<C> (); - test_signed_maybe_zero_2<C> (); - test_signed_known_nonzero_2<C> (); } /* Test things that work for poly_int-based types T, given that the diff --git a/gcc/testsuite/gcc.dg/pr7356-2.c b/gcc/testsuite/gcc.dg/pr7356-2.c new file mode 100644 index 00000000000..ad679756978 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr7356-2.c @@ -0,0 +1,33 @@ +/* { dg-options "-fdiagnostics-show-caret" } */ + +int i /* { dg-error "6: expected ';' before 'int'" } */ +int j; +/* { dg-begin-multiline-output "" } + int i + ^ + ; + int j; + ~~~ + { dg-end-multiline-output "" } */ + + +void test (void) +{ + int i /* { dg-error "8: expected ';' before 'int'" } */ + int j; + + /* { dg-begin-multiline-output "" } + int i + ^ + ; + int j; + ~~~ + { dg-end-multiline-output "" } */ +} + +int old_style_params (first, second) + int first; + int second; +{ + return first + second; +} diff --git a/gcc/testsuite/gcc.dg/pr7356.c b/gcc/testsuite/gcc.dg/pr7356.c new file mode 100644 index 00000000000..84baf078b96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr7356.c @@ -0,0 +1,17 @@ +/* { dg-options "-fdiagnostics-show-caret" } */ + +a /* { dg-line stray_token } */ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +int main(int argc, char** argv) +{ + return 0; +} + +/* { dg-error "expected ';' before '.*'" "" { target *-*-* } stray_token } */ +/* { dg-begin-multiline-output "" } + a + ^ + ; + { dg-end-multiline-output "" } */ diff --git a/gcc/testsuite/gcc.dg/pr82274-1.c b/gcc/testsuite/gcc.dg/pr82274-1.c new file mode 100644 index 00000000000..f96b7338fc4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82274-1.c @@ -0,0 +1,16 @@ +/* PR target/82274 */ +/* { dg-do run } */ +/* { dg-shouldfail "trapv" } */ +/* { dg-options "-ftrapv" } */ + +int +main () +{ +#ifdef __SIZEOF_INT128__ + volatile __int128 m = -(((__int128) 1) << (__CHAR_BIT__ * __SIZEOF_INT128__ / 2)); +#else + volatile long long m = -(1LL << (__CHAR_BIT__ * __SIZEOF_LONG_LONG__ / 2)); +#endif + m = m * m; + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr82274-2.c b/gcc/testsuite/gcc.dg/pr82274-2.c new file mode 100644 index 00000000000..a9643b5a923 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82274-2.c @@ -0,0 +1,26 @@ +/* PR target/82274 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +int +main () +{ +#ifdef __SIZEOF_INT128__ + __int128 m = -(((__int128) 1) << (__CHAR_BIT__ * __SIZEOF_INT128__ / 2)); + volatile __int128 mv = m; + __int128 r; +#else + long long m = -(1LL << (__CHAR_BIT__ * __SIZEOF_LONG_LONG__ / 2)); + volatile long long mv = m; + long long r; +#endif + if (!__builtin_mul_overflow (mv, mv, &r)) + __builtin_abort (); + if (!__builtin_mul_overflow_p (mv, mv, r)) + __builtin_abort (); + if (!__builtin_mul_overflow (m, m, &r)) + __builtin_abort (); + if (!__builtin_mul_overflow_p (m, m, r)) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr82596.c b/gcc/testsuite/gcc.dg/pr82596.c new file mode 100644 index 00000000000..5dc67c28e8c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82596.c @@ -0,0 +1,27 @@ +/* PR tree-optimization/82596 - missing -Warray-bounds on an out-of-bounds + index into string literal + { dg-do compile } + { dg-options "-O2 -Warray-bounds" } */ + +#define SIZE_MAX __SIZE_MAX__ +#define SSIZE_MAX __PTRDIFF_MAX__ +#define SSIZE_MIN (-SSIZE_MAX - 1) + +void sink (int, ...); + +#define T(arg) sink (arg) + +void test_cststring (int i) +{ + T (""[SSIZE_MIN]); /* { dg-warning "below array bounds" "string" { xfail lp64 } } */ + T (""[SSIZE_MIN + 1]); /* { dg-warning "below array bounds" "string" } */ + T (""[-1]); /* { dg-warning "below array bounds" "string" } */ + T (""[0]); + T (""[1]); /* { dg-warning "above array bounds" "string" } */ + T ("0"[2]); /* { dg-warning "above array bounds" "string" } */ + T ("012"[2]); + T ("012"[3]); + T ("012"[4]); /* { dg-warning "above array bounds" "string" } */ + T ("0123"[SSIZE_MAX]); /* { dg-warning "above array bounds" "string" } */ + T ("0123"[SIZE_MAX]); /* { dg-warning "above array bounds" "string" } */ +} diff --git a/gcc/testsuite/gcc.dg/pr82597.c b/gcc/testsuite/gcc.dg/pr82597.c new file mode 100644 index 00000000000..98ae264d1c9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82597.c @@ -0,0 +1,40 @@ +/* PR rtl-optimization/82597 */ +/* { dg-do compile }*/ +/* { dg-options "-O2 -funroll-loops" } */ + +int pb; + +void +ch (unsigned char np, char fc) +{ + unsigned char *y6 = &np; + + if (fc != 0) + { + unsigned char *z1 = &np; + + for (;;) + if (*y6 != 0) + for (fc = 0; fc < 12; ++fc) + { + int hh; + int tp; + + if (fc != 0) + hh = (*z1 != 0) ? fc : 0; + else + hh = pb; + + tp = fc > 0; + if (hh == tp) + *y6 = 1; + } + } + + if (np != 0) + y6 = (unsigned char *)&fc; + if (pb != 0 && *y6 != 0) + for (;;) + { + } +} diff --git a/gcc/testsuite/gcc.dg/pr82703.c b/gcc/testsuite/gcc.dg/pr82703.c new file mode 100644 index 00000000000..0bd2f91eea4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82703.c @@ -0,0 +1,28 @@ +/* PR target/82703 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-tree-sra -ftree-vectorize" } */ + +__attribute__((noinline, noclone)) void +compare (const double *p, const double *q) +{ + for (int i = 0; i < 3; ++i) + if (p[i] != q[i]) + __builtin_abort (); +} + +double vr[3] = { 4, 4, 4 }; + +int +main () +{ + double v1[3] = { 1, 2, 3 }; + double v2[3] = { 3, 2, 1 }; + double v3[3]; + __builtin_memcpy (v3, v1, sizeof (v1)); + for (int i = 0; i < 3; ++i) + v3[i] += v2[i]; + for (int i = 0; i < 3; ++i) + v1[i] += v2[i]; + compare (v3, vr); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr82765.c b/gcc/testsuite/gcc.dg/pr82765.c new file mode 100644 index 00000000000..dde0aeba7ef --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82765.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -w" } */ + +int a[1][1]; +int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; } diff --git a/gcc/testsuite/gcc.dg/pr82809.c b/gcc/testsuite/gcc.dg/pr82809.c new file mode 100644 index 00000000000..9f74ee86534 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82809.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -fno-tree-dominator-opts" } */ + +struct locale_time_t +{ + const char *abday[7]; + const unsigned int *wabday[7]; +}; + +static const unsigned int empty_wstr[1] = { 0 }; + +void +time_read (struct locale_time_t *time) +{ + int cnt; + + for (cnt=0; cnt < 7; cnt++) + { + time->abday[cnt] = ""; + time->wabday[cnt] = empty_wstr; + } +} diff --git a/gcc/testsuite/gcc.dg/spellcheck-typenames.c b/gcc/testsuite/gcc.dg/spellcheck-typenames.c index f3b8102d5a4..3717ad89f1b 100644 --- a/gcc/testsuite/gcc.dg/spellcheck-typenames.c +++ b/gcc/testsuite/gcc.dg/spellcheck-typenames.c @@ -100,8 +100,9 @@ baz value; /* { dg-error "1: unknown type name .baz.; use .enum. keyword to refe { dg-end-multiline-output "" } */ /* TODO: it would be better to detect the "singed" vs "signed" typo here. */ -singed char ch; /* { dg-error "8: before .char." } */ +singed char ch; /* { dg-error "7: before .char." } */ /* { dg-begin-multiline-output "" } singed char ch; - ^~~~ + ^~~~~ + ; { dg-end-multiline-output "" } */ diff --git a/gcc/testsuite/gcc.dg/store_merging_10.c b/gcc/testsuite/gcc.dg/store_merging_10.c new file mode 100644 index 00000000000..440f6e1f6c3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/store_merging_10.c @@ -0,0 +1,56 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target store_merge } */ +/* { dg-options "-O2 -fdump-tree-store-merging" } */ + +struct S { + unsigned int b1:1; + unsigned int b2:1; + unsigned int b3:1; + unsigned int b4:1; + unsigned int b5:1; + unsigned int b6:27; +}; + +struct T { + unsigned int b1:1; + unsigned int b2:16; + unsigned int b3:14; + unsigned int b4:1; +}; + +__attribute__((noipa)) void +foo (struct S *x) +{ + x->b1 = 1; + x->b2 = 0; + x->b3 = 1; + x->b4 = 1; + x->b5 = 0; +} + +__attribute__((noipa)) void +bar (struct T *x) +{ + x->b1 = 1; + x->b2 = 0; + x->b4 = 0; +} + +struct S s = { 0, 1, 0, 0, 1, 0x3a5f05a }; +struct T t = { 0, 0xf5af, 0x3a5a, 1 }; + +int +main () +{ + asm volatile ("" : : : "memory"); + foo (&s); + bar (&t); + asm volatile ("" : : : "memory"); + if (s.b1 != 1 || s.b2 != 0 || s.b3 != 1 || s.b4 != 1 || s.b5 != 0 || s.b6 != 0x3a5f05a) + __builtin_abort (); + if (t.b1 != 1 || t.b2 != 0 || t.b3 != 0x3a5a || t.b4 != 0) + __builtin_abort (); + return 0; +} + +/* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/store_merging_11.c b/gcc/testsuite/gcc.dg/store_merging_11.c new file mode 100644 index 00000000000..399538e522e --- /dev/null +++ b/gcc/testsuite/gcc.dg/store_merging_11.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target store_merge } */ +/* { dg-options "-O2 -fdump-tree-store-merging" } */ + +struct S { unsigned char b[2]; unsigned short c; unsigned char d[4]; unsigned long e; }; + +__attribute__((noipa)) void +foo (struct S *p) +{ + p->b[1] = 1; + p->c = 23; + p->d[0] = 4; + p->d[1] = 5; + p->d[2] = 6; + p->d[3] = 7; + p->e = 8; +} + +__attribute__((noipa)) void +bar (struct S *p) +{ + p->b[1] = 9; + p->c = 112; + p->d[0] = 10; + p->d[1] = 11; +} + +struct S s = { { 30, 31 }, 32, { 33, 34, 35, 36 }, 37 }; + +int +main () +{ + asm volatile ("" : : : "memory"); + foo (&s); + asm volatile ("" : : : "memory"); + if (s.b[0] != 30 || s.b[1] != 1 || s.c != 23 || s.d[0] != 4 || s.d[1] != 5 + || s.d[2] != 6 || s.d[3] != 7 || s.e != 8) + __builtin_abort (); + bar (&s); + asm volatile ("" : : : "memory"); + if (s.b[0] != 30 || s.b[1] != 9 || s.c != 112 || s.d[0] != 10 || s.d[1] != 11 + || s.d[2] != 6 || s.d[3] != 7 || s.e != 8) + __builtin_abort (); + return 0; +} + +/* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/store_merging_12.c b/gcc/testsuite/gcc.dg/store_merging_12.c new file mode 100644 index 00000000000..67f23449e93 --- /dev/null +++ b/gcc/testsuite/gcc.dg/store_merging_12.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wall" } */ + +struct S { unsigned int b1:1, b2:1, b3:1, b4:1, b5:1, b6:27; }; +void bar (struct S *); +void foo (int x) +{ + struct S s; + s.b2 = 1; s.b3 = 0; s.b4 = 1; s.b5 = 0; s.b1 = x; s.b6 = x; /* { dg-bogus "is used uninitialized in this function" } */ + bar (&s); +} diff --git a/gcc/testsuite/gcc.dg/store_merging_13.c b/gcc/testsuite/gcc.dg/store_merging_13.c new file mode 100644 index 00000000000..d4e9ad2d260 --- /dev/null +++ b/gcc/testsuite/gcc.dg/store_merging_13.c @@ -0,0 +1,157 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target store_merge } */ +/* { dg-options "-O2 -fdump-tree-store-merging" } */ + +struct S { unsigned char a, b; unsigned short c; unsigned char d, e, f, g; unsigned long long h; }; + +__attribute__((noipa)) void +f1 (struct S *p) +{ + p->a = 1; + p->b = 2; + p->c = 3; + p->d = 4; + p->e = 5; + p->f = 6; + p->g = 7; +} + +__attribute__((noipa)) void +f2 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = q->a; + p->b = q->b; + p->c = q->c; + p->d = q->d; + p->e = q->e; + p->f = q->f; + p->g = q->g; +} + +__attribute__((noipa)) void +f3 (struct S *p, struct S *q) +{ + unsigned char pa = q->a; + unsigned char pb = q->b; + unsigned short pc = q->c; + unsigned char pd = q->d; + unsigned char pe = q->e; + unsigned char pf = q->f; + unsigned char pg = q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +__attribute__((noipa)) void +f4 (struct S *p, struct S *q) +{ + unsigned char pa = p->a | q->a; + unsigned char pb = p->b | q->b; + unsigned short pc = p->c | q->c; + unsigned char pd = p->d | q->d; + unsigned char pe = p->e | q->e; + unsigned char pf = p->f | q->f; + unsigned char pg = p->g | q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +__attribute__((noipa)) void +f5 (struct S *p, struct S *q) +{ + unsigned char pa = p->a & q->a; + unsigned char pb = p->b & q->b; + unsigned short pc = p->c & q->c; + unsigned char pd = p->d & q->d; + unsigned char pe = p->e & q->e; + unsigned char pf = p->f & q->f; + unsigned char pg = p->g & q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +__attribute__((noipa)) void +f6 (struct S *p, struct S *q) +{ + unsigned char pa = p->a ^ q->a; + unsigned char pb = p->b ^ q->b; + unsigned short pc = p->c ^ q->c; + unsigned char pd = p->d ^ q->d; + unsigned char pe = p->e ^ q->e; + unsigned char pf = p->f ^ q->f; + unsigned char pg = p->g ^ q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +struct S s = { 20, 21, 22, 23, 24, 25, 26, 27 }; +struct S t = { 0x71, 0x72, 0x7f04, 0x78, 0x31, 0x32, 0x34, 0xf1f2f3f4f5f6f7f8ULL }; +struct S u = { 28, 29, 30, 31, 32, 33, 34, 35 }; +struct S v = { 36, 37, 38, 39, 40, 41, 42, 43 }; + +int +main () +{ + asm volatile ("" : : : "memory"); + f1 (&s); + asm volatile ("" : : : "memory"); + if (s.a != 1 || s.b != 2 || s.c != 3 || s.d != 4 + || s.e != 5 || s.f != 6 || s.g != 7 || s.h != 27) + __builtin_abort (); + f2 (&s, &u); + asm volatile ("" : : : "memory"); + if (s.a != 28 || s.b != 29 || s.c != 30 || s.d != 31 + || s.e != 32 || s.f != 33 || s.g != 34 || s.h != 27) + __builtin_abort (); + f3 (&s, &v); + asm volatile ("" : : : "memory"); + if (s.a != 36 || s.b != 37 || s.c != 38 || s.d != 39 + || s.e != 40 || s.f != 41 || s.g != 42 || s.h != 27) + __builtin_abort (); + f4 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (36 | 0x71) || s.b != (37 | 0x72) + || s.c != (38 | 0x7f04) || s.d != (39 | 0x78) + || s.e != (40 | 0x31) || s.f != (41 | 0x32) + || s.g != (42 | 0x34) || s.h != 27) + __builtin_abort (); + f3 (&s, &u); + f5 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (28 & 0x71) || s.b != (29 & 0x72) + || s.c != (30 & 0x7f04) || s.d != (31 & 0x78) + || s.e != (32 & 0x31) || s.f != (33 & 0x32) + || s.g != (34 & 0x34) || s.h != 27) + __builtin_abort (); + f2 (&s, &v); + f6 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (36 ^ 0x71) || s.b != (37 ^ 0x72) + || s.c != (38 ^ 0x7f04) || s.d != (39 ^ 0x78) + || s.e != (40 ^ 0x31) || s.f != (41 ^ 0x32) + || s.g != (42 ^ 0x34) || s.h != 27) + __builtin_abort (); + return 0; +} + +/* { dg-final { scan-tree-dump-times "Merging successful" 6 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/store_merging_14.c b/gcc/testsuite/gcc.dg/store_merging_14.c new file mode 100644 index 00000000000..49af24951cb --- /dev/null +++ b/gcc/testsuite/gcc.dg/store_merging_14.c @@ -0,0 +1,157 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target store_merge } */ +/* { dg-options "-O2 -fdump-tree-store-merging" } */ + +struct S { unsigned int i : 8, a : 7, b : 7, j : 10, c : 15, d : 7, e : 10, f : 7, g : 9, k : 16; unsigned long long h; }; + +__attribute__((noipa)) void +f1 (struct S *p) +{ + p->a = 1; + p->b = 2; + p->c = 3; + p->d = 4; + p->e = 5; + p->f = 6; + p->g = 7; +} + +__attribute__((noipa)) void +f2 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = q->a; + p->b = q->b; + p->c = q->c; + p->d = q->d; + p->e = q->e; + p->f = q->f; + p->g = q->g; +} + +__attribute__((noipa)) void +f3 (struct S *p, struct S *q) +{ + unsigned char pa = q->a; + unsigned char pb = q->b; + unsigned short pc = q->c; + unsigned char pd = q->d; + unsigned short pe = q->e; + unsigned char pf = q->f; + unsigned short pg = q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +__attribute__((noipa)) void +f4 (struct S *p, struct S *q) +{ + unsigned char pa = p->a | q->a; + unsigned char pb = p->b | q->b; + unsigned short pc = p->c | q->c; + unsigned char pd = p->d | q->d; + unsigned short pe = p->e | q->e; + unsigned char pf = p->f | q->f; + unsigned short pg = p->g | q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +__attribute__((noipa)) void +f5 (struct S *p, struct S *q) +{ + unsigned char pa = p->a & q->a; + unsigned char pb = p->b & q->b; + unsigned short pc = p->c & q->c; + unsigned char pd = p->d & q->d; + unsigned short pe = p->e & q->e; + unsigned char pf = p->f & q->f; + unsigned short pg = p->g & q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +__attribute__((noipa)) void +f6 (struct S *p, struct S *q) +{ + unsigned char pa = p->a ^ q->a; + unsigned char pb = p->b ^ q->b; + unsigned short pc = p->c ^ q->c; + unsigned char pd = p->d ^ q->d; + unsigned short pe = p->e ^ q->e; + unsigned char pf = p->f ^ q->f; + unsigned short pg = p->g ^ q->g; + p->a = pa; + p->b = pb; + p->c = pc; + p->d = pd; + p->e = pe; + p->f = pf; + p->g = pg; +} + +struct S s = { 72, 20, 21, 73, 22, 23, 24, 25, 26, 74, 27 }; +struct S t = { 75, 0x71, 0x72, 76, 0x7f04, 0x78, 0x31, 0x32, 0x34, 77, 0xf1f2f3f4f5f6f7f8ULL }; +struct S u = { 78, 28, 29, 79, 30, 31, 32, 33, 34, 80, 35 }; +struct S v = { 81, 36, 37, 82, 38, 39, 40, 41, 42, 83, 43 }; + +int +main () +{ + asm volatile ("" : : : "memory"); + f1 (&s); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != 1 || s.b != 2 || s.j != 73 || s.c != 3 || s.d != 4 + || s.e != 5 || s.f != 6 || s.g != 7 || s.k != 74 || s.h != 27) + __builtin_abort (); + f2 (&s, &u); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != 28 || s.b != 29 || s.j != 73 || s.c != 30 || s.d != 31 + || s.e != 32 || s.f != 33 || s.g != 34 || s.k != 74 || s.h != 27) + __builtin_abort (); + f3 (&s, &v); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != 36 || s.b != 37 || s.j != 73 || s.c != 38 || s.d != 39 + || s.e != 40 || s.f != 41 || s.g != 42 || s.k != 74 || s.h != 27) + __builtin_abort (); + f4 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != (36 | 0x71) || s.b != (37 | 0x72) || s.j != 73 + || s.c != (38 | 0x7f04) || s.d != (39 | 0x78) + || s.e != (40 | 0x31) || s.f != (41 | 0x32) + || s.g != (42 | 0x34) || s.k != 74 || s.h != 27) + __builtin_abort (); + f3 (&s, &u); + f5 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != (28 & 0x71) || s.b != (29 & 0x72) || s.j != 73 + || s.c != (30 & 0x7f04) || s.d != (31 & 0x78) + || s.e != (32 & 0x31) || s.f != (33 & 0x32) + || s.g != (34 & 0x34) || s.k != 74 || s.h != 27) + __builtin_abort (); + f2 (&s, &v); + f6 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != (36 ^ 0x71) || s.b != (37 ^ 0x72) || s.j != 73 + || s.c != (38 ^ 0x7f04) || s.d != (39 ^ 0x78) + || s.e != (40 ^ 0x31) || s.f != (41 ^ 0x32) + || s.g != (42 ^ 0x34) || s.k != 74 || s.h != 27) + __builtin_abort (); + return 0; +} + +/* { dg-final { scan-tree-dump-times "Merging successful" 6 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/strict-overflow-3.c b/gcc/testsuite/gcc.dg/strict-overflow-3.c index 6215a501a72..8ef91476200 100644 --- a/gcc/testsuite/gcc.dg/strict-overflow-3.c +++ b/gcc/testsuite/gcc.dg/strict-overflow-3.c @@ -9,7 +9,7 @@ int foo (int i, int j) { - return i + 100 < j + 1000; + return i + 100 < j + 1234; } -/* { dg-final { scan-tree-dump-not "1000" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "1234" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr52451.c b/gcc/testsuite/gcc.dg/torture/pr52451.c new file mode 100644 index 00000000000..81a3d4d158d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52451.c @@ -0,0 +1,55 @@ +/* { dg-do run } */ +/* { dg-add-options ieee } */ +/* { dg-require-effective-target fenv_exceptions } */ + +#include <fenv.h> + +#define TEST_C_NOEX(CMP, S) \ + r = nan##S CMP arg##S; \ + if (fetestexcept (FE_INVALID)) \ + __builtin_abort () + +#define TEST_B_NOEX(FN, S) \ + r = __builtin_##FN (nan##S, arg##S); \ + if (fetestexcept (FE_INVALID)) \ + __builtin_abort () + +#define TEST_C_EX(CMP, S) \ + r = nan##S CMP arg##S; \ + if (!fetestexcept (FE_INVALID)) \ + __builtin_abort (); \ + feclearexcept (FE_INVALID) + +#define TEST(TYPE, S) \ + volatile TYPE nan##S = __builtin_nan##S (""); \ + volatile TYPE arg##S = 1.0##S; \ + \ + TEST_C_NOEX (==, S); \ + TEST_C_NOEX (!=, S); \ + \ + TEST_B_NOEX (isgreater, S); \ + TEST_B_NOEX (isless, S); \ + TEST_B_NOEX (isgreaterequal, S); \ + TEST_B_NOEX (islessequal, S); \ + \ + TEST_B_NOEX (islessgreater, S); \ + TEST_B_NOEX (isunordered, S); \ + \ + TEST_C_EX (>, S); \ + TEST_C_EX (<, S); \ + TEST_C_EX (>=, S); \ + TEST_C_EX (<=, S) + +int +main (void) +{ + volatile int r; + + feclearexcept (FE_INVALID); + + TEST (float, f); + TEST (double, ); + TEST (long double, l); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr82129.c b/gcc/testsuite/gcc.dg/torture/pr82129.c new file mode 100644 index 00000000000..b1161491fe6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82129.c @@ -0,0 +1,52 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-ftree-pre" } */ + +int pj; + +void +g4 (unsigned long int *bc, unsigned long int *h5) +{ + if (pj != 0) + { + int ib = 0; + + while (bc != 0) + { +m6: + for (pj = 0; pj < 2; ++pj) + pj = 0; + + while (pj != 0) + { + for (;;) + { + } + + while (ib != 0) + { + unsigned long int tv = *bc; + unsigned long int n7; + + *bc = 1; + while (*bc != 0) + { + } + +ut: + if (pj == 0) + n7 = *h5 > 0; + else + { + *h5 = tv; + n7 = *h5; + } + ib += n7; + } + } + } + + goto ut; + } + + goto m6; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr82436-2.c b/gcc/testsuite/gcc.dg/torture/pr82436-2.c new file mode 100644 index 00000000000..32eda186ff0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82436-2.c @@ -0,0 +1,45 @@ +/* { dg-do compile } */ + +enum +{ + a, b, c, d, e, f, g, h, j, k +}; + +int l; +void m (short *s) +{ + short n, o, p; + float(*q)[k]; + int r, i; + while (l > 0) + r = l; + for (;;) + { + i = 0; + for (; i < r; i++) + { + { + float ab = q[i][a]; + int i = ab; + p = i; + } + ((short *) s)[0] = p; + { + float ab = q[i][b]; + int i = ab; + o = i; + } + ((short *) s)[1] = o; + { + float ab = q[i][f]; + int i = ab; + n = i; + } + ((short *) s)[2] = n; + float ab = q[i][g]; + int i = ab; + ((short *) s)[3] = i; + s = (short *) s + 4; + } + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr82473.c b/gcc/testsuite/gcc.dg/torture/pr82473.c new file mode 100644 index 00000000000..b12de21d7db --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82473.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-ftree-vectorize" } */ + +void +zz (int x9, short int gt) +{ + if (0) + { + while (gt < 1) + { + int pz; + +k6: + for (pz = 0; pz < 3; ++pz) + x9 += gt; + ++gt; + } + } + + if (x9 != 0) + goto k6; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr82603.c b/gcc/testsuite/gcc.dg/torture/pr82603.c new file mode 100644 index 00000000000..960a48bbd3a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82603.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-ftree-loop-vectorize" } */ + +int +mr (unsigned int lf, int ms) +{ + unsigned int sw = 0; + char *cu = (char *)&ms; + + while (ms < 1) + { + if (lf == 0) + ms = 0; + else + ms = 0; + ms += ((lf > 0) && ((lf > sw) ? 1 : ++*cu)); + } + + if (lf != 0) + cu = (char *)&sw; + *cu = lf; + + return ms; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr82692.c b/gcc/testsuite/gcc.dg/torture/pr82692.c new file mode 100644 index 00000000000..254ace15ada --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82692.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-add-options ieee } */ +/* { dg-require-effective-target fenv_exceptions } */ + +#include <fenv.h> + +extern void abort (void); +extern void exit (int); + +double __attribute__ ((noinline, noclone)) +foo (double x) +{ + if (__builtin_islessequal (x, 0.0) || __builtin_isgreater (x, 1.0)) + return x + x; + return x * x; +} + +int +main (void) +{ + volatile double x = foo (__builtin_nan ("")); + if (fetestexcept (FE_INVALID)) + abort (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr82697.c b/gcc/testsuite/gcc.dg/torture/pr82697.c new file mode 100644 index 00000000000..57da8a264b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82697.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ + +__attribute__((noinline,noclone)) +void test(int *pi, long *pl, int f) +{ + *pl = 0; + + *pi = 1; + + if (f) + *pl = 2; +} + +int main() +{ + void *p = __builtin_malloc(sizeof (long)); + + test(p, p, 0); + + if (*(int *)p != 1) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr82762.c b/gcc/testsuite/gcc.dg/torture/pr82762.c new file mode 100644 index 00000000000..d4f57bc55f7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82762.c @@ -0,0 +1,46 @@ +/* { dg-do compile } */ + +int printf (const char *, ...); + +int b, c, d, e, f, g, j, k; +char h, i; +volatile int l; + +int m (int n, int o) +{ + return o < 0 || o > 1 ? n : o; +} + +int p (int n, unsigned o) +{ + return n - o; +} + +int q () +{ + char r; + int a, s, t, u, v, w; +L: + if (t) + printf ("%d", d); + u = v; + while (j) + { + while (e) + for (w = 0; w != 54; w += 6) + { + l; + s = p (u < 1, i || c); + r = s < 0 || s > 1 ? 0 : 1 >> s; + v = r; + g = h; + } + if (h) + return f; + if (u) + for (a = 0; a != 54; a += 6) + f = m (2, -(k || b)); + } + d = t; + goto L; +} diff --git a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c index fe768f9a98d..baed1e3fa78 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c @@ -1,11 +1,11 @@ /* { dg-require-effective-target freorder } */ /* { dg-require-effective-target label_values } */ /* { dg-options "-O2 -freorder-blocks-and-partition" } */ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "4000" } */ #include <stdlib.h> -#if (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 +#if __INT_MAX__ >= 2147483647 typedef unsigned int uint32; typedef signed int sint32; diff --git a/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c b/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c index dcd50241eb9..9b0dfc2dbb5 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fdump-rtl-expand-all" } */ +/* { dg-options "-O2 -fdump-ipa-profile-all" } */ int g; __attribute__((noinline)) void foo (int n) @@ -36,5 +36,5 @@ int main () return 0; } /* autofdo cannot do that precise execution numbers: */ -/* { dg-final-use-not-autofdo { scan-rtl-dump-times ";; basic block\[^\\n\]*count 4000" 2 "expand"} } */ -/* { dg-final-use-not-autofdo { scan-rtl-dump-times ";; basic block\[^\\n\]*count 2000" 1 "expand" { xfail *-*-* } } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump-times ";; basic block\[^\\n\]*count 4000" 2 "profile"} } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump-times ";; basic block\[^\\n\]*count 2000" 1 "profile"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c index 2323b7fa3e9..75d3db37ade 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c @@ -290,7 +290,7 @@ RNG (0, 6, 8, "%s%ls", "1", L"2"); /* Only conditional calls to must_not_eliminate must be made (with any probability): - { dg-final { scan-tree-dump-times "> \\\[\[0-9.\]+%\\\] \\\[count: \[0-9INV\]*\\\]:\n *must_not_eliminate" 127 "optimized" { target { ilp32 || lp64 } } } } - { dg-final { scan-tree-dump-times "> \\\[\[0-9.\]+%\\\] \\\[count: \[0-9INV\]*\\\]:\n *must_not_eliminate" 96 "optimized" { target { { ! ilp32 } && { ! lp64 } } } } } + { dg-final { scan-tree-dump-times "> \\\[local count: \[0-9INV\]*\\\]:\n *must_not_eliminate" 127 "optimized" { target { ilp32 || lp64 } } } } + { dg-final { scan-tree-dump-times "> \\\[local count: \[0-9INV\]*\\\]:\n *must_not_eliminate" 96 "optimized" { target { { ! ilp32 } && { ! lp64 } } } } } No unconditional calls to abort should be made: { dg-final { scan-tree-dump-not ";\n *must_not_eliminate" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/dump-2.c b/gcc/testsuite/gcc.dg/tree-ssa/dump-2.c index 6ae2ef5bf39..20f99c2df12 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/dump-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/dump-2.c @@ -6,4 +6,4 @@ int f(void) return 0; } -/* { dg-final { scan-tree-dump "<bb \[0-9\]> \\\[100\\\.00%\\\] \\\[count: INV\\\]:" "optimized" } } */ +/* { dg-final { scan-tree-dump "<bb \[0-9\]> \\\[local count: 10000\\\]:" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-10.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-10.c index 4097145eba6..75a8ab9b1d5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-10.c @@ -26,5 +26,5 @@ int foo (int x, int n) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 1 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-11.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-11.c index a0333fbb28c..10f3d534adc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-11.c @@ -24,5 +24,4 @@ int foo (float *x) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* Sum is wrong here, but not enough for error to be reported. */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 0 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-12.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-12.c index 535c1f0eb6c..9468c070489 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-12.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-12.c @@ -29,6 +29,5 @@ int foo (int x) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* Sum is wrong here, but not enough for error to be reported. */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 0 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c index 8badc762267..b55a533e374 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c @@ -39,4 +39,4 @@ int main1 () which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 1 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c index a517f6552e6..9249f3020b7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c @@ -43,5 +43,4 @@ void foo(const int * __restrict__ zr_in, which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* Sum is wrong here, but not enough for error to be reported. */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 0 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c index 58260dd878b..35595aa98e3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c @@ -27,4 +27,4 @@ dct_unquantize_h263_inter_c (short *block, int n, int qscale, int nCoeffs) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 1 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-8.c index 6c26c209212..c2007486500 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-8.c @@ -22,5 +22,4 @@ void test () which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* Sum is wrong here, but not enough for error to be reported. */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 0 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-9.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-9.c index 789cb6ae23a..fce181e2fee 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-9.c @@ -26,4 +26,4 @@ int foo (int x, int n) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 1 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-cd.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-cd.c index 11e142af321..4932cd75a13 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-cd.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-cd.c @@ -32,5 +32,4 @@ void foo (int *x1, int *x2, int *x3, int *x4, int *y) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* Sum is wrong here, but not enough for error to be reported. */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 0 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr56541.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr56541.c index 9682fbc15df..71d6398897a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr56541.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr56541.c @@ -29,5 +29,4 @@ void foo() which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* Sum is wrong here, but not enough for error to be reported. */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 0 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr68583.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr68583.c index b128deb4a21..6739fad9f6c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr68583.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr68583.c @@ -26,5 +26,5 @@ void foo (long *a) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 1 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-1.c index 3ba7de5e6a5..a9f4ff669f8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-1.c @@ -20,5 +20,4 @@ void foo (int a[], int b[]) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* Sum is wrong here, but not enough for error to be reported. */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 0 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-2.c index 07589fd7928..c9e7c1b96ea 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr69489-2.c @@ -21,4 +21,4 @@ foo (const char *u, const char *v, long n) which is folded by vectorizer. Both outgoing edges must have probability 100% so the resulting profile match after folding. */ /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ -/* { dg-final { scan-tree-dump-times "Invalid sum of incoming frequencies" 1 "ifcvt" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c index 4efc0a4a696..b3617f685a1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c @@ -45,5 +45,5 @@ mad_synth_mute (struct mad_synth *synth) return; } -/* { dg-final { scan-tree-dump "distributed: split to 0 loops and 4 library calls" "ldist" } } */ -/* { dg-final { scan-tree-dump-times "generated memset zero" 4 "ldist" } } */ +/* { dg-final { scan-tree-dump "Loop nest . distributed: split to 0 loops and 1 library calls" "ldist" } } */ +/* { dg-final { scan-tree-dump-times "generated memset zero" 1 "ldist" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c index 3580c65f09b..b1fd024a942 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c @@ -11,7 +11,8 @@ struct st double c[M][N]; }; -int __attribute__ ((noinline)) foo (struct st *s) +int __attribute__ ((noinline)) +foo (struct st *s) { int i, j; for (i = 0; i != M;) @@ -29,9 +30,11 @@ L2: return 0; } -int main (void) +struct st s; + +int +main (void) { - struct st s; return foo (&s); } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c new file mode 100644 index 00000000000..477d222fb3b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ + +#define M (256) +#define N (512) + +struct st +{ + int a[M][N]; + int c[M]; + int b[M][N]; +}; + +void +foo (struct st *p) +{ + for (unsigned i = 0; i < M; ++i) + { + p->c[i] = 0; + for (unsigned j = N; j > 0; --j) + { + p->a[i][j - 1] = 0; + p->b[i][j - 1] = 0; + } + } +} + +/* { dg-final { scan-tree-dump-times "Loop nest . distributed: split to 0 loops and 1 library" 1 "ldist" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_memset \\(.*, 0, 1049600\\);" 1 "ldist" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c new file mode 100644 index 00000000000..445d23d114b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ + +#define M (256) +#define N (512) + +struct st +{ + int a[M][N]; + int c[M]; + int b[M][N]; +}; + +void +foo (struct st * restrict p, struct st * restrict q) +{ + for (unsigned i = 0; i < M; ++i) + { + p->c[i] = 0; + for (unsigned j = N; j > 0; --j) + { + p->a[i][j - 1] = q->a[i][j - 1]; + p->b[i][j - 1] = 0; + } + } +} + +/* { dg-final { scan-tree-dump-times "Loop nest . distributed: split to 0 loops and 1 library" 1 "ldist" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c new file mode 100644 index 00000000000..0e843f4dd55 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ + +#define M (256) +#define N (512) + +struct st +{ + int a[M][N]; + int c[M]; + int b[M][N]; +}; + +void +foo (struct st * restrict p) +{ + for (unsigned i = 0; i < M; ++i) + { + p->c[i] = 0; + for (unsigned j = N; j > 0; --j) + { + p->b[i][j - 1] = p->a[i][j - 1]; + p->a[i][j - 1] = 0; + } + } +} + +/* { dg-final { scan-tree-dump-times "Loop nest . distributed: split to 0 loops and 3 library" 1 "ldist" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c index 0193c6e52fc..01c37a56671 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c @@ -46,7 +46,7 @@ int xxx(void) /* CRIS keeps the address in a register. */ /* m68k sometimes puts the address in a register, depending on CPU and PIC. */ -/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* } } } */ +/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* } } } */ /* { dg-final { scan-assembler-times "foo,%r" 5 { target hppa*-*-* } } } */ /* { dg-final { scan-assembler-times "= foo" 5 { target ia64*-*-* } } } */ /* { dg-final { scan-assembler-times "call\[ \t\]*_foo" 5 { target i?86-*-mingw* i?86-*-cygwin* } } } */ @@ -55,3 +55,4 @@ int xxx(void) /* { dg-final { scan-assembler-times "Jsr \\\$r" 5 { target cris-*-* } } } */ /* { dg-final { scan-assembler-times "\[jb\]sr" 5 { target fido-*-* m68k-*-* } } } */ /* { dg-final { scan-assembler-times "bra *tr,r\[1-9\]*,r21" 5 { target visium-*-* } } } */ +/* { dg-final { scan-assembler-times "(?n)\[ \t\]call\[ \t\].*\[ \t\]foo," 5 { target nvptx*-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/negneg-1.c b/gcc/testsuite/gcc.dg/tree-ssa/negneg-1.c new file mode 100644 index 00000000000..9c6c36998e5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/negneg-1.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O -frounding-math -fdump-tree-optimized-raw -Wno-psabi" } */ + +#define DEF(num, T1, T2) T2 f##num(T1 x) { \ + T1 y = -x; \ + T2 z = (T2)y; \ + return -z; \ +} +DEF(0, int, long long) +DEF(1, int, unsigned long long) +DEF(2, long long, int) +DEF(3, unsigned long long, int) +DEF(4, long long, unsigned) +DEF(5, unsigned long long, unsigned) +DEF(6, float, double) + +typedef int vec __attribute__((vector_size(4*sizeof(int)))); +typedef unsigned uvec __attribute__((vector_size(4*sizeof(int)))); +void h(vec*p,uvec*q){ + vec a = -*p; + *q = -(uvec)a; +} + +/* { dg-final { scan-tree-dump-not "negate_expr" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/negneg-2.c b/gcc/testsuite/gcc.dg/tree-ssa/negneg-2.c new file mode 100644 index 00000000000..bd6198e633b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/negneg-2.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fno-rounding-math -fdump-tree-optimized-raw" } */ + +#define DEF(num, T1, T2) T2 f##num(T1 x) { \ + T1 y = -x; \ + T2 z = (T2)y; \ + return -z; \ +} +DEF(0, double, float) + +/* { dg-final { scan-tree-dump-not "negate_expr" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/negneg-3.c b/gcc/testsuite/gcc.dg/tree-ssa/negneg-3.c new file mode 100644 index 00000000000..9deb9f6f320 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/negneg-3.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O -frounding-math -fdump-tree-optimized-raw" } */ + +// This assumes that long long is strictly larger than int + +#define DEF(num, T1, T2) T2 f##num(T1 x) { \ + T1 y = -x; \ + T2 z = (T2)y; \ + return -z; \ +} +DEF(0, unsigned, long long) +DEF(1, unsigned, unsigned long long) +DEF(2, double, float) + +/* { dg-final { scan-tree-dump-times "negate_expr" 6 "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/negneg-4.c b/gcc/testsuite/gcc.dg/tree-ssa/negneg-4.c new file mode 100644 index 00000000000..e1131d06f64 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/negneg-4.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-options "-O -fwrapv" } */ + +#define DEF(num, T1, T2) T2 f##num(T1 x) { \ + T1 y = -x; \ + T2 z = (T2)y; \ + return -z; \ +} +DEF(0, int, long long) + +int main(){ + volatile int a = -1 - __INT_MAX__; + volatile long long b = f0 (a); + volatile long long c = a; + volatile long long d = -c; + if (b != d) + __builtin_abort(); +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/noreturn-1.c b/gcc/testsuite/gcc.dg/tree-ssa/noreturn-1.c new file mode 100644 index 00000000000..ae7ee42fabc --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/noreturn-1.c @@ -0,0 +1,42 @@ +/* { dg-do compile } * +/* { dg-options "-O2 -fdump-tree-ssa -std=gnu11" } */ +/* { dg-final { scan-tree-dump-times "__builtin_unreachable" 4 "ssa" } } */ + +void bar1 (void); +void bar2 (void); +void bar3 (void); +void bar4 (void); + +_Noreturn void +foo1 (int *p, int y) +{ + bar1 (); + *p = y; + return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */ +} /* { dg-warning "'noreturn' function does return" "" { target *-*-* } .-1 } */ + +_Noreturn void +foo2 (int *p, int y) +{ + bar2 (); + *p = y; +} /* { dg-warning "'noreturn' function does return" } */ + +_Noreturn void +foo3 (int *p, int y) +{ + if (y > 10) + return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */ + bar3 (); + *p = y; + return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */ +} /* { dg-warning "'noreturn' function does return" } */ + +_Noreturn void +foo4 (int *p, int y) +{ + if (y > 10) + return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */ + bar4 (); + *p = y; +} /* { dg-warning "'noreturn' function does return" } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr82574.c b/gcc/testsuite/gcc.dg/tree-ssa/pr82574.c new file mode 100644 index 00000000000..8fc459631ef --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82574.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-options "-O3" } */ + +unsigned char a, b, c, d[200][200]; + +void abort (void); + +int main () +{ + for (; a < 200; a++) + for (b = 0; b < 200; b++) + if (c) + d[a][b] = 1; + + if ((c && d[0][0] != 1) || (!c && d[0][0] != 0)) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c index c9feb256857..aad41f91f47 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c @@ -10,4 +10,4 @@ int main () return 0; } -/* { dg-final { scan-tree-dump "<bb 2> \\\[\[0-9.\]+%\\\] \\\[count: \[0-9INV\]*\\\]:\[\n\r \]*return 0;" "optimized" } } */ +/* { dg-final { scan-tree-dump "<bb 2> \\\[\[0-9.\]+%\\\] \\\[count: \[0-9INV\]*\\\]:\[\n\r \]*return 0;" "optimized" { xfail aarch64*-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/ubsan/float-cast-overflow-bf.c b/gcc/testsuite/gcc.dg/ubsan/float-cast-overflow-bf.c index 16268603375..538d900b0ab 100644 --- a/gcc/testsuite/gcc.dg/ubsan/float-cast-overflow-bf.c +++ b/gcc/testsuite/gcc.dg/ubsan/float-cast-overflow-bf.c @@ -48,25 +48,25 @@ main (void) return 0; } -/* { dg-output "value -2.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 2.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -2.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "\[^\n\r]*value 2.5 is outside the range of representable values of type" } */ +/* { dg-output " -2.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 2.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -2.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 2 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ +/* { dg-output "\[^\n\r]* 2.5 is outside the range of representable values of type" } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c index cc04959d187..91eb28218bd 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c @@ -45,6 +45,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target vect_1_size } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target vect_2_sizes } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 3 "vect" { target vect_3_sizes } } } */ +/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c index f32561dc4fd..51f62788dbf 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c @@ -50,6 +50,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target vect_1_size } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_2_sizes } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 3 "vect" { target vect_3_sizes } } } */ +/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c index 79a6ee45f7a..581438823fd 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c @@ -50,6 +50,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target vect_1_size } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_2_sizes } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 3 "vect" { target vect_3_sizes } } } */ +/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c index d0673e93fb2..6f4c84b4cd2 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c @@ -58,6 +58,5 @@ int main (void) If/when the aliasing problems are resolved, unalignment may prevent vectorization on some targets. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target vect_1_size } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 4 "vect" { target vect_2_sizes } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 6 "vect" { target vect_3_sizes } } } */ +/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c index 232d8e526ed..6e9ddcfa5ce 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c @@ -46,6 +46,5 @@ int main (void) If/when the aliasing problems are resolved, unalignment may prevent vectorization on some targets. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target vect_1_size } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target vect_2_sizes } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 3 "vect" { target vect_3_sizes } } } */ +/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr25413a.c b/gcc/testsuite/gcc.dg/vect/pr25413a.c index 36e786f4f7d..a80ca868112 100644 --- a/gcc/testsuite/gcc.dg/vect/pr25413a.c +++ b/gcc/testsuite/gcc.dg/vect/pr25413a.c @@ -124,5 +124,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } xfail { vect_element_align_preferred } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } xfail { vect_element_align_preferred } } } } */ +/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr31699.c b/gcc/testsuite/gcc.dg/vect/pr31699.c index c73d11a224e..b0b9971fcfc 100644 --- a/gcc/testsuite/gcc.dg/vect/pr31699.c +++ b/gcc/testsuite/gcc.dg/vect/pr31699.c @@ -7,9 +7,9 @@ float x[256]; __attribute__ ((noinline)) -double *foo(void) +float *foo(void) { - double *z = malloc (sizeof(double) * 256); + float *z = malloc (sizeof(float) * 256); int i; for (i=0; i<256; ++i) @@ -34,5 +34,5 @@ int main() } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_intfloat_cvt } } } */ -/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } xfail { vect_element_align_preferred } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } xfail { vect_element_align_preferred } } } } */ +/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr45752.c b/gcc/testsuite/gcc.dg/vect/pr45752.c index 22a398f0acc..755205b275a 100644 --- a/gcc/testsuite/gcc.dg/vect/pr45752.c +++ b/gcc/testsuite/gcc.dg/vect/pr45752.c @@ -103,8 +103,8 @@ int main (int argc, const char* argv[]) 26776, 9542, 363804, 169059, 25853, 36596, 12962, 503404, 224634, 35463 }; #else - unsigned int check_results[N]; - unsigned int check_results2[N]; + volatile unsigned int check_results[N]; + volatile unsigned int check_results2[N]; for (i = 0; i < N / 5; i++) { @@ -140,7 +140,7 @@ int main (int argc, const char* argv[]) check_results2[i * 5 + 4] = (M40 * a + M41 * b + M42 * c + M43 * d + M44 * e); - asm volatile (""); + asm volatile ("" ::: "memory"); } #endif diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-5.c b/gcc/testsuite/gcc.dg/vect/pr65947-5.c index 3e34b7a2644..709f17f80a4 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-5.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-5.c @@ -37,7 +37,7 @@ main (void) for (int i = 32; i < N; ++i) { a[i] = 70 + (i & 3); - asm volatile (""); + asm volatile ("" ::: "memory"); } check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c index b5aaa924bb2..e3466d0da1d 100644 --- a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c +++ b/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c @@ -120,4 +120,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_int } } } */ /* Alignment forced using versioning until the pass that increases alignment is extended to handle structs. */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target { vect_int && { ! vector_alignment_reachable } } xfail { vect_element_align_preferred } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target {vect_int && {! vector_alignment_reachable} } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-19c.c b/gcc/testsuite/gcc.dg/vect/slp-19c.c index de47f7760c4..cda6a096332 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-19c.c +++ b/gcc/testsuite/gcc.dg/vect/slp-19c.c @@ -21,7 +21,7 @@ main1 () for (unsigned int i = 0; i < N * 8; ++i) { in[i] = i & 63; - asm volatile (""); + asm volatile ("" ::: "memory"); } #endif unsigned int ia[N*2], a0, a1, a2, a3; diff --git a/gcc/testsuite/gcc.dg/vect/slp-23.c b/gcc/testsuite/gcc.dg/vect/slp-23.c index 8dd95528cae..88708e645d6 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-23.c +++ b/gcc/testsuite/gcc.dg/vect/slp-23.c @@ -107,6 +107,8 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided8 && { ! { vect_no_align} } } } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided8 || vect_no_align } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_any_perm } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_any_perm xfail vect_variable_length } } } */ +/* We fail to vectorize the second loop with variable-length SVE but + fall back to 128-bit vectors, which does use SLP. */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_perm } xfail aarch64_sve } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-28.c b/gcc/testsuite/gcc.dg/vect/slp-28.c index d9f50d1c097..4211b94ad7f 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-28.c +++ b/gcc/testsuite/gcc.dg/vect/slp-28.c @@ -57,7 +57,8 @@ main1 () abort (); } - /* Vectorizable with a fully-masked loop or if VF==8. */ + /* Not vectorizable because of data dependencies: distance 3 is greater than + the actual VF with SLP (2), but the analysis fail to detect that for now. */ for (i = 3; i < N/4; i++) { in3[i*4] = in3[(i-3)*4] + 5; diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-1.c b/gcc/testsuite/gcc.dg/vect/slp-perm-1.c index 9a0835575d3..6bd16ef43b0 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-1.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-1.c @@ -51,7 +51,7 @@ int main (int argc, const char* argv[]) #if N == 16 unsigned int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; #else - unsigned int check_results[N] = {}; + volatile unsigned int check_results[N] = {}; for (unsigned int i = 0; i < N / 3; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-4.c b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c index a706f1792f5..3a4420c53e4 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-4.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c @@ -70,15 +70,15 @@ int main (int argc, const char* argv[]) { input[i] = i%256; output[i] = 0; - __asm__ volatile (""); + asm volatile ("" ::: "memory"); } #if N == 20 unsigned int check_results[N] - = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, + = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, 22848, 8174, 307964, 146829, 22009, 32668, 11594, 447564, 202404, 31619}; #else - unsigned int check_results[N]; + volatile unsigned int check_results[N]; for (i = 0; i < N / 5; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-5.c b/gcc/testsuite/gcc.dg/vect/slp-perm-5.c index edd36ab5255..52939133ca8 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-5.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-5.c @@ -72,8 +72,8 @@ int main (int argc, const char* argv[]) int check_results2[N] = { 4322, 135, 13776, 629, 23230, 1123, 32684, 1617, 42138, 2111, 0, 0, 0, 0, 0, 0 }; #else - int check_results[N] = {}; - int check_results2[N] = {}; + volatile int check_results[N] = {}; + volatile int check_results2[N] = {}; for (int i = 0; i < N / 3; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-6.c b/gcc/testsuite/gcc.dg/vect/slp-perm-6.c index e44ab555d98..4eb648ac71b 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-6.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-6.c @@ -71,8 +71,8 @@ int main (int argc, const char* argv[]) int check_results2[N] = { 0, 112, 810, 336, 1620, 560, 2430, 784, 3240, 1008, 0, 0, 0, 0, 0, 0 }; #else - int check_results[N] = {}; - int check_results2[N] = {}; + volatile int check_results[N] = {}; + volatile int check_results2[N] = {}; for (int i = 0; i < N / 3; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-7.c b/gcc/testsuite/gcc.dg/vect/slp-perm-7.c index bc06a78d2e5..baf7f7888a3 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-7.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-7.c @@ -66,8 +66,8 @@ int main (int argc, const char* argv[]) int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; int check_results2[N] = {0, 405, 810, 1215, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #else - int check_results[N] = {}; - int check_results2[N] = {}; + volatile int check_results[N] = {}; + volatile int check_results2[N] = {}; for (int i = 0; i < N / 3; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c index c94125f5fb4..94d4455dfd9 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c @@ -31,11 +31,7 @@ int main (int argc, const char* argv[]) { unsigned char input[N], output[N]; unsigned char check_results[N]; -#if N < 256 - unsigned char i; -#else unsigned int i; -#endif check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c index ad0832348dc..b01d493b6e7 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c @@ -37,7 +37,7 @@ int main (int argc, const char* argv[]) { input[i] = i; output[i] = 0; - asm volatile (""); + asm volatile ("" ::: "memory"); } for (i = 0; i < N / 3; i++) diff --git a/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c b/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c index d68687930de..5121414260b 100644 --- a/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c +++ b/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c @@ -47,10 +47,8 @@ int main (void) } /* 2 for the first loop. */ -/* { dg-final { scan-tree-dump-times "Detected reduction\\." 3 "vect" { target { vect_1_size } } } } */ -/* { dg-final { scan-tree-dump-times "Detected reduction\\." 4 "vect" { target { vect_2_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "Detected reduction\\." 5 "vect" { target { vect_3_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "not vectorized" 1 "vect" { target vect_1_size } } } */ -/* { dg-final { scan-tree-dump-times "not vectorized" 2 "vect" { target vect_2_sizes } } } */ -/* { dg-final { scan-tree-dump-times "not vectorized" 3 "vect" { target vect_3_sizes } } } */ +/* { dg-final { scan-tree-dump-times "Detected reduction\\." 3 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "Detected reduction\\." "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "not vectorized" 1 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "not vectorized" "vect" { target vect_multiple_sizes } } } */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! vect_no_int_min_max } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-104.c b/gcc/testsuite/gcc.dg/vect/vect-104.c index f86043e6231..a77c98735eb 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-104.c +++ b/gcc/testsuite/gcc.dg/vect/vect-104.c @@ -62,6 +62,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target vect_1_size } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_2_sizes } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 3 "vect" { target vect_3_sizes } } } */ +/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */ +/* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c index 566cc8f7ab3..9a507105899 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-109.c +++ b/gcc/testsuite/gcc.dg/vect/vect-109.c @@ -76,5 +76,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_element_align } } } */ /* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_element_align } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target { vect_element_align } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! vect_unaligned_possible } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-33.c b/gcc/testsuite/gcc.dg/vect/vect-33.c index af5aefa2455..e215052ff77 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-33.c +++ b/gcc/testsuite/gcc.dg/vect/vect-33.c @@ -37,6 +37,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump "Vectorizing an unaligned access" "vect" { target { { { ! powerpc*-*-* } && vect_hw_misalign } && { ! { vect64 && vect_1_size } } } xfail { ! vect_unaligned_possible } } } } */ -/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" { target { vector_alignment_reachable && { vect64 && vect_1_size } } } } } */ +/* { dg-final { scan-tree-dump "Vectorizing an unaligned access" "vect" { target { { { ! powerpc*-*-* } && vect_hw_misalign } && { { ! vect64 } || vect_multiple_sizes } } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" { target { vector_alignment_reachable && { vect64 && {! vect_multiple_sizes} } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { {! vector_alignment_reachable} || {! vect64} } && {! vect_hw_misalign} } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-42.c b/gcc/testsuite/gcc.dg/vect/vect-42.c index 55adfc93df3..a65b4a62276 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-42.c +++ b/gcc/testsuite/gcc.dg/vect/vect-42.c @@ -67,5 +67,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_element_align } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target { vect_element_align } xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-44.c b/gcc/testsuite/gcc.dg/vect/vect-44.c index 96dab0ac03e..03ef2c0f671 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-44.c +++ b/gcc/testsuite/gcc.dg/vect/vect-44.c @@ -66,6 +66,6 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! vect_unaligned_possible } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { { ! vector_alignment_reachable } && { ! vect_element_align_preferred } } } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {{! vect_no_align} && {! vect_hw_misalign} } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-50.c b/gcc/testsuite/gcc.dg/vect/vect-50.c index e11036bf130..c9500ca91e5 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-50.c +++ b/gcc/testsuite/gcc.dg/vect/vect-50.c @@ -62,6 +62,6 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! vect_unaligned_possible } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { { ! vector_alignment_reachable } && { ! vect_element_align_preferred } } } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && { {! vect_no_align } && {! vect_hw_misalign } } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c index 673ab23a2b4..8060b05e781 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-56.c +++ b/gcc/testsuite/gcc.dg/vect/vect-56.c @@ -70,5 +70,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_element_align } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } xfail { ! vect_unaligned_possible } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { ! vect_element_align } xfail { vect_element_align_preferred } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align } xfail { vect_element_align_preferred } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { { ! vect_element_align } || vect_element_align_preferred} } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align && { ! vect_element_align_preferred } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c index 9dcfd85ce9c..3b7477c96ab 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-60.c +++ b/gcc/testsuite/gcc.dg/vect/vect-60.c @@ -71,5 +71,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_element_align } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } xfail { ! vect_unaligned_possible } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { ! vect_element_align } xfail { vect_element_align_preferred } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align } xfail { vect_element_align_preferred } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { { ! vect_element_align } || vect_element_align_preferred } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align && { ! vect_element_align_preferred } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc/testsuite/gcc.dg/vect/vect-70.c index 8f212571693..793dbfb7481 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-70.c +++ b/gcc/testsuite/gcc.dg/vect/vect-70.c @@ -12,6 +12,7 @@ #define N (NINTS * 6) +/* Keep execution time down. */ #if N <= 24 #define OUTERN N #else @@ -30,6 +31,7 @@ struct test1{ struct s e[N]; /* array e.n is aligned */ }; +/* Avoid big local temporaries. */ #if NINTS > 8 struct test1 tmp1; #endif diff --git a/gcc/testsuite/gcc.dg/vect/vect-91.c b/gcc/testsuite/gcc.dg/vect/vect-91.c index ffa95b71d24..9430da3290a 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-91.c +++ b/gcc/testsuite/gcc.dg/vect/vect-91.c @@ -7,13 +7,14 @@ #define N 256 +/* Pick a value greater than the vector length. */ #if VECTOR_BITS > 128 #define OFF (VECTOR_BITS * 5 / 32) #else #define OFF 20 #endif -extern int a[N+OFF]; +extern int a[N + OFF]; /* The alignment of 'pa' is unknown. Yet we do know that both the read access and write access have @@ -58,7 +59,7 @@ main3 () for (i = 0; i < N; i++) { - a[i] = a[i+OFF]; + a[i] = a[i + OFF]; } return 0; diff --git a/gcc/testsuite/gcc.dg/vect/vect-96.c b/gcc/testsuite/gcc.dg/vect/vect-96.c index c72595f97b8..0cb935b9f16 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-96.c +++ b/gcc/testsuite/gcc.dg/vect/vect-96.c @@ -48,7 +48,7 @@ int main (void) For targets that don't support unaligned loads, version for the store. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && { ! vect_align_stack_vars } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && vect_align_stack_vars } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && { ! vect_align_stack_vars } } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c index 9f96601e4a7..378a5fe642a 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c @@ -90,5 +90,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { { ! vect_unaligned_possible } || vect_sizes_32B_16B } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { { ! vect_unaligned_possible } || vect_sizes_32B_16B } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target { vect_no_align && { { ! vect_hw_misalign } && vect_sizes_32B_16B } } }} } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-peel-3.c b/gcc/testsuite/gcc.dg/vect/vect-peel-3.c index 231c13dfc28..d5c0cf10ce1 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-peel-3.c +++ b/gcc/testsuite/gcc.dg/vect/vect-peel-3.c @@ -6,7 +6,7 @@ #if VECTOR_BITS > 128 #define NINTS (VECTOR_BITS / 32) -#define EXTRA NINTS * 2 +#define EXTRA (NINTS * 2) #else #define NINTS 4 #define EXTRA 10 diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c index dc4f52019d5..ac674749b6f 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c @@ -1,4 +1,7 @@ /* { dg-require-effective-target vect_int } */ +/* { dg-require-effective-target arm_v8_2a_dotprod_neon_hw { target { aarch64*-*-* || arm*-*-* } } } */ +/* { dg-additional-options "-march=armv8.2-a+dotprod" { target { aarch64*-*-* } } } */ +/* { dg-add-options arm_v8_2a_dotprod_neon } */ #include <stdarg.h> #include "tree-vect.h" diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c index f3cc6c78c25..d020f643bb8 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c @@ -1,4 +1,7 @@ /* { dg-require-effective-target vect_int } */ +/* { dg-require-effective-target arm_v8_2a_dotprod_neon_hw { target { aarch64*-*-* || arm*-*-* } } } */ +/* { dg-additional-options "-march=armv8.2-a+dotprod" { target { aarch64*-*-* } } } */ +/* { dg-add-options arm_v8_2a_dotprod_neon } */ #include <stdarg.h> #include "tree-vect.h" |