diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-11 11:13:27 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-11 11:13:27 +0000 |
commit | c41143fb1d63596ff2a0f6da741b4bae73b8be16 (patch) | |
tree | d70c0763693cfef7bc877f21e079986944261a5f /gcc/testsuite/gcc.dg | |
parent | eb0badc13724022c8828a55e516d0eecdc487cc3 (diff) | |
download | gcc-c41143fb1d63596ff2a0f6da741b4bae73b8be16.tar.gz |
2011-05-11 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 173647 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@173652 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
305 files changed, 3851 insertions, 1957 deletions
diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c index bf8225a1a6b..0689636b2da 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -58,6 +58,8 @@ extern void abort (void); # else # define PIC_REG "30" # endif +#elif defined(__RX__) +/* No pic register. */ #elif defined(__s390__) # define PIC_REG "12" #elif defined(__sparc__) diff --git a/gcc/testsuite/gcc.dg/Waddress.c b/gcc/testsuite/gcc.dg/Waddress.c new file mode 100644 index 00000000000..146b1a932df --- /dev/null +++ b/gcc/testsuite/gcc.dg/Waddress.c @@ -0,0 +1,10 @@ +/* PR c/36299 */ +/* { dg-do compile } */ +/* { dg-options "-Waddress" } */ + +int +foo(void) +{ + char a[1]; + return a == 0; +} diff --git a/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c new file mode 100644 index 00000000000..45373bc1a98 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c @@ -0,0 +1,47 @@ +/* -Woverlength-strings complains about string constants which are too long + for the C standard's "minimum maximum" limits. It is off by default, + but implied by -pedantic. */ + +/* { dg-options "-std=c89 -pedantic" } */ + +#define TEN " " +#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN +#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN + +/* C89's minimum-maximum is 509. */ +__asm__ (HUN HUN HUN HUN HUN TEN); + +/* C99's minimum-maximum is 4095. */ +__asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"); + +void +f (void) +{ + /* C89's minimum-maximum is 509. */ + __asm__ (HUN HUN HUN HUN HUN TEN); + __asm__ (HUN HUN HUN HUN HUN TEN : : ); + __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label); + + /* C99's minimum-maximum is 4095. */ + __asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"); + __asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456" : : ); + __asm__ goto ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456" : : : : label); + + label: ; +} diff --git a/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c new file mode 100644 index 00000000000..09b8079d553 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c @@ -0,0 +1,19 @@ +/* -Woverlength-strings complains about string constants which are too long + for the C standard's "minimum maximum" limits. It is off by default, + but implied by -pedantic. */ + +/* { dg-options "-std=c89 -pedantic" } */ + +#define TEN "xxxxxxxxxx" +#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN +#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN + +/* C89's minimum-maximum is 509. */ +const char x510[] = __extension__ HUN HUN HUN HUN HUN TEN; + +/* C99's minimum-maximum is 4095. */ +const char x4096[] = __extension__ + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"; diff --git a/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c new file mode 100644 index 00000000000..b5523bc8906 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c @@ -0,0 +1,48 @@ +/* -Woverlength-strings complains about string constants which are too long + for the C standard's "minimum maximum" limits. It is off by default, + but implied by -pedantic. */ + +/* { dg-options "-std=c90 -pedantic" } */ + +#define TEN " " +#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN +#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN + +/* C89's minimum-maximum is 509. */ +__asm__ (HUN HUN HUN HUN HUN TEN); + +/* C99's minimum-maximum is 4095. */ +__asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"); + +void +f (void) +{ + /* C89's minimum-maximum is 509. */ + __asm__ (HUN HUN HUN HUN HUN TEN); + __asm__ (HUN HUN HUN HUN HUN TEN : :); + __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label); + + /* C99's minimum-maximum is 4095. */ + __asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"); + __asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456" : :); + __asm__ goto ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456" : : : : label); + + label: ; +} + diff --git a/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c new file mode 100644 index 00000000000..6fbaebef341 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c @@ -0,0 +1,19 @@ +/* -Woverlength-strings complains about string constants which are too long + for the C standard's "minimum maximum" limits. It is off by default, + but implied by -pedantic. */ + +/* { dg-options "-std=c90 -pedantic" } */ + +#define TEN "xxxxxxxxxx" +#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN +#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN + +/* C89's minimum-maximum is 509. */ +const char x510[] = __extension__ HUN HUN HUN HUN HUN TEN; + +/* C99's minimum-maximum is 4095. */ +const char x4096[] = __extension__ + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"; diff --git a/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c new file mode 100644 index 00000000000..8840e38bdc4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c @@ -0,0 +1,48 @@ +/* -Woverlength-strings complains about string constants which are too long + for the C standard's "minimum maximum" limits. It is off by default, + but implied by -pedantic. */ + +/* { dg-options "-std=c99 -pedantic" } */ + +#define TEN " " +#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN +#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN + +/* C89's minimum-maximum is 509. */ +__asm__ (HUN HUN HUN HUN HUN TEN); + +/* C99's minimum-maximum is 4095. */ +__asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"); + +void +f (void) +{ + /* C89's minimum-maximum is 509. */ + __asm__ (HUN HUN HUN HUN HUN TEN); + __asm__ (HUN HUN HUN HUN HUN TEN : :); + __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label); + + /* C99's minimum-maximum is 4095. */ + __asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"); + __asm__ ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456" : :); + __asm__ goto ( + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456" : : : : label); + + label: ; +} + diff --git a/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c new file mode 100644 index 00000000000..93d5e4600fc --- /dev/null +++ b/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c @@ -0,0 +1,19 @@ +/* -Woverlength-strings complains about string constants which are too long + for the C standard's "minimum maximum" limits. It is off by default, + but implied by -pedantic. */ + +/* { dg-options "-std=c99 -pedantic" } */ + +#define TEN "xxxxxxxxxx" +#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN +#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN + +/* C89's minimum-maximum is 509. */ +const char x510[] = HUN HUN HUN HUN HUN TEN; + +/* C99's minimum-maximum is 4095. */ +const char x4096[] = __extension__ + THO THO THO THO /* 4000 */ + TEN TEN TEN TEN TEN /* 4050 */ + TEN TEN TEN TEN /* 4090 */ + "123456"; diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-23.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-23.c new file mode 100644 index 00000000000..16014bb15c5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-23.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wstrict-overflow" } */ + +unsigned int +do_scrolling (unsigned int window_size, unsigned int writecost) +{ + unsigned int i = window_size; + + int terminal_window_p = 0; + unsigned int queue = 0; + + for (i = window_size; i; i--) + { + if (writecost < i) + ++queue; + else if (writecost & 1) + terminal_window_p = 1; + } + + if (queue > 0) + { + if (!terminal_window_p) + { + terminal_window_p = 1; + } + } + + if (terminal_window_p) + return 100; + return 0; +} diff --git a/gcc/testsuite/gcc.dg/anon-struct-11.c b/gcc/testsuite/gcc.dg/anon-struct-11.c index 1084e5bded6..c2f85fc24e4 100644 --- a/gcc/testsuite/gcc.dg/anon-struct-11.c +++ b/gcc/testsuite/gcc.dg/anon-struct-11.c @@ -50,7 +50,7 @@ struct E { struct F { char f; }; /* { dg-warning "does not declare anything" } */ char c; union { - D; + D; /* { dg-warning "does not declare anything" } */ }; char e; }; @@ -85,7 +85,7 @@ test2 (void) e.e = 5; f2 (&e); /* { dg-warning "incompatible pointer type" } */ f3 (&e); /* { dg-warning "incompatible pointer type" } */ - if (e.d != 4) + if (e.d != 4) /* { dg-error "no member" } */ abort (); if (e.f != 6) /* { dg-error "no member" } */ abort (); diff --git a/gcc/testsuite/gcc.dg/binop-xor1.c b/gcc/testsuite/gcc.dg/binop-xor1.c new file mode 100644 index 00000000000..53a2ce23ab3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/binop-xor1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +int +foo (int a, int b, int c) +{ + return ((a && !b && c) || (!a && b && c)); +} + +/* We expect to see "<bb N>"; confirm that, so that we know to count + it in the real test. */ +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 5 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/binop-xor2.c b/gcc/testsuite/gcc.dg/binop-xor2.c new file mode 100644 index 00000000000..51b41dd7ff6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/binop-xor2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +int +foo (int a, int b) +{ + return ((a & ~b) | (~a & b)); +} + +/* We expect to see "<bb N>"; confirm that, so that we know to count + it in the real test. */ +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/binop-xor3.c b/gcc/testsuite/gcc.dg/binop-xor3.c new file mode 100644 index 00000000000..97c7888189a --- /dev/null +++ b/gcc/testsuite/gcc.dg/binop-xor3.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +int +foo (int a, int b) +{ + return ((a && !b) || (!a && b)); +} + +/* We expect to see "<bb N>"; confirm that, so that we know to count + it in the real test. */ +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/binop-xor4.c b/gcc/testsuite/gcc.dg/binop-xor4.c new file mode 100644 index 00000000000..f87950a3335 --- /dev/null +++ b/gcc/testsuite/gcc.dg/binop-xor4.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +int +foo (int a, int b, int c) +{ + return ((a & ~b) | (~a & b)) & c; +} + +/* We expect to see "<bb N>"; confirm that, so that we know to count + it in the real test. */ +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/binop-xor5.c b/gcc/testsuite/gcc.dg/binop-xor5.c new file mode 100644 index 00000000000..256c4bfa82a --- /dev/null +++ b/gcc/testsuite/gcc.dg/binop-xor5.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +int +foo (int a, int b, int c) +{ + return ((a & ~b & c) | (~a & b & c)); +} + +/* We expect to see "<bb N>"; confirm that, so that we know to count + it in the real test. */ +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\&" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/bitfld-15.c b/gcc/testsuite/gcc.dg/bitfld-15.c index 44d53b34ae2..03f43f2de8c 100644 --- a/gcc/testsuite/gcc.dg/bitfld-15.c +++ b/gcc/testsuite/gcc.dg/bitfld-15.c @@ -2,6 +2,7 @@ /* Remove pedantic. Allow the GCC extension to use char for bitfields. */ /* { dg-options "" } */ /* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */ +/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t { diff --git a/gcc/testsuite/gcc.dg/bitfld-16.c b/gcc/testsuite/gcc.dg/bitfld-16.c index 0a89bdab1ff..5ed30f74392 100644 --- a/gcc/testsuite/gcc.dg/bitfld-16.c +++ b/gcc/testsuite/gcc.dg/bitfld-16.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-Wno-packed-bitfield-compat" } */ /* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */ +/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t { diff --git a/gcc/testsuite/gcc.dg/bitfld-17.c b/gcc/testsuite/gcc.dg/bitfld-17.c index 80099c6c9a2..9512f5fdf2a 100644 --- a/gcc/testsuite/gcc.dg/bitfld-17.c +++ b/gcc/testsuite/gcc.dg/bitfld-17.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "" } */ /* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */ +/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t { diff --git a/gcc/testsuite/gcc.dg/bitfld-18.c b/gcc/testsuite/gcc.dg/bitfld-18.c index cb24c65d723..067d9ae3851 100644 --- a/gcc/testsuite/gcc.dg/bitfld-18.c +++ b/gcc/testsuite/gcc.dg/bitfld-18.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-Wno-packed-bitfield-compat" } */ /* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */ +/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t { diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-10.c b/gcc/testsuite/gcc.dg/builtin-object-size-10.c new file mode 100644 index 00000000000..6c7ed45b6e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-object-size-10.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-objsz-details" } */ + +typedef struct { + char sentinel[4]; + char data[0]; +} drone_packet; +typedef struct { + char type_str[16]; + char channel_hop; +} drone_source_packet; +drone_packet * +foo(char *x) +{ + drone_packet *dpkt = __builtin_malloc(sizeof(drone_packet) + + sizeof(drone_source_packet)); + drone_source_packet *spkt = (drone_source_packet *) dpkt->data; + __builtin___snprintf_chk (spkt->type_str, 16, + 1, __builtin_object_size (spkt->type_str, 1), + "%s", x); + return dpkt; +} + +/* { dg-final { scan-tree-dump "maximum object size 21" "objsz" } } */ +/* { dg-final { scan-tree-dump "maximum subobject size 16" "objsz" } } */ +/* { dg-final { cleanup-tree-dump "objsz" } } */ diff --git a/gcc/testsuite/gcc.dg/c1x-anon-struct-1.c b/gcc/testsuite/gcc.dg/c1x-anon-struct-1.c index 711fe65df3d..6d4b433d733 100644 --- a/gcc/testsuite/gcc.dg/c1x-anon-struct-1.c +++ b/gcc/testsuite/gcc.dg/c1x-anon-struct-1.c @@ -4,20 +4,13 @@ #include <stddef.h> -typedef struct -{ - int i; -} s0; - -typedef union -{ - int i; -} u0; - struct s1 { int a; - u0; + union + { + int i; + }; struct { int b; @@ -27,7 +20,10 @@ struct s1 union u1 { int b; - s0; + struct + { + int i; + }; union { int c; @@ -44,7 +40,10 @@ struct s2 struct s3 { - u0; + union + { + int i; + }; }; struct s4 diff --git a/gcc/testsuite/gcc.dg/c1x-anon-struct-3.c b/gcc/testsuite/gcc.dg/c1x-anon-struct-3.c new file mode 100644 index 00000000000..1841eddd0a1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c1x-anon-struct-3.c @@ -0,0 +1,34 @@ +/* Test for anonymous structures and unions in C1X. Test for invalid + cases: typedefs disallowed by N1549. */ +/* { dg-do compile } */ +/* { dg-options "-std=c1x -pedantic-errors" } */ + +typedef struct +{ + int i; +} s0; + +typedef union +{ + int i; +} u0; + +struct s1 +{ + int a; + u0; /* { dg-error "declaration does not declare anything" } */ + struct + { + int b; + }; +}; + +union u1 +{ + int b; + s0; /* { dg-error "declaration does not declare anything" } */ + union + { + int c; + }; +}; diff --git a/gcc/testsuite/gcc.dg/c1x-typedef-1.c b/gcc/testsuite/gcc.dg/c1x-typedef-1.c index 2b0bc74208a..a68b23ff5e6 100644 --- a/gcc/testsuite/gcc.dg/c1x-typedef-1.c +++ b/gcc/testsuite/gcc.dg/c1x-typedef-1.c @@ -3,7 +3,8 @@ /* { dg-options "-std=c1x -pedantic-errors" } */ /* C1X permits typedefs to be redeclared to the same type, but not to - different-but-compatible types. */ + different-but-compatible types, and not when the type is variably + modified. */ #include <limits.h> @@ -60,9 +61,10 @@ f (void) typedef void FN2(int (*p)[*]); /* { dg-message "previous declaration" } */ typedef void FN2(int (*p)[]); /* { dg-error "with different type" } */ typedef int AV[a]; /* { dg-message "previous declaration" } */ - typedef int AV[b-1]; /* { dg-warning "may be a constraint violation at runtime" } */ - typedef int AAa[a]; + typedef int AV[b-1]; /* { dg-error "redefinition" } */ + typedef int AAa[a]; /* { dg-message "previous declaration" } */ typedef int AAb[b-1]; typedef AAa *VF(void); /* { dg-message "previous declaration" } */ - typedef AAb *VF(void); /* { dg-warning "may be a constraint violation at runtime" } */ + typedef AAb *VF(void); /* { dg-error "redefinition" } */ + typedef AAa AAa; /* { dg-error "redefinition" } */ } diff --git a/gcc/testsuite/gcc.dg/c1x-typedef-2.c b/gcc/testsuite/gcc.dg/c1x-typedef-2.c deleted file mode 100644 index fb5d918a5d3..00000000000 --- a/gcc/testsuite/gcc.dg/c1x-typedef-2.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Test typedef redeclaration in C1X. Side effects from duplicate - declarations still apply. */ -/* { dg-do run } */ -/* { dg-options "-std=c1x -pedantic-errors" } */ - -extern void exit (int); -extern void abort (void); - -int -main (void) -{ - int a = 1, b = 1; - typedef int T[++a]; /* { dg-message "previous declaration" } */ - typedef int T[++b]; /* { dg-warning "may be a constraint violation at runtime" } */ - if (a != 2 || b != 2) - abort (); - exit (0); -} diff --git a/gcc/testsuite/gcc.dg/cast-qual-3.c b/gcc/testsuite/gcc.dg/cast-qual-3.c deleted file mode 100644 index 88fdcfb38f5..00000000000 --- a/gcc/testsuite/gcc.dg/cast-qual-3.c +++ /dev/null @@ -1,167 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-Wcast-qual" } */ - -/* The files gcc.dg/cast-qual-3.c and g++.dg/warn/Wcast-qual2.c are - duals. they are intended to show that gcc -Wcast-qual and g++ - -Wcast-qual emit warnings in the same cases. If you change this - file, please also change the other one. */ - -void -f1 (void *bar) -{ - const void *p1 = (const void *) bar; - const char *p2 = (const char *) bar; - const void **p3 = (const void **) bar; - const char **p4 = (const char **) bar; - const void * const *p5 = (const void * const *) bar; - const char * const *p6 = (const char * const *) bar; - void * const *p7 = (void * const *) bar; - char * const *p8 = (char * const *) bar; - const void ***p9 = (const void ***) bar; - const char ***p10 = (const char ***) bar; - void * const **p11 = (void * const **) bar; - char * const **p12 = (char * const **) bar; - void ** const *p13 = (void ** const *) bar; - char ** const *p14 = (char ** const *) bar; - const void * const **p15 = (const void * const **) bar; - const char * const **p16 = (const char * const **) bar; - const void ** const *p17 = (const void ** const *) bar; - const char ** const *p18 = (const char ** const *) bar; - void * const * const * p19 = (void * const * const *) bar; - char * const * const * p20 = (char * const * const *) bar; - const void * const * const *p21 = (const void * const * const *) bar; - const char * const * const *p22 = (const char * const * const *) bar; -} - -void -f2 (void **bar) -{ - const void *p1 = (const void *) bar; - const char *p2 = (const char *) bar; - const void **p3 = (const void **) bar; /* { dg-warning "cast" } */ - const char **p4 = (const char **) bar; - const void * const *p5 = (const void * const *) bar; - const char * const *p6 = (const char * const *) bar; - void * const *p7 = (void * const *) bar; - char * const *p8 = (char * const *) bar; - const void ***p9 = (const void ***) bar; - const char ***p10 = (const char ***) bar; - void * const **p11 = (void * const **) bar; - char * const **p12 = (char * const **) bar; - void ** const *p13 = (void ** const *) bar; - char ** const *p14 = (char ** const *) bar; - const void * const **p15 = (const void * const **) bar; - const char * const **p16 = (const char * const **) bar; - const void ** const *p17 = (const void ** const *) bar; - const char ** const *p18 = (const char ** const *) bar; - void * const * const * p19 = (void * const * const *) bar; - char * const * const * p20 = (char * const * const *) bar; - const void * const * const *p21 = (const void * const * const *) bar; - const char * const * const *p22 = (const char * const * const *) bar; -} - -void -f3 (void ***bar) -{ - const void *p1 = (const void *) bar; - const char *p2 = (const char *) bar; - const void **p3 = (const void **) bar; - const char **p4 = (const char **) bar; - const void * const *p5 = (const void * const *) bar; - const char * const *p6 = (const char * const *) bar; - void * const *p7 = (void * const *) bar; - char * const *p8 = (char * const *) bar; - const void ***p9 = (const void ***) bar; /* { dg-warning "cast" } */ - const char ***p10 = (const char ***) bar; - void * const **p11 = (void * const **) bar; /* { dg-warning "cast" } */ - char * const **p12 = (char * const **) bar; - void ** const *p13 = (void ** const *) bar; - char ** const *p14 = (char ** const *) bar; - const void * const **p15 = (const void * const **) bar; /* { dg-warning "cast" } */ - const char * const **p16 = (const char * const **) bar; - const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast" } */ - const char ** const *p18 = (const char ** const *) bar; - void * const * const * p19 = (void * const * const *) bar; - char * const * const * p20 = (char * const * const *) bar; - const void * const * const *p21 = (const void * const * const *) bar; - const char * const * const *p22 = (const char * const * const *) bar; -} - -void -f4 (void * const **bar) -{ - const void ***p9 = (const void ***) bar; /* { dg-warning "cast" } */ - void * const **p11 = (void * const **) bar; - void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast" } */ - const void * const **p15 = (const void * const **) bar; /* { dg-warning "cast" } */ - const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast" } */ - void * const * const * p19 = (void * const * const *) bar; - const void * const * const *p21 = (const void * const * const *) bar; -} - -void -f5 (char ***bar) -{ - volatile const char ***p9 = (volatile const char ***) bar; /* { dg-warning "cast" } */ - volatile char * const **p11 = (volatile char * const **) bar; /* { dg-warning "cast" } */ - volatile char ** const *p13 = (volatile char ** const *) bar; /* { dg-warning "cast" } */ - volatile const char * const **p15 = (volatile const char * const **) bar; /* { dg-warning "cast" } */ - volatile const char ** const *p17 = (volatile const char ** const *) bar; /* { dg-warning "cast" } */ - volatile char * const * const * p19 = (volatile char * const * const *) bar; - volatile const char * const * const *p21 = (volatile const char * const * const *) bar; -} - -void -f6 (char ***bar) -{ - const char * volatile **p9 = (const char * volatile **) bar; /* { dg-warning "cast" } */ - char * volatile const **p11 = (char * volatile const **) bar; /* { dg-warning "cast" } */ - char * volatile * const *p13 = (char * volatile * const *) bar; - const char * volatile const **p15 = (const char * volatile const **) bar; /* { dg-warning "cast" } */ - const char * volatile * const *p17 = (const char * volatile * const *) bar; /* { dg-warning "cast" } */ - char * volatile const * const * p19 = (char * volatile const * const *) bar; - const char * volatile const * const *p21 = (const char * volatile const * const *) bar; -} - -void -f7 (char ***bar) -{ - const char ** volatile *p9 = (const char ** volatile *) bar; /* { dg-warning "cast" } */ - char * const * volatile *p11 = (char * const * volatile *) bar; /* { dg-warning "cast" } */ - char ** volatile const *p13 = (char ** volatile const *) bar; - const char * const * volatile *p15 = (const char * const * volatile *) bar; /* { dg-warning "cast" } */ - const char ** volatile const *p17 = (const char ** volatile const *) bar; /* { dg-warning "cast" } */ - char * const * volatile const * p19 = (char * const * volatile const *) bar; - const char * const * volatile const *p21 = (const char * const * volatile const *) bar; -} - -typedef int (intfn) (int); -typedef intfn *pintfn; -typedef const intfn *constfn; - -void -f8 (constfn ***bar) -{ - const constfn *p1 = (const constfn *) bar; - const pintfn *p2 = (const pintfn *) bar; - const constfn **p3 = (const constfn **) bar; - const pintfn **p4 = (const pintfn **) bar; - const constfn * const *p5 = (const constfn * const *) bar; - const pintfn * const *p6 = (const pintfn * const *) bar; - constfn * const *p7 = (constfn * const *) bar; - pintfn * const *p8 = (pintfn * const *) bar; - const constfn ***p9 = (const constfn ***) bar; /* { dg-warning "cast" } */ - const pintfn ***p10 = (const pintfn ***) bar; /* { dg-warning "cast" } */ - constfn * const **p11 = (constfn * const **) bar; /* { dg-warning "cast" } */ - pintfn * const **p12 = (pintfn * const **) bar; /* { dg-warning "cast" } */ - constfn ** const *p13 = (constfn ** const *) bar; - pintfn ** const *p14 = (pintfn ** const *) bar; - const constfn * const **p15 = (const constfn * const **) bar; /* { dg-warning "cast" } */ - const pintfn * const **p16 = (const pintfn * const **) bar; /* { dg-warning "cast" } */ - const constfn ** const *p17 = (const constfn ** const *) bar; /* { dg-warning "cast" } */ - const pintfn ** const *p18 = (const pintfn ** const *) bar; /* { dg-warning "cast" } */ - constfn * const * const * p19 = (constfn * const * const *) bar; - pintfn * const * const * p20 = (pintfn * const * const *) bar; - const constfn * const * const *p21 = (const constfn * const * const *) bar; - const pintfn * const * const *p22 = (const pintfn * const * const *) bar; -} diff --git a/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc/testsuite/gcc.dg/cpp/assert4.c index 0bd88ce0681..ff53946c6ce 100644 --- a/gcc/testsuite/gcc.dg/cpp/assert4.c +++ b/gcc/testsuite/gcc.dg/cpp/assert4.c @@ -139,14 +139,6 @@ /* Check for #cpu and #machine assertions. */ -#if defined __arc__ -# if !#cpu(arc) || !#machine(arc) -# error -# endif -#elif #cpu(arc) || #machine(arc) -# error -#endif - #if defined __alpha__ # if !#cpu(alpha) || !#machine(alpha) \ || (defined __alpha_cix__ && !#cpu(cix)) \ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-1.c new file mode 100644 index 00000000000..2e4c3cda86c --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-save-temps -g -dA" } */ + +typedef struct _Harry { int dummy; } Harry_t; +Harry_t harry; + +/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-2.c new file mode 100644 index 00000000000..13856d7aa0d --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-save-temps -g -dA" } */ + +typedef const struct _Harry { int dummy; } Harry_t; +Harry_t harry; + +/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-3.c new file mode 100644 index 00000000000..f1e463e45dc --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-3.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-save-temps -g -dA" } */ + +typedef struct _Harry { int dummy; } Harry_t; +const Harry_t harry[5]; + +/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-4.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-4.c new file mode 100644 index 00000000000..cf0a2af6ced --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-4.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-save-temps -g -dA" } */ + +typedef const struct _Harry { int dummy; } Harry_t; +Harry_t harry[10]; + +/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.dg/dfp/pr48204.c b/gcc/testsuite/gcc.dg/dfp/pr48204.c new file mode 100644 index 00000000000..7b421581e6e --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr48204.c @@ -0,0 +1,10 @@ +/* PR debug/48204 */ +/* { dg-do compile } */ +/* { dg-options "-O -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre -g" } */ + +void +foo (void) +{ + float cf = 3.0f; + _Decimal64 d64 = cf; +} diff --git a/gcc/testsuite/gcc.dg/dfp/pr48928.c b/gcc/testsuite/gcc.dg/dfp/pr48928.c new file mode 100644 index 00000000000..1fd36356594 --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr48928.c @@ -0,0 +1,10 @@ +/* PR debug/48928 */ +/* { dg-do compile } */ +/* { dg-options "-g -O2" } */ + +_Decimal32 +foo (_Decimal32 x) +{ + _Decimal32 y = (x + x) / (9.DF * x); + return y; +} diff --git a/gcc/testsuite/gcc.dg/fold-bitand-4.c b/gcc/testsuite/gcc.dg/fold-bitand-4.c deleted file mode 100644 index acb0ce9af9b..00000000000 --- a/gcc/testsuite/gcc.dg/fold-bitand-4.c +++ /dev/null @@ -1,45 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-fdump-tree-original" } */ -/* { dg-options "-fdump-tree-original -fno-common" { target hppa*-*-hpux* } } */ - -typedef char char4[4] __attribute__ ((aligned (4))); -char4 c4[4] __attribute__ ((aligned (16))); - -typedef char char16[16] __attribute__ ((aligned (16))); -char16 c16[4] __attribute__ ((aligned (4))); - -int f1 (void) -{ - /* 12 */ - return 15 & (__SIZE_TYPE__)&c4[3]; -} - -int f2 (int i) -{ - /* Indeterminate */ - return 15 & (__SIZE_TYPE__)&c4[i]; -} - -int f3 (int i) -{ - /* 0 */ - return 3 & (__SIZE_TYPE__)&c4[i]; -} - -int f4 (int i) -{ - /* Indeterminate */ - return 7 & (__SIZE_TYPE__)&c16[i]; -} - -int f5 (int i) -{ - /* 0 */ - return 3 & (__SIZE_TYPE__)&c16[i]; -} - -/* { dg-final { scan-tree-dump-times "return 12" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "\& 15" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "return 0" 2 "original" } } */ -/* { dg-final { scan-tree-dump-times "\& 7" 1 "original" } } */ -/* { dg-final { cleanup-tree-dump "original" } } */ diff --git a/gcc/testsuite/gcc.dg/fold-complex-1.c b/gcc/testsuite/gcc.dg/fold-complex-1.c new file mode 100644 index 00000000000..a9ba0fd59c4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fold-complex-1.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ffast-math -fdump-tree-original" } */ + +_Complex float +foo (_Complex float x) +{ + return __real x + 1.0iF * __imag x; +} + +/* { dg-final { scan-tree-dump-times "COMPLEX_EXPR" 0 "original" } } */ +/* { dg-final { cleanup-tree-dump "original" } } */ diff --git a/gcc/testsuite/gcc.dg/gomp/pr48591.c b/gcc/testsuite/gcc.dg/gomp/pr48591.c new file mode 100644 index 00000000000..e6cb106d845 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr48591.c @@ -0,0 +1,22 @@ +/* PR middle-end/48591 */ +/* { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */ +/* { dg-options "-fopenmp" } */ + +extern void abort (void); + +int +main () +{ + __float128 f = 0.0; + int i; + #pragma omp parallel for reduction(+:f) + for (i = 0; i < 128; i++) + f += 0.5Q; + if (f != 64.0Q) + abort (); + #pragma omp atomic + f += 8.5Q; + if (f != 72.5Q) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/gomp/pr48716.c b/gcc/testsuite/gcc.dg/gomp/pr48716.c new file mode 100644 index 00000000000..3496e2f0227 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr48716.c @@ -0,0 +1,24 @@ +/* PR c/48716 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +int +main (void) +{ + #pragma omp parallel default(none) + { + static int s; + int t = 0; + #pragma omp atomic + s++; + t++; + } + #pragma omp task default(none) + { + static int s; + int t = 0; + #pragma omp atomic + s++; + t++; + } +} diff --git a/gcc/testsuite/gcc.dg/graphite/block-3.c b/gcc/testsuite/gcc.dg/graphite/block-3.c index 322ed8d7f89..3b9db31fa79 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-3.c +++ b/gcc/testsuite/gcc.dg/graphite/block-3.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target size32plus } */ +/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */ /* { dg-timeout-factor 4.0 } */ #define DEBUG 0 diff --git a/gcc/testsuite/gcc.dg/graphite/block-4.c b/gcc/testsuite/gcc.dg/graphite/block-4.c index eb98f0447aa..c206bf824b8 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-4.c +++ b/gcc/testsuite/gcc.dg/graphite/block-4.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target size32plus } */ +/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */ #define DEBUG 0 #if DEBUG diff --git a/gcc/testsuite/gcc.dg/graphite/block-7.c b/gcc/testsuite/gcc.dg/graphite/block-7.c index fbbe1f3ad51..bf9c60f415c 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-7.c +++ b/gcc/testsuite/gcc.dg/graphite/block-7.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target size32plus } */ +/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */ #define DEBUG 0 #if DEBUG diff --git a/gcc/testsuite/gcc.dg/graphite/block-8.c b/gcc/testsuite/gcc.dg/graphite/block-8.c index 9c1c9cebe83..4e2f358fca7 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-8.c +++ b/gcc/testsuite/gcc.dg/graphite/block-8.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target size32plus } */ +/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */ #define DEBUG 0 #if DEBUG diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp index 49e2ac5a550..5e3284d5d11 100644 --- a/gcc/testsuite/gcc.dg/guality/guality.exp +++ b/gcc/testsuite/gcc.dg/guality/guality.exp @@ -4,7 +4,8 @@ load_lib gcc-dg.exp load_lib gcc-gdb-test.exp # Disable on darwin until radr://7264615 is resolved. -if { [istarget *-*-darwin*] } { +# Disable on Tru64 UNIX (PR testsuite/48251). +if { [istarget *-*-darwin*] || [istarget alpha*-dec-osf*] } { return } diff --git a/gcc/testsuite/gcc.dg/guality/pr36977.c b/gcc/testsuite/gcc.dg/guality/pr36977.c new file mode 100644 index 00000000000..3689fae8c43 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr36977.c @@ -0,0 +1,32 @@ +/* PR debug/36977 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */ + +void +foo () +{ +} + +int +main () +{ + struct { char c[100]; } cbig; + struct { int i[800]; } ibig; + struct { long l[900]; } lbig; + struct { float f[200]; } fbig; + struct { double d[300]; } dbig; + struct { short s[400]; } sbig; + + ibig.i[0] = 55; /* { dg-final { gdb-test 30 "ibig.i\[0\]" "55" } } */ + ibig.i[100] = 5; /* { dg-final { gdb-test 30 "ibig.i\[100\]" "5" } } */ + cbig.c[0] = '\0'; /* { dg-final { gdb-test 30 "cbig.c\[0\]" "'\\0'" } } */ + cbig.c[99] = 'A'; /* { dg-final { gdb-test 30 "cbig.c\[99\]" "'A'" } } */ + fbig.f[100] = 11.0; /* { dg-final { gdb-test 30 "fbig.f\[100\]" "11" } } */ + dbig.d[202] = 9.0; /* { dg-final { gdb-test 30 "dbig.d\[202\]" "9" } } */ + sbig.s[90] = 255; /* { dg-final { gdb-test 30 "sbig.s\[90\]" "255" } } */ + lbig.l[333] = 999; /* { dg-final { gdb-test 30 "lbig.l\[333\]" "999" } } */ + + foo (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr45882.c b/gcc/testsuite/gcc.dg/guality/pr45882.c new file mode 100644 index 00000000000..5ca22d4f4ad --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr45882.c @@ -0,0 +1,30 @@ +/* PR debug/45882 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +extern void abort (void); +int a[1024]; +volatile short int v; + +__attribute__((noinline,noclone,used)) int +foo (int i, int j) +{ + int b = i; /* { dg-final { gdb-test 16 "b" "7" } } */ + int c = i + 4; /* { dg-final { gdb-test 16 "c" "11" } } */ + int d = a[i]; /* { dg-final { gdb-test 16 "d" "112" } } */ + int e = a[i + 6]; /* { dg-final { gdb-test 16 "e" "142" } } */ + ++v; + return ++j; +} + +int +main (void) +{ + int l; + asm ("" : "=r" (l) : "0" (7)); + a[7] = 112; + a[7 + 6] = 142; + if (foo (l, 7) != 8) + abort (); + return l - 7; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr48466.c b/gcc/testsuite/gcc.dg/guality/pr48466.c new file mode 100644 index 00000000000..8d5426a9989 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr48466.c @@ -0,0 +1,41 @@ +/* PR debug/48466 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ +/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */ + +struct S { unsigned int a; unsigned int *b; }; +struct T { struct S a; struct S b; }; +struct U { const char *u; }; +int n[10]; +volatile int v; + +struct U +foo (const char *s) +{ + struct U r; + r.u = s; + return r; +} + +void +bar (struct T *s, int a, int b) +{ + s->a.a = a; + s->a.b = &s->a.a; + s->b.a = b; + s->b.b = &s->b.a; +} + +int +main () +{ + struct T t; + struct U x = foo ("this is x"); + struct S y, z; + y.b = n; /* { dg-final { gdb-test 38 "t.a.a" "17" } } */ + y.a = 0; /* { dg-final { gdb-test 38 "*t.a.b" "17" } } */ + bar (&t, 17, 21); /* { dg-final { gdb-test 38 "t.b.a" "21" } } */ + v++; /* { dg-final { gdb-test 38 "*t.b.b" "21" } } */ + z = y; + return 0; +} diff --git a/gcc/testsuite/gcc.dg/guality/vla-1.c b/gcc/testsuite/gcc.dg/guality/vla-1.c index 2db1c29caa6..651465428ac 100644 --- a/gcc/testsuite/gcc.dg/guality/vla-1.c +++ b/gcc/testsuite/gcc.dg/guality/vla-1.c @@ -28,9 +28,10 @@ f2 (int i) int main () { + volatile int j; int i = 5; asm volatile ("" : "=r" (i) : "0" (i)); - f1 (i); + j = f1 (i); f2 (i); return 0; } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c index 1e04bfc2118..0f46e984bce 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre" } */ +/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2" } */ static int x, y; @@ -54,9 +54,9 @@ int main() local_address_taken (&y); /* As we are computing flow- and context-insensitive we may not CSE the load of x here. */ - /* { dg-final { scan-tree-dump " = x;" "fre" } } */ + /* { dg-final { scan-tree-dump " = x;" "fre2" } } */ return x; } /* { dg-final { cleanup-ipa-dump "pta" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { cleanup-tree-dump "fre2" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c index 074f44a6d68..e8abc3244a0 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -fipa-pta -fno-tree-sra -fdump-ipa-pta-details" } */ +/* { dg-options "-O2 -fipa-pta -fno-tree-fre -fno-tree-sra -fdump-ipa-pta-details" } */ struct X { int i; diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c index e73db1c95ac..ce9393cb072 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre-details" } */ +/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2-details" } */ static int __attribute__((noinline,noclone)) foo (int *p, int *q) @@ -23,6 +23,6 @@ int main() /* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */ /* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */ -/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre2" } } */ +/* { dg-final { cleanup-tree-dump "fre2" } } */ /* { dg-final { cleanup-ipa-dump "pta" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c index d2b901cf910..32e1e4fbc49 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre-details" } */ +/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2-details" } */ int a, b; @@ -28,6 +28,6 @@ int main() /* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */ /* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */ -/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre2" } } */ +/* { dg-final { cleanup-tree-dump "fre2" } } */ /* { dg-final { cleanup-ipa-dump "pta" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/pr45644.c b/gcc/testsuite/gcc.dg/ipa/pr45644.c index 3f61b8b4127..3741020d93c 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr45644.c +++ b/gcc/testsuite/gcc.dg/ipa/pr45644.c @@ -1,6 +1,7 @@ /* Verify that we do not IPA-SRA bitfields. */ /* { dg-do run } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target int32plus } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/ipa/pr48195.c b/gcc/testsuite/gcc.dg/ipa/pr48195.c new file mode 100644 index 00000000000..2e38452d598 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr48195.c @@ -0,0 +1,25 @@ +/* { dg-do link } */ +/* { dg-options "-O2 -flto --param partial-inlining-entry-probability=101" } */ +/* { dg-require-effective-target lto } */ + +extern void abort(void); + +int i; + +void __attribute__ ((constructor)) +c2 () +{ + if (i) + abort (); +} + +void __attribute__ ((destructor)) +d1 () +{ + if (i) + abort (); +} + +void main () +{ +} diff --git a/gcc/testsuite/gcc.dg/large-size-array-5.c b/gcc/testsuite/gcc.dg/large-size-array-5.c new file mode 100644 index 00000000000..71ac47374f4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/large-size-array-5.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-Wno-overflow" } */ + +typedef __SIZE_TYPE__ size_t; + +extern char a[((size_t)-1 >> 1) + 1]; /* { dg-error "too large" } */ +extern char b[((size_t)-1 >> 1)]; +extern int c[(((size_t)-1 >> 1) + 1) / sizeof(int)]; /* { dg-error "too large" } */ +extern int d[((size_t)-1 >> 1) / sizeof(int)]; diff --git a/gcc/testsuite/gcc.dg/lto/20081204-1_0.c b/gcc/testsuite/gcc.dg/lto/20081204-1_0.c index a4b25ff82fb..0c3849f6182 100644 --- a/gcc/testsuite/gcc.dg/lto/20081204-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20081204-1_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */ /* Tests for the absence during linking of: diff --git a/gcc/testsuite/gcc.dg/lto/20081224_0.c b/gcc/testsuite/gcc.dg/lto/20081224_0.c index d050e231238..9f9afdf85c7 100644 --- a/gcc/testsuite/gcc.dg/lto/20081224_0.c +++ b/gcc/testsuite/gcc.dg/lto/20081224_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib -fPIC}} } */ #include "20081224_0.h" diff --git a/gcc/testsuite/gcc.dg/lto/20090116_0.c b/gcc/testsuite/gcc.dg/lto/20090116_0.c index 5bb3a919a59..4a865969901 100644 --- a/gcc/testsuite/gcc.dg/lto/20090116_0.c +++ b/gcc/testsuite/gcc.dg/lto/20090116_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-O1 -flto -flto-partition=1to1 -fPIC}} } */ /* { dg-extra-ld-options {-r -nostdlib -O0} } */ diff --git a/gcc/testsuite/gcc.dg/lto/20090126-2_0.c b/gcc/testsuite/gcc.dg/lto/20090126-2_0.c index 2239412d1af..f75a05fec62 100644 --- a/gcc/testsuite/gcc.dg/lto/20090126-2_0.c +++ b/gcc/testsuite/gcc.dg/lto/20090126-2_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-fPIC -O2 -flto -flto-partition=1to1}} } */ /* { dg-extra-ld-options {-fno-PIC -r -nostdlib -O2 -flto -flto-partition=1to1} } */ diff --git a/gcc/testsuite/gcc.dg/lto/20090206-2_0.c b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c index 4ca80ea4810..2f4020a011c 100644 --- a/gcc/testsuite/gcc.dg/lto/20090206-2_0.c +++ b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c @@ -1,5 +1,6 @@ /* { dg-lto-do link } */ /* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */ /* { dg-suppress-ld-options {-fPIC} } */ diff --git a/gcc/testsuite/gcc.dg/lto/20090210_0.c b/gcc/testsuite/gcc.dg/lto/20090210_0.c index 2c858a67d32..794c18fe04d 100644 --- a/gcc/testsuite/gcc.dg/lto/20090210_0.c +++ b/gcc/testsuite/gcc.dg/lto/20090210_0.c @@ -1,6 +1,7 @@ /* { dg-lto-do run } */ +/* { dg-require-effective-target fpic } */ /* { dg-suppress-ld-options {-fPIC} } */ -/* { dg-require-effective-target tls } */ +/* { dg-require-effective-target tls_runtime } */ /* { dg-extra-ld-options "-pthread" { target *-*-solaris2.[89] } } */ int foo (int x) { diff --git a/gcc/testsuite/gcc.dg/lto/20090219_0.c b/gcc/testsuite/gcc.dg/lto/20090219_0.c index 81a93e6da53..985c884cecd 100644 --- a/gcc/testsuite/gcc.dg/lto/20090219_0.c +++ b/gcc/testsuite/gcc.dg/lto/20090219_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-O3 -flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */ struct Foo { int f1, f2, f3, f4, f5; }; diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c index 0fecce04f09..83de8d3223b 100644 --- a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-fPIC -r -nostdlib -flto} {-fPIC -r -nostdlib -O2 -flto}} } */ void * HeapAlloc(void*,unsigned int,unsigned long); diff --git a/gcc/testsuite/gcc.dg/lto/20091014-1_0.c b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c index 975214e0430..be327aaff90 100644 --- a/gcc/testsuite/gcc.dg/lto/20091014-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */ /* Empty file. See PR41173. */ diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_0.c b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c index 1cc4b78b31b..1c11f644888 100644 --- a/gcc/testsuite/gcc.dg/lto/20091015-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto} {-fPIC -r -nostdlib -O2 -flto -flto-partition=1to1}} } */ #include "20091015-1_b.h" diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_0.c b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c index 39a04b950bf..b44c75a97c4 100644 --- a/gcc/testsuite/gcc.dg/lto/20091016-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto}} } */ typedef struct VEC_constructor_elt_gc { } VEC_constructor_elt_gc; diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_0.c b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c index c9bcb565d96..f9d8bf87de6 100644 --- a/gcc/testsuite/gcc.dg/lto/20091020-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */ typedef struct { diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_0.c b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c index fb1a82bb8c6..21e59678732 100644 --- a/gcc/testsuite/gcc.dg/lto/20091020-2_0.c +++ b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c @@ -1,4 +1,5 @@ /* { dg-lto-do link } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */ typedef struct { diff --git a/gcc/testsuite/gcc.dg/lto/pr48622_0.c b/gcc/testsuite/gcc.dg/lto/pr48622_0.c new file mode 100644 index 00000000000..ffb5f62d6a0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr48622_0.c @@ -0,0 +1,93 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-O -flto -finline-small-functions -fno-early-inlining}} } */ + +void abort(void); +void exit(int); + +typedef unsigned int u8 __attribute__ ((mode (QI))); + +u8 +ashift_qi_0 (u8 n) +{ +} + +u8 +ashift_qi_2 (u8 n) +{ +} + +u8 +ashift_qi_3 (u8 n) +{ +} + +u8 +ashift_qi_4 (u8 n) +{ +} + +u8 +ashift_qi_5 (u8 n) +{ +} + +u8 +ashift_qi_6 (u8 n) +{ +} + +u8 +ashift_qi_7 (u8 n) +{ +} + +u8 +lshiftrt_qi_0 (u8 n) +{ +} + +u8 +lshiftrt_qi_4 (u8 n) +{ +} + +u8 +lshiftrt_qi_5 (u8 n) +{ +} + +u8 +lshiftrt_qi_7 (u8 n) +{ +} + +int +main () +{ + if (ashift_qi_0 (0xff) != (u8) ((u8) 0xff << 0)) + abort (); + if (ashift_qi_1 (0xff) != (u8) ((u8) 0xff << 1)) + abort (); + if (ashift_qi_2 (0xff) != (u8) ((u8) 0xff << 2)) + abort (); + if (ashift_qi_3 (0xff) != (u8) ((u8) 0xff << 3)) + abort (); + if (ashift_qi_4 (0xff) != (u8) ((u8) 0xff << 4)) + abort (); + if (ashift_qi_5 (0xff) != (u8) ((u8) 0xff << 5)) + abort (); + if (ashift_qi_6 (0xff) != (u8) ((u8) 0xff << 6)) + abort (); + if (ashift_qi_7 (0xff) != (u8) ((u8) 0xff << 7)) + abort (); + if (lshiftrt_qi_0 (0xff) != (u8) ((u8) 0xff >> 0)) + abort (); + if (lshiftrt_qi_4 (0xff) != (u8) ((u8) 0xff >> 4)) + abort (); + if (lshiftrt_qi_5 (0xff) != (u8) ((u8) 0xff >> 5)) + abort (); + if (lshiftrt_qi_7 (0xff) != (u8) ((u8) 0xff >> 7)) + abort (); + exit (0); +} + diff --git a/gcc/testsuite/gcc.dg/matrix/matrix.exp b/gcc/testsuite/gcc.dg/matrix/matrix.exp index 961e0255e33..aae19883143 100644 --- a/gcc/testsuite/gcc.dg/matrix/matrix.exp +++ b/gcc/testsuite/gcc.dg/matrix/matrix.exp @@ -20,7 +20,7 @@ load_lib gcc-dg.exp load_lib target-supports.exp -set DEFAULT_MATCFLAGS "-O3 -fipa-matrix-reorg -fdump-ipa-matrix-reorg -fwhole-program" +set DEFAULT_MATCFLAGS "-O3 -fipa-matrix-reorg -fdump-ipa-matrix-reorg -fwhole-program -fno-tree-fre" # Initialize `dg'. dg-init @@ -52,8 +52,8 @@ load_lib profopt.exp # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. -set profile_option "-fprofile-generate -O3" -set feedback_option "-fprofile-use -fipa-matrix-reorg -fdump-ipa-matrix-reorg -O3 -fwhole-program" +set profile_option "-fprofile-generate -O3 -fno-tree-fre" +set feedback_option "-fprofile-use -fipa-matrix-reorg -fdump-ipa-matrix-reorg -O3 -fwhole-program -fno-tree-fre" foreach src [lsort [glob -nocomplain $srcdir/$subdir/transpose-*.c]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gcc.dg/missing-field-init-2.c b/gcc/testsuite/gcc.dg/missing-field-init-2.c index 581eb30d89b..c5a3f490387 100644 --- a/gcc/testsuite/gcc.dg/missing-field-init-2.c +++ b/gcc/testsuite/gcc.dg/missing-field-init-2.c @@ -9,3 +9,6 @@ struct s s4[] = { 1, 2, 3, 4, 5 }; /* { dg-warning "(missing initializer)|(near struct s s5[] = { 1, 2, 3, 4, 5, 6 }; /* Designated initializers produce no warning. */ struct s s6 = { .a = 1 }; /* { dg-bogus "missing initializer" } */ +/* Allow zero-initializing with "= { 0 }". */ +struct s s7 = { 0 }; /* { dg-bogus "missing initializer" } */ +struct s s8 = { 1 }; /* { dg-warning "(missing initializer)|(near initialization)" } */ diff --git a/gcc/testsuite/gcc.dg/mtune.c b/gcc/testsuite/gcc.dg/mtune.c index 992cb09ff01..88c5db8dda7 100644 --- a/gcc/testsuite/gcc.dg/mtune.c +++ b/gcc/testsuite/gcc.dg/mtune.c @@ -4,4 +4,5 @@ /* { dg-error "mtune" "" { target *-*-* } 0 } */ /* { dg-bogus "march" "" { target *-*-* } 0 } */ /* { dg-bogus "mcpu" "" { target *-*-* } 0 } */ +/* { dg-prune-output "note: valid arguments.*" } */ int i; diff --git a/gcc/testsuite/gcc.dg/pr15347.c b/gcc/testsuite/gcc.dg/pr15347.c new file mode 100644 index 00000000000..b95b0ea2a5e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr15347.c @@ -0,0 +1,10 @@ +/* { dg-do link } */ + +extern void link_error (void); +int +main () +{ + if ("<12ers" + 1 == 0) + link_error (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr35445.c b/gcc/testsuite/gcc.dg/pr35445.c new file mode 100644 index 00000000000..cef309f41ce --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr35445.c @@ -0,0 +1,6 @@ +/* PR c/35445 */ +/* { dg-do "compile" } */ + +extern int i; +extern int i; /* { dg-message "was here" } */ +int i[] = { 0 }; /* { dg-error "conflicting types" } */ diff --git a/gcc/testsuite/gcc.dg/pr42629.c b/gcc/testsuite/gcc.dg/pr42629.c index e95d29b544e..4d80068ff39 100644 --- a/gcc/testsuite/gcc.dg/pr42629.c +++ b/gcc/testsuite/gcc.dg/pr42629.c @@ -2,6 +2,7 @@ took debug insns into account. */ /* { dg-do compile } */ /* { dg-options "-O1 -fsched-pressure -fschedule-insns -fcompare-debug" } */ +/* { dg-require-effective-target int32plus } */ int lzo_adler32(int adler, char *buf) { diff --git a/gcc/testsuite/gcc.dg/pr47917.c b/gcc/testsuite/gcc.dg/pr47917.c new file mode 100644 index 00000000000..92bcf79662b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr47917.c @@ -0,0 +1,38 @@ +/* PR middle-end/47917 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +extern int snprintf (char *, __SIZE_TYPE__, const char *, ...); +extern int memcmp (const void *, const void *, __SIZE_TYPE__); +extern void abort (void); + +char buf1[6], buf2[6], buf3[4], buf4[4]; +int i; + +int +foo (void) +{ + int ret = snprintf (buf1, sizeof buf1, "abcde"); + ret += snprintf (buf2, sizeof buf2, "abcdef") * 16; + ret += snprintf (buf3, sizeof buf3, "%s", i++ < 6 ? "abc" : "def") * 256; + ret += snprintf (buf4, sizeof buf4, "%s", i++ > 10 ? "abcde" : "defgh") * 4096; + return ret; +} + +int +main (void) +{ + if (foo () != 5 + 6 * 16 + 3 * 256 + 5 * 4096) + abort (); + if (memcmp (buf1, "abcde", 6) != 0 + || memcmp (buf2, "abcde", 6) != 0 + || memcmp (buf3, "abc", 4) != 0 + || memcmp (buf4, "def", 4) != 0 + || i != 2) + abort (); + return 0; +} + +/* { dg-final { scan-tree-dump-times "snprintf" 2 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "sprintf" 0 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/pr48134.c b/gcc/testsuite/gcc.dg/pr48134.c new file mode 100644 index 00000000000..8dc5a6d0d41 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48134.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-check=specific -fno-tree-dse -fno-tree-fre -fno-tree-loop-optimize -g" } */ + +struct S +{ + int w, z; +}; +struct T +{ + struct S s; +}; + +int i; + +static inline struct S +bar (struct S x) +{ + i++; + return x; +} + +int +foo (struct T t, struct S s) +{ + struct S *c = &s; + if (i) + c = &t.s; + t.s.w = 3; + s = bar (*c); + return t.s.w; +} diff --git a/gcc/testsuite/gcc.dg/pr48141.c b/gcc/testsuite/gcc.dg/pr48141.c new file mode 100644 index 00000000000..006f5cb1440 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48141.c @@ -0,0 +1,17 @@ +/* PR rtl-optimization/48141 */ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#define A i = 0; +#define B A A A A A A A A A A +#define C B B B B B B B B B B +#define D C C C C C C C C C C +#define E D D D D D D D D D D + +int +foo (void) +{ + volatile int i = 0; + E E E E E E E E E E E + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr48144.c b/gcc/testsuite/gcc.dg/pr48144.c new file mode 100644 index 00000000000..030202d064b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48144.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O -frerun-cse-after-loop -fschedule-insns2 -fselective-scheduling2 -fno-tree-ch -funroll-loops --param=max-sched-extend-regions-iters=2 --param=max-sched-region-blocks=15" } */ +extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n); + +void bar (void *, void *, void *); + +void foo + (void *p, char *data, unsigned data_len) +{ + int buffer[8]; + int buf2[8]; + unsigned i; + for (i = 0; i + 8 <= data_len; i += 8) + bar (p, buffer, data + i); + memcpy (buf2, data + i, data_len); +} diff --git a/gcc/testsuite/gcc.dg/pr48156.c b/gcc/testsuite/gcc.dg/pr48156.c new file mode 100644 index 00000000000..7b4d529c41b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48156.c @@ -0,0 +1,45 @@ +/* PR rtl-optimization/48156 */ +/* { dg-do run } */ +/* { dg-options "-O -fcrossjumping --param min-crossjump-insns=1" } */ + +extern void abort (void); + +static int __attribute__ ((noinline, noclone)) +equals (int s1, int s2) +{ + return s1 == s2; +} + +static int __attribute__ ((noinline, noclone)) +bar (void) +{ + return 1; +} + +static void __attribute__ ((noinline, noclone)) +baz (int f, int j) +{ + if (f != 4 || j != 2) + abort (); +} + +void +foo (int x) +{ + int i = 0, j = bar (); + + if (x == 1) + i = 2; + + if (j && equals (i, j)) + baz (8, i); + else + baz (4, i); +} + +int +main () +{ + foo (1); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr48203.c b/gcc/testsuite/gcc.dg/pr48203.c new file mode 100644 index 00000000000..b4b2b084ddb --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48203.c @@ -0,0 +1,51 @@ +/* PR debug/48203 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ + +volatile int v; + +void +foo (long a, long b, long c, long d, long e, long f, long g, long h, + long i, long j, long k, long l, long m, long n, long o, long p) +{ + long a2 = a; + long b2 = b; + long c2 = c; + long d2 = d; + long e2 = e; + long f2 = f; + long g2 = g; + long h2 = h; + long i2 = i; + long j2 = j; + long k2 = k; + long l2 = l; + long m2 = m; + long n2 = n; + long o2 = o; + long p2 = p; + v++; +} + +void +bar (int a, int b, int c, int d, int e, int f, int g, int h, + int i, int j, int k, int l, int m, int n, int o, int p) +{ + int a2 = a; + int b2 = b; + int c2 = c; + int d2 = d; + int e2 = e; + int f2 = f; + int g2 = g; + int h2 = h; + int i2 = i; + int j2 = j; + int k2 = k; + int l2 = l; + int m2 = m; + int n2 = n; + int o2 = o; + int p2 = p; + v++; +} diff --git a/gcc/testsuite/gcc.dg/pr48213.c b/gcc/testsuite/gcc.dg/pr48213.c new file mode 100644 index 00000000000..cf7d76fa0ea --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48213.c @@ -0,0 +1,14 @@ +/* PR target/48213 */ +/* { dg-do compile } */ +/* { dg-options "-g -O2" } */ +/* { dg-options "-g -O2 -fpic" { target fpic } } */ + +struct S { int (*s) (void); }; +int bar (void); + +void +foo (struct S *x) +{ + if (x->s != bar) + bar (); +} diff --git a/gcc/testsuite/gcc.dg/pr48235.c b/gcc/testsuite/gcc.dg/pr48235.c new file mode 100644 index 00000000000..401624ec629 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48235.c @@ -0,0 +1,58 @@ +/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O -fno-guess-branch-probability -fpeel-loops -freorder-blocks-and-partition -fschedule-insns2 -fsel-sched-pipelining -fselective-scheduling2" } */ +struct intC +{ + short x; + short y; +}; + +int size_x; + +static inline int +TileDiffXY (int x, int y) +{ + return (y * size_x) + x; +} + +struct HangarTileTable +{ + struct intC ti; + int hangar_num; +}; + +struct AirportSpec +{ + struct HangarTileTable *depot_table; + int size; +}; + +void Get (); +struct AirportSpec dummy; + +static inline int +GetRotatedTileFromOffset (int *a, struct intC tidc) +{ + if (!*a) + Get (); + switch (*a) + { + case 0: + return (tidc.y << size_x) + tidc.x; + case 1: + return TileDiffXY (tidc.y, dummy.size - tidc.x); + case 2: + return TileDiffXY (tidc.x, dummy.size - tidc.y); + case 3: + return TileDiffXY (dummy.size - 1, tidc.x); + } +} + +int +GetHangarNum (int *a) +{ + int i; + for (i = 0; i < dummy.size; i++) + if (GetRotatedTileFromOffset (a, dummy.depot_table[i].ti)) + return dummy.depot_table[i].hangar_num; +} diff --git a/gcc/testsuite/gcc.dg/pr48335-1.c b/gcc/testsuite/gcc.dg/pr48335-1.c new file mode 100644 index 00000000000..7a022eac835 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-1.c @@ -0,0 +1,48 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef long long T __attribute__((may_alias)); + +struct S +{ + _Complex float d __attribute__((aligned (8))); +}; + +void bar (struct S); + +void +f1 (T x) +{ + struct S s; + *(T *) &s.d = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f2 (int x) +{ + struct S s = { .d = 0.0f }; + *(char *) &s.d = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f3 (int x) +{ + struct S s = { .d = 0.0f }; + ((char *) &s.d)[2] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f4 (int x, int y) +{ + struct S s = { .d = 0.0f }; + ((char *) &s.d)[y] = x; + __real__ s.d *= 7.0; + bar (s); +} diff --git a/gcc/testsuite/gcc.dg/pr48335-2.c b/gcc/testsuite/gcc.dg/pr48335-2.c new file mode 100644 index 00000000000..a37c0797c3b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-2.c @@ -0,0 +1,58 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef long long T __attribute__((may_alias, aligned (1))); +typedef short U __attribute__((may_alias, aligned (1))); + +struct S +{ + _Complex float d __attribute__((aligned (8))); +}; + +void bar (struct S); + +void +f1 (T x) +{ + struct S s; + *(T *) ((char *) &s.d + 1) = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f2 (int x) +{ + struct S s = { .d = 0.0f }; + ((U *)((char *) &s.d + 1))[0] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f3 (int x) +{ + struct S s = { .d = 0.0f }; + ((U *)((char *) &s.d + 1))[1] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f4 (int x) +{ + struct S s = { .d = 0.0f }; + ((U *)((char *) &s.d + 1))[2] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f5 (int x) +{ + struct S s = { .d = 0.0f }; + ((U *)((char *) &s.d + 1))[3] = x; + __real__ s.d *= 7.0; + bar (s); +} diff --git a/gcc/testsuite/gcc.dg/pr48335-3.c b/gcc/testsuite/gcc.dg/pr48335-3.c new file mode 100644 index 00000000000..9041f591fff --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-3.c @@ -0,0 +1,48 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef short U __attribute__((may_alias, aligned (1))); + +struct S +{ + double d; +}; + +void bar (struct S); + +void +f1 (int x) +{ + struct S s = { .d = 0.0 }; + ((U *)((char *) &s.d + 1))[0] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f2 (int x) +{ + struct S s = { .d = 0.0 }; + ((U *)((char *) &s.d + 1))[1] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f3 (int x) +{ + struct S s = { .d = 0.0 }; + ((U *)((char *) &s.d + 1))[2] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f4 (int x) +{ + struct S s = { .d = 0.0 }; + ((U *)((char *) &s.d + 1))[3] = x; + __real__ s.d *= 7.0; + bar (s); +} diff --git a/gcc/testsuite/gcc.dg/pr48335-4.c b/gcc/testsuite/gcc.dg/pr48335-4.c new file mode 100644 index 00000000000..98e9e1eec73 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-4.c @@ -0,0 +1,39 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef short U __attribute__((may_alias, aligned (1))); + +struct S +{ + double d; +}; + +void bar (struct S); + +void +f1 (int x) +{ + struct S s = { .d = 0.0 }; + ((U *)((char *) &s.d + 1))[-1] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f2 (int x) +{ + struct S s = { .d = 0.0 }; + ((U *)((char *) &s.d + 1))[-2] = x; + __real__ s.d *= 7.0; + bar (s); +} + +void +f3 (int x) +{ + struct S s = { .d = 0.0 }; + ((U *)((char *) &s.d + 1))[5] = x; + __real__ s.d *= 7.0; + bar (s); +} diff --git a/gcc/testsuite/gcc.dg/pr48335-5.c b/gcc/testsuite/gcc.dg/pr48335-5.c new file mode 100644 index 00000000000..b1895484dc9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-5.c @@ -0,0 +1,38 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef long long T __attribute__((may_alias)); + +struct S +{ + _Complex float d __attribute__((aligned (8))); +}; + +int +f1 (struct S x) +{ + struct S s = x; + return *(T *) &s.d; +} + +int +f2 (struct S x) +{ + struct S s = x; + return *(char *) &s.d; +} + +int +f3 (struct S x) +{ + struct S s = x; + return ((char *) &s.d)[2]; +} + +int +f4 (struct S x, int y) +{ + struct S s = x; + return ((char *) &s.d)[y]; +} diff --git a/gcc/testsuite/gcc.dg/pr48335-6.c b/gcc/testsuite/gcc.dg/pr48335-6.c new file mode 100644 index 00000000000..769130cc4e3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-6.c @@ -0,0 +1,46 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef long long T __attribute__((may_alias, aligned (1))); +typedef short U __attribute__((may_alias, aligned (1))); + +struct S +{ + _Complex float d __attribute__((aligned (8))); +}; + +T +f1 (struct S x) +{ + struct S s = x; + return *(T *) ((char *) &s.d + 1); +} + +int +f2 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[0]; +} + +int +f3 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[1]; +} + +int +f4 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[2]; +} + +int +f5 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[3]; +} diff --git a/gcc/testsuite/gcc.dg/pr48335-7.c b/gcc/testsuite/gcc.dg/pr48335-7.c new file mode 100644 index 00000000000..ddb15ee6ab9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-7.c @@ -0,0 +1,38 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef short U __attribute__((may_alias, aligned (1))); + +struct S +{ + double d; +}; + +int +f1 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[0]; +} + +int +f2 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[1]; +} + +int +f3 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[2]; +} + +int +f4 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[3]; +} diff --git a/gcc/testsuite/gcc.dg/pr48335-8.c b/gcc/testsuite/gcc.dg/pr48335-8.c new file mode 100644 index 00000000000..bb06c157f83 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48335-8.c @@ -0,0 +1,31 @@ +/* PR middle-end/48335 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-sra" } */ + +typedef short U __attribute__((may_alias, aligned (1))); + +struct S +{ + double d; +}; + +int +f1 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[-1]; +} + +int +f2 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[-2]; +} + +int +f3 (struct S x) +{ + struct S s = x; + return ((U *)((char *) &s.d + 1))[5]; +} diff --git a/gcc/testsuite/gcc.dg/pr48442.c b/gcc/testsuite/gcc.dg/pr48442.c new file mode 100644 index 00000000000..88e3497b11d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48442.c @@ -0,0 +1,27 @@ +/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-options "-Os -fselective-scheduling2 --param max-sched-extend-regions-iters=100" } */ +void f (void) +{ + unsigned *a2; + int vertex2; + int c, x2, dx2, dy2, s2; + long m, b; + do + { + if (dx2) + dx2 = dx2 % dy2; + s2 = (dx2 / dy2); + } + while (vertex2); + for (;;) + { + c = x2; + a2 = 0; + if (c) + { + m = b << (c); + *a2 = (*a2 & ~m); + } + x2 += s2; + } +} diff --git a/gcc/testsuite/gcc.dg/pr48552-1.c b/gcc/testsuite/gcc.dg/pr48552-1.c new file mode 100644 index 00000000000..5590549a7ce --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48552-1.c @@ -0,0 +1,53 @@ +/* PR c/48552 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct S; + +void +f1 (void *x) +{ + __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */ + +void +f2 (void *x) +{ + __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */ + /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */ +void +f3 (void *x) +{ + __asm volatile ("" : : "m" (*x)); /* { dg-warning "dereferencing" } */ +} + +void +f4 (void *x) +{ + __asm volatile ("" : "=m" (*x)); /* { dg-warning "dereferencing" } */ +} + +void +f5 (void *x) +{ + __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */ + +void +f6 (void *x) +{ + __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */ + /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */ +void +f7 (struct S *x) +{ + __asm volatile ("" : : "r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ +} + +void +f8 (struct S *x) +{ + __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ +} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */ diff --git a/gcc/testsuite/gcc.dg/pr48552-2.c b/gcc/testsuite/gcc.dg/pr48552-2.c new file mode 100644 index 00000000000..4408279f8ac --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48552-2.c @@ -0,0 +1,53 @@ +/* PR c/48552 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct S; + +void +f1 (void *x) +{ + __asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */ + +void +f2 (void *x) +{ + __asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */ + /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */ +void +f3 (void *x) +{ + __asm ("" : : "m" (*x)); /* { dg-warning "dereferencing" } */ +} + +void +f4 (void *x) +{ + __asm ("" : "=m" (*x)); /* { dg-warning "dereferencing" } */ +} + +void +f5 (void *x) +{ + __asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */ + +void +f6 (void *x) +{ + __asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */ +} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */ + /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */ +void +f7 (struct S *x) +{ + __asm ("" : : "r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ +} + +void +f8 (struct S *x) +{ + __asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ +} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */ diff --git a/gcc/testsuite/gcc.dg/pr48616.c b/gcc/testsuite/gcc.dg/pr48616.c new file mode 100644 index 00000000000..6cad235c4b4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48616.c @@ -0,0 +1,135 @@ +/* PR tree-optimization/48616 */ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize" } */ +/* { dg-options "-O2 -ftree-vectorize -fno-common" { target alpha*-dec-osf* hppa*-*-hpux* } } */ + +extern void abort (void); +int a[4] __attribute__((aligned (32))); +int b[4] __attribute__((aligned (32))); +int c[4] __attribute__((aligned (32))); +int d[4] __attribute__((aligned (32))); +int e[4] __attribute__((aligned (32))); + +__attribute__((noinline, noclone)) +int +foo (int x) +{ + asm ("" : "+r" (x)); + return x; +} + +__attribute__((noinline, noclone)) +void +fn1 (int i) +{ + a[0] = b[0] << c[0]; + a[1] = b[1] << c[1]; + a[2] = b[2] << c[2]; + a[3] = b[3] << c[3]; + if (i) + { + d[0] = e[0] >> c[0]; + d[1] = e[1] >> c[1]; + d[2] = e[2] >> c[2]; + d[3] = e[3] >> c[3]; + } +} + +__attribute__((noinline, noclone)) +void +fn2 (int i) +{ + a[0] = b[0] << 1; + a[1] = b[1] << 2; + a[2] = b[2] << 3; + a[3] = b[3] << 4; + if (i) + { + d[0] = e[0] >> 1; + d[1] = e[1] >> 2; + d[2] = e[2] >> 3; + d[3] = e[3] >> 4; + } +} + +__attribute__((noinline, noclone)) +void +fn3 (int i, int j) +{ + int x = foo (j); + a[0] = b[0] << x; + a[1] = b[1] << x; + a[2] = b[2] << x; + a[3] = b[3] << x; + if (i) + { + d[0] = e[0] >> x; + d[1] = e[1] >> x; + d[2] = e[2] >> x; + d[3] = e[3] >> x; + } +} + +__attribute__((noinline, noclone)) +void +fn4 (int i) +{ + a[0] = b[0] << 1; + a[1] = b[1] << 1; + a[2] = b[2] << 1; + a[3] = b[3] << 1; + if (i) + { + d[0] = e[0] >> 1; + d[1] = e[1] >> 1; + d[2] = e[2] >> 1; + d[3] = e[3] >> 1; + } +} + +int +main () +{ + int i; + int *t; + for (i = 0; i < 4; i++) + { + b[i] = 32; + c[i] = i + 1; + e[i] = 32; + } + asm volatile ("" : : "r" (b) : "memory"); + asm volatile ("" : : "r" (c) : "memory"); + asm volatile ("" : "=r" (t) : "0" (d) : "memory"); + fn1 (t != 0); + for (i = 0; i < 4; i++) + { + if (a[i] != (32 << (i + 1)) || d[i] != (32 >> (i + 1))) + abort (); + a[i] = 0; + d[i] = 0; + } + fn2 (t != 0); + for (i = 0; i < 4; i++) + { + if (a[i] != (32 << (i + 1)) || d[i] != (32 >> (i + 1))) + abort (); + a[i] = 0; + d[i] = 0; + } + fn3 (t != 0, t != 0); + for (i = 0; i < 4; i++) + { + if (a[i] != (32 << 1) || d[i] != (32 >> 1)) + abort (); + a[i] = 0; + d[i] = 0; + } + fn4 (t != 0); + for (i = 0; i < 4; i++) + { + if (a[i] != (32 << 1) || d[i] != (32 >> 1)) + abort (); + } + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr48685.c b/gcc/testsuite/gcc.dg/pr48685.c new file mode 100644 index 00000000000..36df0cc5f31 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48685.c @@ -0,0 +1,11 @@ +/* PR c/48685 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +main () +{ + int v = 1; + (void) (1 == 2 ? (void) 0 : (v = 0)); + return v; +} diff --git a/gcc/testsuite/gcc.dg/pr48768.c b/gcc/testsuite/gcc.dg/pr48768.c new file mode 100644 index 00000000000..7d0383e83bc --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48768.c @@ -0,0 +1,38 @@ +/* PR debug/48768 */ +/* { dg-do compile } */ +/* { dg-options "-O -fcompare-debug" } */ + +int a, b; + +int +bar (void) +{ + int i, j = 1; + for (i = 0; i != 10; i++) + { + lab: + if (i) + { + int *k = &j; + } + else if (j) + goto lab; + } + return 1; +} + +inline int +foo (int x) +{ + unsigned int c = x; + int d = x; + if (bar ()) + for (; c; c++) + while (x >= 0) + if (foo (d) >= 0) + { + d = bar (); + a = b ? b : 1; + } + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr48774.c b/gcc/testsuite/gcc.dg/pr48774.c new file mode 100644 index 00000000000..91ce361ccb3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48774.c @@ -0,0 +1,38 @@ +/* PR target/48774 */ +/* { dg-do run } */ +/* { dg-options "-O2 -funroll-loops" } */ + +extern void abort (void); +unsigned long int s[24] + = { 12, ~1, 12, ~2, 12, ~4, 12, ~8, 12, ~16, 12, ~32, + 12, ~64, 12, ~128, 12, ~256, 12, ~512, 12, ~1024, 12, ~2048 }; +struct { int n; unsigned long *e[12]; } g + = { 12, { &s[0], &s[2], &s[4], &s[6], &s[8], &s[10], &s[12], &s[14], + &s[16], &s[18], &s[20], &s[22] } }; +int c[12]; + +__attribute__((noinline, noclone)) void +foo (void) +{ + int i, j; + for (i = 0; i < g.n; i++) + for (j = 0; j < g.n; j++) + { + if (i == j && j < g.e[0][0] && (g.e[i][1] & (1UL << j))) + abort (); + if (j < g.e[0][0] && (g.e[i][1] & (1UL << j))) + c[i]++; + } +} + +int +main () +{ + int i; + asm volatile ("" : "+m" (s), "+m" (g), "+m" (c)); + foo (); + for (i = 0; i < 12; i++) + if (c[i] != 11) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr48837.c b/gcc/testsuite/gcc.dg/pr48837.c new file mode 100644 index 00000000000..ffc65b9dc8c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48837.c @@ -0,0 +1,30 @@ +/* PR tree-optimization/48837 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +void abort (void); + +__attribute__((noinline)) +int baz(void) +{ + return 1; +} + +inline const int *bar(const int *a, const int *b) +{ + return *a ? a : b; +} + +int foo(int a, int b) +{ + return a || b ? baz() : foo(*bar(&a, &b), 1) + foo(1, 0); +} + +int main(void) +{ + if (foo(0, 0) != 2) + abort(); + + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/sibcall-3.c b/gcc/testsuite/gcc.dg/sibcall-3.c index e8798cc599f..c4460e2e522 100644 --- a/gcc/testsuite/gcc.dg/sibcall-3.c +++ b/gcc/testsuite/gcc.dg/sibcall-3.c @@ -5,7 +5,7 @@ Copyright (C) 2002 Free Software Foundation Inc. Contributed by Hans-Peter Nilsson <hp@bitrange.com> */ -/* { dg-do run { xfail { { arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ +/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ /* -mlongcall disables sibcall patterns. */ /* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ diff --git a/gcc/testsuite/gcc.dg/sibcall-4.c b/gcc/testsuite/gcc.dg/sibcall-4.c index 223c03c1218..4f468f6595e 100644 --- a/gcc/testsuite/gcc.dg/sibcall-4.c +++ b/gcc/testsuite/gcc.dg/sibcall-4.c @@ -5,7 +5,7 @@ Copyright (C) 2002 Free Software Foundation Inc. Contributed by Hans-Peter Nilsson <hp@bitrange.com> */ -/* { dg-do run { xfail { { arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ +/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ /* -mlongcall disables sibcall patterns. */ /* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ diff --git a/gcc/testsuite/gcc.dg/slp-1.c b/gcc/testsuite/gcc.dg/slp-1.c new file mode 100644 index 00000000000..bb352020f97 --- /dev/null +++ b/gcc/testsuite/gcc.dg/slp-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model" } */ + +struct R { + double d1; + double d2; +}; + +struct R foo (struct R arg) +{ + struct R ret; + ret.d1 = arg.d2 * (0.0 - arg.d1); + ret.d2 = ret.d1; + return ret; +} diff --git a/gcc/testsuite/gcc.dg/stack-layout-1.c b/gcc/testsuite/gcc.dg/stack-layout-1.c new file mode 100644 index 00000000000..389a4eb051e --- /dev/null +++ b/gcc/testsuite/gcc.dg/stack-layout-1.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-strict-aliasing -fdump-rtl-expand" } */ +union U { + int a; + float b; +}; +struct A { + union U u1; + char a[100]; +}; +void bar (struct A *); +void foo () + { + { + struct A a; + bar (&a); + } + { + struct A a; + bar (&a); + } + } + +/* { dg-final { scan-rtl-dump-times "Partition" 1 "expand" } } */ +/* { dg-final { cleanup-rtl-dump "expand" } } */ diff --git a/gcc/testsuite/gcc.dg/stack-layout-2.c b/gcc/testsuite/gcc.dg/stack-layout-2.c new file mode 100644 index 00000000000..5d5b385f675 --- /dev/null +++ b/gcc/testsuite/gcc.dg/stack-layout-2.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-rtl-expand" } */ +void bar( char *); +int foo() +{ + int i=0; + { + char a[8000]; + bar(a); + i += a[0]; + } + { + char a[8192]; + char b[32]; + bar(a); + i += a[0]; + bar(b); + i += a[0]; + } + return i; +} +/* { dg-final { scan-rtl-dump "size 8192" "expand" } } */ +/* { dg-final { scan-rtl-dump "size 32" "expand" } } */ diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c index 1d03a8dc994..321fec74d3a 100644 --- a/gcc/testsuite/gcc.dg/stack-usage-1.c +++ b/gcc/testsuite/gcc.dg/stack-usage-1.c @@ -30,9 +30,20 @@ # else # define SIZE 248 # endif +#elif defined (__powerpc64__) || defined (__ppc64__) || defined (__POWERPC64__) \ + || defined (__PPC64__) +# define SIZE 180 #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \ || defined (__POWERPC__) || defined (PPC) || defined (_IBMR2) -# define SIZE 240 +# if defined (__ALTIVEC__) +# if defined (__APPLE__) +# define SIZE 204 +# else +# define SIZE 220 +# endif +# else +# define SIZE 240 +# endif #elif defined (__AVR__) # define SIZE 254 #elif defined (__s390x__) diff --git a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp deleted file mode 100644 index a18b11d1580..00000000000 --- a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (C) 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING3. If not see -# <http://www.gnu.org/licenses/>. - -# Test the functionality of programs compiled with profile-directed structure -# rearrangement using -fprofile-generate followed by -fprofile-use. - -load_lib gcc-dg.exp -load_lib target-supports.exp - -set STRUCT_REORG_CFLAGS "-O3 -fipa-struct-reorg -fdump-ipa-all -fwhole-program" - -# Initialize `dg'. -dg-init - -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wo_prof_*.c]] "" $STRUCT_REORG_CFLAGS - -dg-final - -# Some targets don't support tree profiling. -if { ![check_profiling_available ""] } { - return -} - -# The procedures in profopt.exp need these parameters. -set tool gcc -set prof_ext "gcda" - -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - -if $tracelevel then { - strace $tracelevel -} - -# Load support procs. -load_lib profopt.exp - -# These are globals used by profopt-execute. The first is options -# needed to generate profile data, the second is options to use the -# profile data. -set common "-O3 -fwhole-program" -set profile_option [concat $common " -fprofile-generate"] -set feedback_option [concat $common " -fprofile-use -fipa-struct-reorg -fdump-ipa-all"] - -foreach src [lsort [glob -nocomplain $srcdir/$subdir/w_prof_*.c]] { - # If we're only testing specific files and this isn't one of them, skip it. - if ![runtest_file_p $runtests $src] then { - continue - } - profopt-execute $src -} - -set feedback_option [concat $feedback_option " --param struct-reorg-cold-struct-ratio=30"] - -foreach src [lsort [glob -nocomplain $srcdir/$subdir/w_ratio_*.c]] { - # If we're only testing specific files and this isn't one of them, skip it. - if ![runtest_file_p $runtests $src] then { - continue - } - profopt-execute $src -} diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c deleted file mode 100644 index ca3643e43de..00000000000 --- a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#define N 1000 -str_t A[N]; - -int -main () -{ - int i; - - for (i = 0; i < N; i++) - { - A[i].a = 0; - } - - for (i = 0; i < N; i++) - if (A[i].a != 0) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c deleted file mode 100644 index baff45d917d..00000000000 --- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c +++ /dev/null @@ -1,43 +0,0 @@ -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -str_t *p; - -int -main () -{ - int i, sum; - - p = malloc (N * sizeof (str_t)); - if (p == NULL) - return 0; - for (i = 0; i < N; i++) - p[i].b = i; - - for (i = 0; i < N; i++) - p[i].a = p[i].b + 1; - - for (i = 0; i < N; i++) - if (p[i].a != p[i].b + 1) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c deleted file mode 100644 index 8953264fea1..00000000000 --- a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c +++ /dev/null @@ -1,38 +0,0 @@ -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -int -main () -{ - int i; - str_t A[N]; - - for (i = 0; i < N; i++) - { - A[i].a = 0; - } - - for (i = 0; i < N; i++) - if (A[i].a != 0) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c deleted file mode 100644 index 9a23f8d53a8..00000000000 --- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c +++ /dev/null @@ -1,41 +0,0 @@ -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -int -main () -{ - int i, sum; - - str_t * p = malloc (N * sizeof (str_t)); - if (p == NULL) - return 0; - for (i = 0; i < N; i++) - p[i].b = i; - - for (i = 0; i < N; i++) - p[i].a = p[i].b + 1; - - for (i = 0; i < N; i++) - if (p[i].a != p[i].b + 1) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c deleted file mode 100644 index b0202399104..00000000000 --- a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c +++ /dev/null @@ -1,33 +0,0 @@ -#include <stdlib.h> -typedef struct -{ - int a; - int b; -}str_t; - -#define N 3 - -str_t str; - -int -main () -{ - int i; - int res = 1<<(1<<N); - str.a = 2; - - for (i = 0; i < N; i++) - str.a = str.a * str.a; - - if (str.a != res) - abort (); - - /* POSIX ignores all but the 8 low-order bits, but other - environments may not. */ - return (str.a & 255); -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { cleanup-ipa-dump "*" } } */ - diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c deleted file mode 100644 index e9de98c3b8a..00000000000 --- a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c +++ /dev/null @@ -1,66 +0,0 @@ -#include <stdlib.h> - -typedef struct -{ - int a; - float b; -}str_t1; - -typedef struct -{ - int c; - float d; -}str_t2; - -#ifdef STACK_SIZE -#if STACK_SIZE > 16000 -#define N 1000 -#else -#define N (STACK_SIZE/16) -#endif -#else -#define N 1000 -#endif - -str_t1 *p1; -str_t2 *p2; -int num; - -void -foo (void) -{ - int i; - - for (i=0; i < num; i++) - p2[i].c = 2; -} - -int -main () -{ - int i, r; - - r = rand (); - num = r > N ? N : r; - p1 = malloc (num * sizeof (str_t1)); - p2 = malloc (num * sizeof (str_t2)); - - if (p1 == NULL || p2 == NULL) - return 0; - - for (i = 0; i < num; i++) - p1[i].a = 1; - - foo (); - - for (i = 0; i < num; i++) - if (p1[i].a != 1 || p2[i].c != 2) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { cleanup-ipa-dump "*" } } */ - diff --git a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c deleted file mode 100644 index 3c26e3be7b6..00000000000 --- a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c +++ /dev/null @@ -1,43 +0,0 @@ -#include <stdlib.h> -typedef struct -{ - int a; - int b; -}str_t1; - -typedef struct -{ - float a; - float b; -}str_t2; - -#define N1 1000 -#define N2 100 -str_t1 A1[N1]; -str_t2 A2[N2]; - -int -main () -{ - int i; - - for (i = 0; i < N1; i++) - A1[i].a = 0; - - for (i = 0; i < N2; i++) - A2[i].a = 0; - - for (i = 0; i < N1; i++) - if (A1[i].a != 0) - abort (); - - for (i = 0; i < N2; i++) - if (A2[i].a != 0) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c deleted file mode 100644 index 5d5e37b4f0e..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c +++ /dev/null @@ -1,27 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct basic -{ - int a; - int b[10]; -} type_struct; - -type_struct *str1; - -int main() -{ - int i; - - str1 = malloc (10 * sizeof (type_struct)); - - for (i=0; i<=9; i++) - str1[i].a = str1[i].b[0]; - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c deleted file mode 100644 index efb68be8bdd..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c +++ /dev/null @@ -1,39 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -int -main () -{ - int i; - str_t A[N]; - str_t *p = A; - - for (i = 0; i < N; i++) - p[i].a = 0; - - for (i = 0; i < N; i++) - if (p[i].a != 0) - abort (); - - return 0; -} - -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c deleted file mode 100644 index 77226b449c5..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c +++ /dev/null @@ -1,30 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> - -typedef struct test_struct -{ - int a; - int b; -} type_struct; - -typedef type_struct **struct_pointer2; - -struct_pointer2 str1; - -int main() -{ - int i, j; - - str1 = malloc (2 * sizeof (type_struct *)); - - for (i = 0; i <= 1; i++) - str1[i] = malloc (2 * sizeof (type_struct)); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c b/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c deleted file mode 100644 index 09668face34..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c +++ /dev/null @@ -1,45 +0,0 @@ -/* { dg-do run } */ - -#include <stdlib.h> - -struct S { int a; struct V *b; }; -typedef struct { int c; } T; -typedef struct { int d; int e; } U; - -void * -fn (void *x) -{ - return x; -} - -int -foo (struct S *s) -{ - T x; - - T y = *(T *)fn (&x); - return y.c; -} - -int -bar (struct S *s) -{ - U x; - - U y = *(U *)fn (&x); - return y.d + s->a; -} - -int -main () -{ - struct S s; - - foo(&s) + bar (&s); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c deleted file mode 100644 index 0116d819800..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c +++ /dev/null @@ -1,44 +0,0 @@ -/* { dg-do run } */ - -#include <stdlib.h> -struct str -{ - int a; - float b; -}; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -int -foo (struct str * p_str) -{ - static int sum = 0; - - sum = sum + p_str->a; - return sum; -} - -int -main () -{ - int i, sum; - struct str * p = malloc (N * sizeof (struct str)); - if (p == NULL) - return 0; - for (i = 0; i < N; i++) - sum = foo (p+i); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "is passed to local function...Excluded." "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c deleted file mode 100644 index 21a6a7f3a2e..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c +++ /dev/null @@ -1,31 +0,0 @@ -/* { dg-do run } */ - -#include <stdlib.h> - -struct A { - int d; -}; - -struct A a; - -struct A foo () -{ - a.d = 5; - return a; -} - -int -main () -{ - a.d = 0; - foo (); - - if (a.d != 5) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "is return type of function...Excluded" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c deleted file mode 100644 index 6da3420f6e8..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c +++ /dev/null @@ -1,33 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - int b; -}str_t; - -#define N 2 - -str_t A[2] = {{1,1},{2,2}}; - -int -main () -{ - int i; - - for (i = 0; i < N; i++) - A[i].b = A[i].a; - - for (i = 0; i < N; i++) - if (A[i].b != A[i].a) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "is initialized...Excluded" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ - diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c deleted file mode 100644 index bd03ec42f05..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#define N 1000 - -typedef struct -{ - str_t A[N]; - int c; -}str_with_substr_t; - -str_with_substr_t a; - -int -main () -{ - int i; - - for (i = 0; i < N; i++) - a.A[i].b = 0; - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c deleted file mode 100644 index 59e0e48321a..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c +++ /dev/null @@ -1,49 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 16000 -#define N 1000 -#else -#define N (STACK_SIZE/16) -#endif -#else -#define N 1000 -#endif - -typedef struct -{ - str_t * sub_str; - int c; -}str_with_substr_t; - -int foo; - -int -main (void) -{ - int i; - str_with_substr_t A[N]; - str_t a[N]; - - for (i=0; i < N; i++) - A[i].sub_str = &(a[i]); - - for (i=0; i < N; i++) - A[i].sub_str->a = 5; - - foo = A[56].sub_str->a; - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c deleted file mode 100644 index a6b32ddd688..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c +++ /dev/null @@ -1,46 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - - -typedef struct -{ - str_t sub_str; - int c; -}str_with_substr_t; - -int -main () -{ - int i; - str_with_substr_t A[N]; - - for (i = 0; i < N; i++) - A[i].sub_str.a = 5; - - for (i = 0; i < N; i++) - if (A[i].sub_str.a != 5) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c deleted file mode 100644 index b61e26b1248..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c +++ /dev/null @@ -1,33 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#define N 1000 -str_t A[N]; - -int -main () -{ - int i; - - for (i = 0; i < N; i++) - { - A[i].a = 0; - } - - for (i = 0; i < N; i++) - if (A[i].a != 0) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c deleted file mode 100644 index 39351e072e2..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c +++ /dev/null @@ -1,46 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -str_t *p; - -int -main () -{ - int i, sum; - - p = malloc (N * sizeof (str_t)); - if (p == NULL) - return 0; - for (i = 0; i < N; i++) - p[i].b = i; - - for (i = 0; i < N; i++) - p[i].b = p[i].a + 1; - - for (i = 0; i < N; i++) - if (p[i].b != p[i].a + 1) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c deleted file mode 100644 index 18d5a734740..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c +++ /dev/null @@ -1,41 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -int -main () -{ - int i; - str_t A[N]; - - for (i = 0; i < N; i++) - { - A[i].a = 0; - } - - for (i = 0; i < N; i++) - if (A[i].a != 0) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c deleted file mode 100644 index 26a9dbd7314..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c +++ /dev/null @@ -1,44 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -int -main () -{ - int i, sum; - - str_t * p = malloc (N * sizeof (str_t)); - if (p == NULL) - return 0; - for (i = 0; i < N; i++) - p[i].b = i; - - for (i = 0; i < N; i++) - p[i].b = p[i].a + 1; - - for (i = 0; i < N; i++) - if (p[i].b != p[i].a + 1) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c deleted file mode 100644 index 6caadcf1230..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 8000 -#define N 1000 -#else -#define N (STACK_SIZE/8) -#endif -#else -#define N 1000 -#endif - -int -main () -{ - int i, num; - - num = rand(); - num = num > N ? N : num; - str_t * p = malloc (num * sizeof (str_t)); - - if (p == 0) - return 0; - - for (i = 0; i < num; i++) - p[i].b = i; - - for (i = 0; i < num; i++) - p[i].a = p[i].b + 1; - - for (i = 0; i < num; i++) - if (p[i].a != p[i].b + 1) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c deleted file mode 100644 index 8f116df4d01..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c +++ /dev/null @@ -1,43 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - float b; - int c; - float d; -}str_t; - -#ifdef STACK_SIZE -#if STACK_SIZE > 1600 -#define N 100 -#else -#define N (STACK_SIZE/16) -#endif -#else -#define N 100 -#endif - -int -main () -{ - int i; - str_t *p = malloc (N * sizeof (str_t)); - if (p == NULL) - return 0; - for (i = 0; i < N; i++) - p[i].a = 5; - - for (i = 0; i < N; i++) - if (p[i].a != 5) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* The structure str_t is erroneously peeled into 4 structures instead of 2. */ -/* { dg-final { scan-ipa-dump "the number of new types is 2" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c deleted file mode 100644 index 812763d53ff..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c +++ /dev/null @@ -1,35 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - int b; -}str_t; - -#define N 3 - -str_t str; - -int -main () -{ - int i; - int res = 1<<(1<<N); - str.a = 2; - - for (i = 0; i < N; i++) - str.a = str.a * str.a; - - if (str.a != res) - abort (); - - /* POSIX ignores all but the 8 low-order bits, but other - environments may not. */ - return (str.a & 255); -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c deleted file mode 100644 index 313af1080c1..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c +++ /dev/null @@ -1,35 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - int b; -}str_t; - -#define N 3 - -int -main () -{ - int i; - int res = 1<<(1<<N); - str_t str; - - str.a = 2; - - for (i = 0; i < N; i++) - str.a = str.a * str.a; - - if (str.a != res) - abort (); - - /* POSIX ignores all but the 8 low-order bits, but other - environments may not. */ - return (str.a & 255); -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_pointer.c deleted file mode 100644 index bd70dfb6375..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_pointer.c +++ /dev/null @@ -1,40 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> -typedef struct -{ - int a; - int *b; -}str_t; - -#define N 3 - -str_t *p; - -int -main () -{ - str_t str; - int i; - int res = 1 << (1 << N); - p = &str; - str.a = 2; - - p->b = &(p->a); - - for (i=0; i < N; i++) - p->a = *(p->b)*(*(p->b)); - - if (p->a != res) - abort (); - - /* POSIX ignores all but the 8 low-order bits, but other - environments may not. */ - return (p->a & 255); -} - -/*--------------------------------------------------------------------------*/ -/* The access &(p->a) is handled incorrectly in ipa-struct-reorg.c. */ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c deleted file mode 100644 index 92da94d2923..00000000000 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c +++ /dev/null @@ -1,68 +0,0 @@ -/* { dg-do compile } */ -/* { dg-do run } */ - -#include <stdlib.h> - -typedef struct -{ - int a; - float b; -}str_t1; - -typedef struct -{ - int c; - float d; -}str_t2; - -#ifdef STACK_SIZE -#if STACK_SIZE > 16000 -#define N 1000 -#else -#define N (STACK_SIZE/16) -#endif -#else -#define N 1000 -#endif - -str_t1 *p1; -str_t2 *p2; -int num; - -void -foo (void) -{ - int i; - - for (i=0; i < num; i++) - p2[i].c = 2; -} - -int -main () -{ - int i, r; - - r = rand (); - num = r > N ? N : r; - p1 = malloc (num * sizeof (str_t1)); - p2 = malloc (num * sizeof (str_t2)); - - if (p1 == NULL || p2 == NULL) - return 0; - - for (i = 0; i < num; i++) - p1[i].a = 1; - - foo (); - - for (i = 0; i < num; i++) - if (p1[i].a != 1 || p2[i].c != 2) - abort (); - - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail *-*-* } } } */ -/* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/20090618-1.c b/gcc/testsuite/gcc.dg/torture/20090618-1.c index 8b601d62c79..60eb900785e 100644 --- a/gcc/testsuite/gcc.dg/torture/20090618-1.c +++ b/gcc/testsuite/gcc.dg/torture/20090618-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ +/* { dg-skip-if "PR middle-end/47405" { mips-sgi-irix* } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/torture/pr37868.c b/gcc/testsuite/gcc.dg/torture/pr37868.c index 1f89dff2fff..c5df71b5aa5 100644 --- a/gcc/testsuite/gcc.dg/torture/pr37868.c +++ b/gcc/testsuite/gcc.dg/torture/pr37868.c @@ -1,6 +1,6 @@ /* { dg-do run } */ /* { dg-options "-fno-strict-aliasing" } */ -/* { dg-skip-if "unaligned access" { sparc*-*-* } "*" "" } */ +/* { dg-skip-if "unaligned access" { sparc*-*-* sh*-*-* } "*" "" } */ extern void abort (void); #if (__SIZEOF_INT__ <= 2) diff --git a/gcc/testsuite/gcc.dg/torture/pr43165.c b/gcc/testsuite/gcc.dg/torture/pr43165.c index 637fb464625..991c3d118b9 100644 --- a/gcc/testsuite/gcc.dg/torture/pr43165.c +++ b/gcc/testsuite/gcc.dg/torture/pr43165.c @@ -1,5 +1,6 @@ /* PR debug/43165 */ /* { dg-options "-g" } */ +/* { dg-require-effective-target int32plus } */ struct __attribute__((packed)) S { diff --git a/gcc/testsuite/gcc.dg/torture/pr47228.c b/gcc/testsuite/gcc.dg/torture/pr47228.c index 5bc9f0ad511..4ee7cab4dcd 100644 --- a/gcc/testsuite/gcc.dg/torture/pr47228.c +++ b/gcc/testsuite/gcc.dg/torture/pr47228.c @@ -1,4 +1,5 @@ /* { dg-do run } */ +/* { dg-require-effective-target int32plus } */ struct S4 { diff --git a/gcc/testsuite/gcc.dg/torture/pr47725.c b/gcc/testsuite/gcc.dg/torture/pr47725.c new file mode 100644 index 00000000000..03d5d36c321 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47725.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ + +struct _Unwind_Context +{ + void *reg[17]; + void *ra; +}; +extern void bar (struct _Unwind_Context *); +void +__frame_state_for (void *pc_target) +{ + struct _Unwind_Context context; + __builtin_memset (&context, 0, sizeof (struct _Unwind_Context)); + context.ra = pc_target; + bar (&context); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr47917.c b/gcc/testsuite/gcc.dg/torture/pr47917.c new file mode 100644 index 00000000000..831305d601a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47917.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-std=c99" } */ +/* { dg-options "-std=c99 -D_ISO_C_SOURCE=19990L" { target alpha*-dec-osf5* } } */ +/* { dg-options "-std=c99 -D_XOPEN_SOURCE=500" { target mips-sgi-irix6.5 *-*-solaris2.[89] } } */ +/* { dg-options "-std=gnu99" { target *-*-hpux* } } */ +/* { dg-xfail-if "no C99 snprintf function" { *-*-hpux10* } } */ +/* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } } */ + +/* PR middle-end/47917 */ + +#include <stdio.h> +extern int memcmp (const void *, const void *, __SIZE_TYPE__); +extern void abort (void); + +char buf1[6], buf2[6], buf3[4], buf4[4]; +int i; + +int +foo (void) +{ + int ret = snprintf (buf1, sizeof buf1, "abcde"); + ret += snprintf (buf2, sizeof buf2, "abcdef") * 16; + ret += snprintf (buf3, sizeof buf3, "%s", i++ < 6 ? "abc" : "def") * 256; + ret += snprintf (buf4, sizeof buf4, "%s", i++ > 10 ? "abcde" : "defgh") * 4096; + return ret; +} + +int +main (void) +{ + if (foo () != 5 + 6 * 16 + 3 * 256 + 5 * 4096) + abort (); + if (memcmp (buf1, "abcde", 6) != 0 + || memcmp (buf2, "abcde", 6) != 0 + || memcmp (buf3, "abc", 4) != 0 + || memcmp (buf4, "def", 4) != 0 + || i != 2) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr48146.c b/gcc/testsuite/gcc.dg/torture/pr48146.c new file mode 100644 index 00000000000..c208325311c --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr48146.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ + +static unsigned char +safe_sub_func_int_s_s (int si1, unsigned char si2) +{ + return si1 ^ si2 & -si2 ^ si2 ? : si1 - si2; +} + +int g_2[10] = { + 0x90AC204EL +}; + +volatile unsigned char g_39; + +unsigned char +func_67 (unsigned short p_68) +{ + unsigned char l_92; + unsigned char l_74; + int *l = &g_2[6]; +lbl_90:*l ^= 1; + if (p_68) + goto lbl_93; + for (l_74 = 0;; l_74 = safe_sub_func_int_s_s (l_74, 1)) + { + if (l_74) + goto lbl_90; +lbl_93:l_92 ^= 0 != &g_39; + if (0) + { + } + else + *l = 1; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr48343.c b/gcc/testsuite/gcc.dg/torture/pr48343.c new file mode 100644 index 00000000000..e56b3a3dae3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr48343.c @@ -0,0 +1,19 @@ +/* PR debug/48343 */ +/* { dg-do compile } */ +/* { dg-options "-fcompare-debug" } */ + +void foo (unsigned char *, unsigned char *); + +void +test (unsigned int x, int y) +{ + unsigned int i, j = 0, k; + unsigned char s[256], t[64]; + foo (s, t); + t[0] = y; + for (i = 0; i < 256; i++) + { + j = (j + s[i] + t[i % x]) & 0xff; + k = i; i = j; j = k; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr48694-1.c b/gcc/testsuite/gcc.dg/torture/pr48694-1.c new file mode 100644 index 00000000000..810366bc8b4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr48694-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +extern volatile int g_89[5][9]; +extern int g, *gp; +void func_64() +{ + int i; + for (i = 0; i < 1; ) + { + for (g = 0; g < 1; ) + return; + gp = (int *)&g_89[g][0]; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr48694-2.c b/gcc/testsuite/gcc.dg/torture/pr48694-2.c new file mode 100644 index 00000000000..4791ac3f70c --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr48694-2.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +extern volatile int g_4[1][4]; +extern int g_7; +void modify(int *); +void func_2() +{ + int l_46 = 4; + if (g_7) + modify(&l_46); + else + { + int i; + for (i = 0; i != 5; i += 1) + { + volatile int *vp = &g_4[0][l_46]; + *vp = 0; + } + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr48731.c b/gcc/testsuite/gcc.dg/torture/pr48731.c new file mode 100644 index 00000000000..74b77f67c52 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr48731.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ + +#include <stdarg.h> + +int blah(int a, ...) +{ + va_list va; + va_start(va,a); + if (a == 0) + return -1; + else + { + int i; + for (i = 0; i < a; i++) + va_arg(va,int); + return va_arg(va,int); + } +} + +__attribute((flatten)) +int blah2(int b, int c) +{ + return blah(2, b, c); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr48822.c b/gcc/testsuite/gcc.dg/torture/pr48822.c new file mode 100644 index 00000000000..b619f369b4f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr48822.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +void foo (int *, int *); +int bar () +{ + int a = 0; + int b = 0; + if (b != 0) + { + int ax = a; + int bx = b; + while (bx != 0) + { + int tem = ax % bx; + ax = bx; + bx = tem; + } + } + foo (&a, &b); +} diff --git a/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c b/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c index bdb2acb0464..5dc041b0edd 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fno-tree-sra -fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-ealias" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ struct X @@ -12,10 +12,11 @@ struct X } y; }; int i; -static int +static int __attribute__((always_inline)) foo (struct X *x) { struct Y y = x->y; + /* In the inlined instance the dereferenced pointer needs to point to i. */ *y.p = 0; i = 1; return *y.p; @@ -30,5 +31,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump "points-to vars: { i }" "alias" } } */ -/* { dg-final { cleanup-tree-dump "alias" } } */ +/* { dg-final { scan-tree-dump "points-to vars: { i }" "ealias" } } */ +/* { dg-final { cleanup-tree-dump "ealias" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c index 08ca95d765c..d198c9a97f9 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c @@ -1,8 +1,8 @@ /* { dg-do run } */ +extern void exit (int); #if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) extern void abort (void); -extern void exit (int); int s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;} int x(){return s(0)==1&&s(1)==0&&s(2)==1;} int main(){if(x()!=1)abort();exit(0);} diff --git a/gcc/testsuite/gcc.dg/torture/va-arg-25.c b/gcc/testsuite/gcc.dg/torture/va-arg-25.c index 8496460d28c..8c0da549d08 100644 --- a/gcc/testsuite/gcc.dg/torture/va-arg-25.c +++ b/gcc/testsuite/gcc.dg/torture/va-arg-25.c @@ -3,6 +3,8 @@ /* { dg-do run } */ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-options "-mabi=altivec -maltivec" { target { powerpc-*-* powerpc64-*-* } } } */ +/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64--*-* } } } */ #include <stdarg.h> #include <stdlib.h> diff --git a/gcc/testsuite/gcc.dg/torture/vector-1.c b/gcc/testsuite/gcc.dg/torture/vector-1.c index 9ab78aaf53e..205fee6d6de 100644 --- a/gcc/testsuite/gcc.dg/torture/vector-1.c +++ b/gcc/testsuite/gcc.dg/torture/vector-1.c @@ -3,6 +3,8 @@ /* { dg-do run } */ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-options "-mabi=altivec" { target { powerpc-*-* powerpc64-*-* } } } */ +/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64--*-* } } } */ #define vector __attribute__((vector_size(16) )) diff --git a/gcc/testsuite/gcc.dg/torture/vector-2.c b/gcc/testsuite/gcc.dg/torture/vector-2.c index bff9f82cdad..6cc56cfae78 100644 --- a/gcc/testsuite/gcc.dg/torture/vector-2.c +++ b/gcc/testsuite/gcc.dg/torture/vector-2.c @@ -3,6 +3,8 @@ /* { dg-do run } */ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-options "-mabi=altivec" { target { powerpc-*-* powerpc64-*-* } } } */ +/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64--*-* } } } */ #define vector __attribute__((vector_size(16) )) diff --git a/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c b/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c new file mode 100644 index 00000000000..316cfc75734 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c @@ -0,0 +1,25 @@ +/* { dg-options "-O2 -w" } */ + +#include <stdio.h> +#include <stdlib.h> + +#ifdef _PROFILE_USE +int foo(int x) { + return 3 * x; +} +#else +int foo(int x) { + return 3 * x; +} +#endif + +int x = 1000; + +int main(int argc, char *argv[]) { + int i; + int sum = 0; + for (i = 0; i < x; i++) + sum += i; + printf("%d\n", sum); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c index f96255d0c19..97c91de8d61 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c @@ -26,7 +26,7 @@ main () /* { dg-final-use { scan-ipa-dump "Mod power of 2 transformation on insn" "tree_profile_ipa" } } */ /* This is part of code checking that n is power of 2, so we are sure that the transformation didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ 0xffff" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ (4294967295|0x0*ffffffff)" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c index 6007949546e..5e6828b6f4f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fstrict-aliasing -fdump-tree-fre" } */ +/* { dg-options "-O1 -fstrict-aliasing -fdump-tree-fre1" } */ __extension__ typedef __SIZE_TYPE__ size_t; extern void *xmalloc (size_t) __attribute__ ((__malloc__)); @@ -34,5 +34,5 @@ find_unreachable_blocks (void) able to determine that modifying e->dest->flags does not modify e or e->dest if we can assert strict-aliasing rules. The net result is that we only need one load of e->dest. */ -/* { dg-final { scan-tree-dump-times "->dest" 1 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "->dest" 1 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c index e86acbc1900..69c2e23c915 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fdump-tree-fre1-details -fdump-tree-optimized" } */ struct A { int i; @@ -76,15 +76,15 @@ int test8 (struct A *p, int *q) return *q; } -/* { dg-final { scan-tree-dump "with 0" "fre" } } */ -/* { dg-final { scan-tree-dump "with 1" "fre" } } */ -/* { dg-final { scan-tree-dump "with 3" "fre" } } */ -/* { dg-final { scan-tree-dump "with 4" "fre" } } */ -/* { dg-final { scan-tree-dump "with 5" "fre" } } */ -/* { dg-final { scan-tree-dump "with 8" "fre" } } */ +/* { dg-final { scan-tree-dump "with 0" "fre1" } } */ +/* { dg-final { scan-tree-dump "with 1" "fre1" } } */ +/* { dg-final { scan-tree-dump "with 3" "fre1" } } */ +/* { dg-final { scan-tree-dump "with 4" "fre1" } } */ +/* { dg-final { scan-tree-dump "with 5" "fre1" } } */ +/* { dg-final { scan-tree-dump "with 8" "fre1" } } */ /* { dg-final { scan-tree-dump-not "return 2;" "optimized" } } */ /* { dg-final { scan-tree-dump-not "return 6;" "optimized" } } */ /* { dg-final { scan-tree-dump-not "return 7;" "optimized" } } */ /* { dg-final { scan-tree-dump-not "return -1;" "optimized" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c b/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c new file mode 100644 index 00000000000..64fef27874a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c @@ -0,0 +1,61 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */ + +typedef unsigned u32; +typedef unsigned short u16; +typedef unsigned char u8; +struct biosregs { + union { + struct { + u32 edi; + u32 esi; + u32 ebp; + u32 _esp; + u32 ebx; + u32 edx; + u32 ecx; + u32 eax; + u32 _fsgs; + u32 _dses; + u32 eflags; + }; + struct { + u16 di, hdi; + u16 si, hsi; + u16 bp, hbp; + u16 _sp, _hsp; + u16 bx, hbx; + u16 dx, hdx; + u16 cx, hcx; + u16 ax, hax; + u16 gs, fs; + u16 es, ds; + u16 flags, hflags; + }; + struct { + u8 dil, dih, edi2, edi3; + u8 sil, sih, esi2, esi3; + u8 bpl, bph, ebp2, ebp3; + u8 _spl, _sph, _esp2, _esp3; + u8 bl, bh, ebx2, ebx3; + u8 dl, dh, edx2, edx3; + u8 cl, ch, ecx2, ecx3; + u8 al, ah, eax2, eax3; + }; + }; +}; +void initregs(struct biosregs *regs); +void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg); +static u32 *const gp = (u32*) 0x32; +void keyboard_set_repeat(void) +{ + struct biosregs ireg; + *gp = 10; + initregs(&ireg); + ireg.ax = 0x0305; + intcall(0x16, &ireg, ((void *)0)); +} + +/* { dg-final { scan-tree-dump-times "ireg.*ax" 1 "optimized"} } */ + +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c b/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c new file mode 100644 index 00000000000..01d1fd1195d --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-optimized" } */ + +float +quantum_real(float _Complex a) +{ + float *p = (float *) &a; + return p[0]; +} +float +quantum_imag(float _Complex a) +{ + float *p = (float *) &a; + return p[1]; +} +float +quantum_foo(float _Complex a) +{ + float *p = (float *) &a; + return p[2]; +} + +/* { dg-final { scan-tree-dump-times "REALPART_EXPR" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "IMAGPART_EXPR" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c b/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c index a3c6a2ece88..d74022e4b52 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c @@ -11,6 +11,6 @@ int foo(char *b) /* Folding should have determined that the two addresses were not identical and thus collapsed the function into a trivial "return 0". */ -/* { dg-final { scan-tree-dump-times "return 0" 1 "original" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "return 0" 1 "original" } } */ /* { dg-final { cleanup-tree-dump "original" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c index fa64ae14cc4..3cfe44d1bd2 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-fre" } */ +/* { dg-options "-O1 -fdump-tree-fre1" } */ void arf () @@ -7,5 +7,5 @@ arf () if (""[0] == 0) blah (); } -/* { dg-final { scan-tree-dump-times "= 0;" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "= 0;" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c index b46b8ece816..5ca8060c8b3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ int b; unsigned a; @@ -18,5 +18,5 @@ void test2(void) conversion to int. FRE should then be able to replace the rhs of the store to b by 1. */ -/* { dg-final { scan-tree-dump "Replaced\[^\\n\]*with 1" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced\[^\\n\]*with 1" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c index cc583e293f8..d02a62d3d34 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-fre -W -Wall -fno-early-inlining" } */ +/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-fre1 -W -Wall -fno-early-inlining" } */ int b; unsigned a; @@ -16,6 +16,6 @@ void f(void) /* We should have converted the assignments to two = 1. FRE does this. */ /* { dg-final { scan-tree-dump-times " = 1" 2 "optimized"} } */ -/* { dg-final { scan-tree-dump-not " = a;" "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-not " = a;" "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c b/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c index 599d1f1efd5..c6c142b4eaf 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c @@ -1,5 +1,5 @@ -/* { dg-options "-O2 -fdump-tree-fre -w" } */ -/* { dg-options "-O2 -fdump-tree-fre -w -msse" { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-options "-O2 -fdump-tree-fre1 -w" } */ +/* { dg-options "-O2 -fdump-tree-fre1 -w -msse" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-do compile } */ #define vector __attribute__((vector_size(sizeof(int)*4) )) struct s { vector int i; }; @@ -32,6 +32,6 @@ void a2 (struct s1 sv, int i) g(&sv, *(float*)&sv.i); } -/* { dg-final { scan-tree-dump-times "sv_\[0-9\]\\\(D\\\)->i" 2 "fre" } } */ -/* { dg-final { scan-tree-dump-times "sv.i" 2 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "sv_\[0-9\]\\\(D\\\)->i" 2 "fre1" } } */ +/* { dg-final { scan-tree-dump-times "sv.i" 2 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-10.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-10.c new file mode 100644 index 00000000000..1d7aeef2aa0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-10.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -fdump-tree-optimized -fno-partial-inlining" } */ +void do_something1(void); +void do_something2(void); +void do_something3(void); +void do_something4(void); +void do_something5(void); +void do_something_big(int); + +int do_something (int size) +{ + if (__builtin_constant_p (size)) + switch (size) + { + case 1:do_something1 (); break; + case 2:do_something2 (); break; + case 5:do_something1 (); do_something1 (); + case 3:do_something3 (); break; + case 4:do_something4 (); break; + } + else + do_something_big (size); +} +extern int n; +main() +{ + do_something (2); + do_something (3); + do_something (5); + do_something (70); +} +/* All calls should be inlined, except for do_something (5). */ +/* { dg-final { scan-tree-dump-not "do_something1" "optimized" } } */ +/* { dg-final { scan-tree-dump-times "do_something2" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "do_something3" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "do_something \\(5\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-not "do_something \\(70\\)" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c new file mode 100644 index 00000000000..3215473ec1a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O -finline-small-functions --param early-inlining-insns=0 -fdump-tree-einline" } */ + +int foo0(); +void bar0() { foo0(); } +void foobar0() { bar0(); } + +void foo1(); +void bar1() { foo1(); } +void foobar1() { bar1(); } + +#if 0 +int foo2(); +int bar2() { return foo2(); } +/* The size estimate fails to see that inlining the call statement in bar2 + will make its lhs dead. */ +void foobar2() { bar2(); } +#endif + +int foo3(); +int bar3() { return foo3(); } +int foobar3() { return bar3(); } + +int bar4() { return 0; } +void foobar4() { bar4(); } + +int bar5() { return 0; } +int foobar5() { return bar5(); } + +/* { dg-final { scan-tree-dump-times "Inlining" 5 "einline" } } */ +/* { dg-final { cleanup-tree-dump "einline" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-9.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-9.c new file mode 100644 index 00000000000..678dd852db6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-9.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -fdump-tree-optimized -fno-partial-inlining" } */ + +/* When optimizing for size, t should be inlined when it expands to one call only. */ +extern int q(int); +int t(int a) +{ + if (a > 12) + { + q(a+5); + q(a+5); + } + else + q(a+10); +} + +main() +{ + t(5); + t(20); +} +/* { dg-final { scan-tree-dump-times "q \\(15\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "t \\(20\\)" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c b/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c new file mode 100644 index 00000000000..b102a7a52e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized -fno-strict-aliasing" } */ +/* Test with fixed address */ +static int *foo = (int *) (unsigned long) 0x7800000; + +int func(void) __attribute__ ((noinline)); + +extern int bar(void); + +int func(void) +{ + if (*foo) { + return 1; + } + return 0; + +} + +int foobar(void) +{ + + if (func()) { + *foo = 1; + } + return func(); +} + +/* { dg-final { scan-tree-dump-times "= func" 2 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c index e6130bbe7bd..6fc2a57a9f2 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre" } */ +/* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */ #include <stddef.h> union tree_node; @@ -73,8 +73,8 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump-not "= unexpanded_var_list;" "fre" } } */ +/* { dg-final { scan-tree-dump-not "= unexpanded_var_list;" "fre1" } } */ /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */ /* { dg-final { scan-tree-dump-times "Insertions: 2" 1 "pre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ /* { dg-final { cleanup-tree-dump "pre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c b/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c index eb360551561..20608156f3c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c @@ -18,5 +18,5 @@ int foo(const struct XX* r) { return 1; } -/* { dg-final { scan-tree-dump-times "&" 0 "forwprop2" } } */ +/* { dg-final { scan-tree-dump-times "= &" 0 "forwprop2" } } */ /* { dg-final { cleanup-tree-dump "forwprop2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c index fc33d74e9ff..dcfa131510c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ int foo (int *p) @@ -9,5 +9,5 @@ foo (int *p) } /* The store to *p should be propagated to the load statement. */ -/* { dg-final { scan-tree-dump "Replaced \\\*p_.\\\(D\\\) with 0" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\*p_.\\\(D\\\) with 0" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr23382.c b/gcc/testsuite/gcc.dg/tree-ssa/pr23382.c deleted file mode 100644 index fd74af8d6a1..00000000000 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr23382.c +++ /dev/null @@ -1,17 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-pre-details" } */ -struct a -{ - int length; - int a1[256]; -}; - -void *malloc(__SIZE_TYPE__ size) __attribute__((malloc)); - -int f(void) -{ - struct a *a = malloc(sizeof(struct a)); - return a->length; -} -/* { dg-final { scan-tree-dump-times "Variable: HEAP" 1 "pre"} } */ -/* { dg-final { cleanup-tree-dump "pre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c b/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c index 6845324e41a..21b33513061 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c @@ -17,6 +17,7 @@ #define PORTC _SFR_IO8(0x15) #define PORTD _SFR_IO8(0x12) + static void delay_wait_us( unsigned char timeout ) { __asm__ __volatile__ ("wdr"); @@ -27,8 +28,12 @@ static void delay_wait_us( unsigned char timeout ) { while(!(TIFR & (1 << (TOV0)))); } +/* The original testcase was multiplying by 1000. Gcc is now smart enough + to work out that actual parameter is 5000 that is not what testcase was + about. Obstructate the code somewhat then. */ +int a; static void delay_wait_us_ms( unsigned char timeout ) { - delay_wait_us( timeout * 1000 ); + delay_wait_us( timeout * a ); } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c b/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c index 1e0dabdee8b..85b2b159766 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-require-effective-target int32plus } */ void baz (unsigned); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c b/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c index e9dc434ece0..a2777a604b9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c @@ -1,7 +1,7 @@ /* { dg-do link } */ /* { dg-options "-O2" } */ -extern void link_error (void) { /* XFAIL */ } +extern void link_error (void); typedef unsigned char(*Calculable)(void); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c index 2cf245460ee..8120dad7fe9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c @@ -3,24 +3,26 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ -void blas (char xxx); +void blas (signed char xxx); void blau (unsigned char xxx); void tst(void) { unsigned i; - for (i = 0; i < 128; i++) /* This cast to char has to be preserved. */ - blas ((char) i); - for (i = 0; i < 127; i++) /* And this one does not. */ - blas ((char) i); - for (i = 0; i < 255; i++) /* This cast is not necessary. */ + for (i = 0; i < 129; i++) /* This truncation to char has to be preserved. */ + blas ((signed char) i); + for (i = 0; i < 128; i++) /* This one is not necessary, but nothing eliminates it. */ + blas ((signed char) i); + for (i = 0; i < 127; i++) /* This one is not necessary, IVOPTS eliminates it. */ + blas ((signed char) i); + for (i = 0; i < 256; i++) /* This one is not necessary, VRP eliminates it. */ + blau ((unsigned char) i); + for (i = 0; i < 257; i++) /* This one is necessary. */ blau ((unsigned char) i); - for (i = 0; i < 256; i++) - blau ((unsigned char) i); /* This one is necessary. */ } -/* { dg-final { scan-tree-dump-times "= \\(unsigned char\\)" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "= \\(char\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "& 255" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= \\(signed char\\)" 2 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c index 7d769ae176a..aece3c7cdc7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c @@ -18,7 +18,7 @@ int bar(void) return ((struct Foo *)p)->i; } -const struct Foo g; +extern const struct Foo g; int foobar(void) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c index ab4182246a3..c67373f017e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c @@ -12,5 +12,5 @@ int g() return *i; /* This should be turned into a.i */ } -/* { dg-final { scan-tree-dump "= a.i;" "ccp1" } } */ +/* { dg-final { scan-tree-dump "= MEM\\\[\\\(int \\\*\\\)&a\\\];" "ccp1" } } */ /* { dg-final { cleanup-tree-dump "ccp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c index 89118a62621..261880cc240 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-cddce1" } */ +/* { dg-options "-O -fno-tree-fre -fdump-tree-cddce1" } */ int foo(int b) { @@ -14,5 +14,7 @@ int foo(int b) return a[2] + b; } +/* Verify DCE removes all accesses to a but the last store and the + read from a[2]. */ /* { dg-final { scan-tree-dump-times "a\\\[\[^\n\]\\\]" 2 "cddce1" } } */ /* { dg-final { cleanup-tree-dump "cddce1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c index 5bbfd3d17fb..70a905819cd 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre-details" } */ +/* { dg-options "-O2 -fdump-tree-fre1-details" } */ int t(int a) __attribute__ ((const)); void q (void); void @@ -12,5 +12,5 @@ threading(int a,int b) } } /* We should thread the jump twice and eliminate it. */ -/* { dg-final { scan-tree-dump-times "Replaced.* t " 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Replaced.* t " 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-3.c new file mode 100644 index 00000000000..d851bf23fe8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-3.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-dom1-details" } */ +extern void abort (void) __attribute__ ((__noreturn__)); +union tree_node; +typedef union tree_node *tree; +enum tree_code +{ + VAR_DECL, + SSA_NAME, + MAX_TREE_CODES +}; +extern unsigned char tree_contains_struct[MAX_TREE_CODES][64]; +struct tree_base +{ + enum tree_code code:16; +}; +enum tree_node_structure_enum +{ + TS_DECL_COMMON +}; +struct tree_ssa_name +{ + tree var; +}; +union tree_node +{ + struct tree_base base; + struct tree_ssa_name ssa_name; +}; +long +expand_one_var (tree var, unsigned char toplevel, unsigned char really_expand) +{ + tree origvar = var; + var = var->ssa_name.var; + if (((enum tree_code) (origvar)->base.code) == SSA_NAME + && !((var->base.code != VAR_DECL))) + abort (); + if ((var->base.code) != VAR_DECL && ((origvar)->base.code) != SSA_NAME) + ; + else if (tree_contains_struct[(var->base.code)][(TS_DECL_COMMON)] != 1) + abort (); +} +/* We should thread the jump, through an intermediate block. */ +/* { dg-final { scan-tree-dump-times "Threaded" 1 "dom1"} } */ +/* { dg-final { scan-tree-dump-times "one or more intermediate" 1 "dom1"} } */ +/* { dg-final { cleanup-tree-dump "dom1" } } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c new file mode 100644 index 00000000000..e841429f61a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c @@ -0,0 +1,63 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-dom1-details" } */ +struct bitmap_head_def; +typedef struct bitmap_head_def *bitmap; +typedef const struct bitmap_head_def *const_bitmap; +typedef unsigned long BITMAP_WORD; +typedef struct bitmap_element_def +{ + struct bitmap_element_def *next; + unsigned int indx; +} bitmap_element; + + + + + + + + + +unsigned char +bitmap_ior_and_compl (bitmap dst, const_bitmap a, const_bitmap b, + const_bitmap kill) +{ + unsigned char changed = 0; + + bitmap_element *dst_elt; + const bitmap_element *a_elt, *b_elt, *kill_elt, *dst_prev; + + while (a_elt || b_elt) + { + unsigned char new_element = 0; + + if (b_elt) + while (kill_elt && kill_elt->indx < b_elt->indx) + kill_elt = kill_elt->next; + + if (b_elt && kill_elt && kill_elt->indx == b_elt->indx + && (!a_elt || a_elt->indx >= b_elt->indx)) + { + bitmap_element tmp_elt; + unsigned ix; + + BITMAP_WORD ior = 0; + + changed = bitmap_elt_ior (dst, dst_elt, dst_prev, + a_elt, &tmp_elt, changed); + + } + + } + + + return changed; +} +/* The block starting the second conditional has 3 incoming edges, + we should thread all three, but due to a bug in the threading + code we missed the edge when the first conditional is false + (b_elt is zero, which means the second conditional is always + zero. */ +/* { dg-final { scan-tree-dump-times "Threaded" 3 "dom1"} } */ +/* { dg-final { cleanup-tree-dump "dom1" } } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c new file mode 100644 index 00000000000..1c74596adba --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-dse1-details" } */ + +struct A { char c[4]; } a, b; + +void +f1 (void) +{ + a.c[2] = '\0'; + __builtin_memset (&a.c[1], 1, 2); +} + +void +f2 (void) +{ + __builtin_memcpy (&a.c[0], "a", 1); + __builtin_memcpy (&a, &b, 3); +} + +/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */ +/* { dg-final { cleanup-tree-dump "dse1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c index b9ec6bc720f..2c859d5e850 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ /* From PR27090. */ @@ -11,5 +11,5 @@ int f(int *a) return *c + t; } -/* { dg-final { scan-tree-dump "Replaced \\\*a_\[^\n\].*with t_" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\*c_\[^\n\].*with t_" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c index 50bb5d96066..7bef07caff6 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ struct { @@ -22,5 +22,5 @@ foo (int y) return (x); } -/* { dg-final { scan-tree-dump "Replaced S\\\[5\\\].x with 4" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced S\\\[5\\\].x with 4" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c index 50bb5d96066..7bef07caff6 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ struct { @@ -22,5 +22,5 @@ foo (int y) return (x); } -/* { dg-final { scan-tree-dump "Replaced S\\\[5\\\].x with 4" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced S\\\[5\\\].x with 4" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c index 972e6c69ef9..cfb72b8bcc5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fstrict-aliasing -fno-tree-sra -fdump-tree-fre-details" } */ +/* { dg-options "-O -fstrict-aliasing -fno-tree-sra -fdump-tree-fre1-details" } */ /* Should be optimized, propagating &a into (*p)[i]. */ @@ -23,5 +23,5 @@ void foo(double (*q)[4], struct Foo *tmp1) } } -/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data with &a" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data with &a" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c index 9d1b3f2ba92..2b677d5b598 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */ /* Should be optimized, propagating &a into (*p)[i]. */ @@ -27,5 +27,5 @@ void foo(double (*q)[4]) bar(a); } -/* { dg-final { scan-tree-dump "Replaced tmp1.data with &a" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced tmp1.data with &a" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c index d24cd1e4c38..f24d0f6ab64 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */ /* Should be optimized, propagating &a into (*p)[i]. */ @@ -26,5 +26,5 @@ void foo(double (*q)[4]) bar(a); } -/* { dg-final { scan-tree-dump "Replaced" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c index 56d85e58e7f..fa5f3719a25 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre" } */ +/* { dg-options "-O -fdump-tree-fre1" } */ /* FRE should be able to combine i and j and perform simplification on the condition. */ @@ -14,5 +14,5 @@ int foo(int b, int c) link_error (); } -/* { dg-final { scan-tree-dump-not "link_error" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-not "link_error" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c index aced64977ea..01f57ed7e5c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details -fno-tree-sra" } */ +/* { dg-options "-O -fdump-tree-fre1-details -fno-tree-sra" } */ struct Bar { int dom; @@ -18,6 +18,6 @@ int foo(int i, int j, int k) return f.doms[0LL].dom; } -/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c index 392b1f6cf7d..986fe0781ae 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre" } */ +/* { dg-options "-O -fdump-tree-fre1" } */ struct a { @@ -24,5 +24,5 @@ int f(struct a *c) /* We should have CSEd the load from c->a. */ -/* { dg-final { scan-tree-dump-times "c_.*\\\.a" 1 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "c_.*\\\.a" 1 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c index 688fe86403e..c121832de63 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre" } */ +/* { dg-options "-O -fdump-tree-fre1" } */ struct a { @@ -27,5 +27,5 @@ int f(struct a *c) /* We should have CSEd the load from c->a. */ -/* { dg-final { scan-tree-dump-times "c_.*\\\.a" 1 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "c_.*\\\.a" 1 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c index d1eabf69bae..f85c06139f2 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-forwprop -fdump-tree-fre1-details" } */ /* From PR14287. */ @@ -14,5 +14,5 @@ foo (long a) h = c; } -/* { dg-final { scan-tree-dump "Replaced \\\(short int\\\) c_.*with b_" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\(short int\\\) c_.*with b_" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c index aadf32e21bd..219c0a926a6 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre" } */ +/* { dg-options "-O -fdump-tree-fre1" } */ struct f { float a; @@ -22,5 +22,5 @@ void g(void) h(a1, b, c, d); } -/* { dg-final { scan-tree-dump-not "a\\\.? = " "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-not "a\\\.? = " "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c index ce311b68b9e..3504d1041e9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre" } */ +/* { dg-options "-O -fdump-tree-fre1" } */ int i; int foo (void) @@ -11,5 +11,5 @@ int foo (void) /* We should eliminate the redundant load of i. */ -/* { dg-final { scan-tree-dump-not "= i;" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-not "= i;" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c index 491836d28ef..f21360824cd 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre" } */ +/* { dg-options "-O -fdump-tree-fre1" } */ int f(int t, int a, int b) { @@ -17,5 +17,5 @@ int f(int t, int a, int b) return c+d; } -/* { dg-final { scan-tree-dump-times "PHI" 1 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "PHI" 1 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c index 705993a4fb3..c683218799d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1" } */ int foo(void) { @@ -30,5 +30,5 @@ int bazzoo (void) return b.i; } -/* { dg-final { scan-tree-dump-times "= 0;" 5 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "= 0;" 5 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c index f7f99bf74f5..e7723f9bc35 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1" } */ struct X { int i; int j; }; void bar (struct X *); @@ -14,5 +14,5 @@ int foo (struct X *p) /* We should optimize this to return 0. */ -/* { dg-final { scan-tree-dump "= 0;" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "= 0;" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c index 2b8e8e063d4..81d9ea0fa8e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */ union U { float f; @@ -15,5 +15,5 @@ int foo (union U *p) } /* avr has 16 bit int and 32 bit float */ -/* { dg-final { scan-tree-dump "Replaced u.i with 0 in" "fre" {xfail avr-*-* } } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced u.i with 0 in" "fre1" {xfail avr-*-* } } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c index 39368707ce9..ba0710171f2 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ int *q; void __attribute__((noinline)) @@ -21,5 +21,5 @@ int foo(int which_p) return x; } -/* { dg-final { scan-tree-dump "Replaced x with 0" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced x with 0" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c index 85e444886d0..6813b432302 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c @@ -6,7 +6,7 @@ When the condition is true, we distribute "(int) (a + b)" as "(int) a + (int) b", otherwise we keep the original. */ /* { dg-do compile { target { { ! mips64 } && { ! spu-*-* } } } } */ -/* { dg-options "-O -fwrapv -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-forwprop -fwrapv -fdump-tree-fre1-details" } */ /* From PR14844. */ @@ -18,5 +18,5 @@ foo (int a, int b) return aa + bb; } -/* { dg-final { scan-tree-dump "Replaced \\\(int\\\) aa_.*with a_" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\(int\\\) aa_.*with a_" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c index ca8d4c96bb7..96738305bbc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c @@ -1,7 +1,7 @@ /* If the target returns false for TARGET_PROMOTE_PROTOTYPES, then there will be no casts for FRE to eliminate and the test will fail. */ /* { dg-do compile { target i?86-*-* x86_64-*-* hppa*-*-* mips*-*-* m68k*-*-* } } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-forwprop -fdump-tree-fre1-details" } */ /* From PR21608. */ @@ -11,5 +11,5 @@ char bar(char f) return wrap(f); } -/* { dg-final { scan-tree-dump "Replaced \\\(char\\\) .*with " "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\(char\\\) .*with " "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c index 7ef20c2214d..e6010ca0318 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-forwprop -fdump-tree-fre1-details" } */ /* From PR19792. */ @@ -10,5 +10,5 @@ bar (unsigned int t) return a == t; } -/* { dg-final { scan-tree-dump "Replaced \\\(unsigned int\\\) a_.*with t_" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced \\\(unsigned int\\\) a_.*with t_" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c index 6963c1ce483..65883cd14bd 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ int i; int foo(void) { i = 2; int j = i * 2; int k = i + 2; return j == k; } -/* { dg-final { scan-tree-dump-times "Replaced " 5 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Replaced " 5 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c index 895c05fdf91..a758efe5dda 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details -fdump-tree-optimized" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details -fdump-tree-optimized" } */ #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) typedef int intflt; #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) @@ -29,10 +29,10 @@ intflt foo(intflt j) return a.u.k; } -/* { dg-final { scan-tree-dump-times "Inserted pretmp" 1 "fre" } } */ -/* { dg-final { scan-tree-dump-times "Replaced a.u.f with pretmp" 3 "fre" } } */ -/* { dg-final { scan-tree-dump-times "Replaced a.u.k with j" 1 "fre" } } */ -/* { dg-final { scan-tree-dump "= VIEW_CONVERT_EXPR<float>\\\(j_" "fre" } } */ +/* { dg-final { scan-tree-dump-times "Inserted pretmp" 1 "fre1" } } */ +/* { dg-final { scan-tree-dump-times "Replaced a.u.f with pretmp" 3 "fre1" } } */ +/* { dg-final { scan-tree-dump-times "Replaced a.u.k with j" 1 "fre1" } } */ +/* { dg-final { scan-tree-dump "= VIEW_CONVERT_EXPR<float>\\\(j_" "fre1" } } */ /* { dg-final { scan-tree-dump "return j" "optimized" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c index bc9f8e3992e..d6ab2ef247f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */ #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) typedef int intflt; #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) @@ -28,6 +28,6 @@ intflt foo(int i, int b) } } -/* { dg-final { scan-tree-dump-times "Replaced u.f with pretmp" 2 "fre" } } */ -/* { dg-final { scan-tree-dump-times "Inserted pretmp" 2 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Replaced u.f with pretmp" 2 "fre1" } } */ +/* { dg-final { scan-tree-dump-times "Inserted pretmp" 2 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c index c8a434a2bba..57c6d4b5be7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-stats" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-stats" } */ union loc { unsigned reg; @@ -23,6 +23,6 @@ void __frame_state_for1 (volatile char *state_in) } } -/* { dg-final { scan-tree-dump-times "Eliminated: 1" 2 "fre" } } */ -/* { dg-final { scan-tree-dump-times "Insertions: 1" 2 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 1" 2 "fre1" } } */ +/* { dg-final { scan-tree-dump-times "Insertions: 1" 2 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c index 41af344989a..8cb1bebde43 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats -fno-finite-math-only" { target sh*-*-* } } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats -fno-finite-math-only" { target sh*-*-* } } */ double cos (double); void link_error(); void f(double a) @@ -11,5 +11,5 @@ void f(double a) link_error(); } -/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c index b986bdd92a9..7342c3361a8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details" } */ typedef union { @@ -23,5 +23,5 @@ void foo(SA* pResult, SB* method, SC* self) pResult->data = pResult->data; } -/* { dg-final { scan-tree-dump "Deleted redundant store" "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Deleted redundant store" "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c index f87476a3a9f..bc7ca4e68e4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */ int foo (int *array) { @@ -8,5 +8,5 @@ foo (int *array) return 0; } /* We should eliminate one load. */ -/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c index ae933bbccec..f08ef7fde60 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */ struct s { int *n; }; @@ -19,5 +19,5 @@ foo (__SIZE_TYPE__ i, struct s *array) /* We should eliminate two address calculations, and one load. */ /* We used to eliminate a cast but that was before POINTER_PLUS_EXPR was added. */ -/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c index 30d968b7c53..4f88624ae19 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */ int foo (unsigned long a) { @@ -9,5 +9,5 @@ foo (unsigned long a) return 1; return 0; } -/* { dg-final { scan-tree-dump-times "return 0;" 0 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "return 0;" 0 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c index 65cd83d7cde..0cb027222fb 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre-stats" } */ +/* { dg-options "-O2 -fdump-tree-fre1-stats" } */ void vnum_test8(int *data) { @@ -17,5 +17,5 @@ void vnum_test8(int *data) } } /* We should eliminate m - n, and set n = n + k into n = m. */ -/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c index cc3661cc6d7..b4c3c14a265 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre-stats" } */ +/* { dg-options "-O2 -fdump-tree-fre1-stats" } */ int vnum_test8(int *data) { @@ -21,5 +21,5 @@ int vnum_test8(int *data) } /* We should eliminate m - n, and set n = n + k into n = m, and set p to 0 */ -/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c index b80a8dc3bba..fb266bb5417 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre-stats" } */ +/* { dg-options "-O2 -fdump-tree-fre1-stats" } */ int main(int argc, char **argv) { int *p; @@ -11,5 +11,5 @@ int main(int argc, char **argv) return result; } /* We should eliminate result = *p by saying it has the value 2. */ -/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c index 7caf4eec6f8..7f0a9329737 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre-stats" } */ +/* { dg-options "-O2 -fdump-tree-fre1-stats" } */ int vnum_test8(int *data) { @@ -23,5 +23,5 @@ int vnum_test8(int *data) } /* We should eliminate m - n, n + k, set data[5] = 0, eliminate the address arithmetic for data[5], and set p = 0. -/* { dg-final { scan-tree-dump-times "Eliminated: 5" 1 "fre"} } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 5" 1 "fre1"} } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-6.c new file mode 100644 index 00000000000..70e48121ee6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-6.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-sink" } */ + +int foo(int *a, int r) +{ + int ret = 0; + *a = 1; + if (r == 3) + *a = 5; + else + ret = r + 20; + return ret; +} + +/* *a = 1 should be sunk to the else block. */ + +/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */ +/* { dg-final { cleanup-tree-dump "sink" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-7.c new file mode 100644 index 00000000000..ffee03368c5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-7.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-sink" } */ + +int foo(int *a, int r, short *b) +{ + int ret = 0; + *a = 1; + if (r == 3) + *a = 5; + else + ret = r + 20; + *b = 9; + return ret; +} + +/* *a = 1 should be sunk to the else block. */ + +/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */ +/* { dg-final { cleanup-tree-dump "sink" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-8.c new file mode 100644 index 00000000000..4a575a7a485 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-8.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-sink" } */ + +int foo(int *a, int r, short *b) +{ + int ret = 0; + *a = 1; + switch (r) + { + case 3: + *a = 5; + break; + case 4: + case 5: + *a = 9; + ret = r + 25; + break; + default: + ret = r + 20; + } + *b = 9; + return ret; +} + +/* *a = 1 should be sunk into the default case. */ + +/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */ +/* { dg-final { cleanup-tree-dump "sink" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-9.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-9.c new file mode 100644 index 00000000000..1a6e2b8d974 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-9.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-sink" } */ + +int foo(int *a, int r, int *b) +{ + int ret = 0; + *a = 1; + if (r == 3) + { + *a = 5; + *b = 3; + } + return ret; +} + +/* *a = 1 should be sunk to the else block. */ + +/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */ +/* { dg-final { cleanup-tree-dump "sink" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c index 87b44b530ec..495b7ba114e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre-details" } */ +/* { dg-options "-O2 -fdump-tree-fre1-details" } */ struct S { float f; }; int __attribute__((noinline)) @@ -11,5 +11,5 @@ foo (float *r, struct S *p) return i + *q; } -/* { dg-final { scan-tree-dump "Replaced\[^\n\]*with i_." "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced\[^\n\]*with i_." "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c index 5acf083c71e..c348bdfe25b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-fre" } */ +/* { dg-options "-O2 -fdump-tree-fre1" } */ struct S { unsigned f; }; @@ -14,6 +14,6 @@ foo ( struct S *p) /* There should only be one load of p->f because fwprop can change *(int *)&p->f into just (int)p->f. */ -/* { dg-final { scan-tree-dump-times "= \[^\n\]*p_.\\\(D\\\)" 1 "fre" } } */ -/* { dg-final { cleanup-tree-dump "fre" } } */ +/* { dg-final { scan-tree-dump-times "= \[^\n\]*p_.\\\(D\\\)" 1 "fre1" } } */ +/* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp55.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp55.c new file mode 100644 index 00000000000..7adfe62052d --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp55.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-vrp1-blocks-vops-details" } */ + +fu (char *p, int x) +{ + if (x) + *p = 69; + if (p) + arf (); +} + +/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "vrp1" } } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp56.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp56.c new file mode 100644 index 00000000000..912d28e0f64 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp56.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-vrp1-details" } */ +typedef struct basic_block_def *basic_block; +struct basic_block_def; +struct edge_def; +typedef struct edge_def *edge; +typedef struct VEC_edge_base +{ + unsigned num; +} VEC_edge_base; +typedef struct VEC_edge_none +{ + VEC_edge_base base; +} VEC_edge_none; +static __inline__ unsigned +VEC_edge_base_length (VEC_edge_base * vec_) +{ + return vec_ ? vec_->num : 0; +} + +typedef struct VEC_edge_gc +{ + VEC_edge_base base; +} VEC_edge_gc; +struct basic_block_def +{ + VEC_edge_gc *succs; +}; + +unsigned char +cleanup_empty_eh (basic_block bb) +{ + edge e_out; + switch (VEC_edge_base_length (&bb->succs->base)) + { + case 1: + foo (); + } +} +/* { dg-final { scan-tree-dump-times "Threaded" 1 "vrp1"} } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c new file mode 100644 index 00000000000..c736adc9e3e --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c @@ -0,0 +1,17 @@ +/* PR40052 */ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-vrp -fdump-tree-optimized" } */ + +int foo(_Bool b) +{ + return b | 1; +} + +int bar(_Bool b) +{ + return b & -2; +} + +/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */ +/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/uninit-D-O0.c b/gcc/testsuite/gcc.dg/uninit-D-O0.c deleted file mode 100644 index e63cb80aee0..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-D-O0.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do not warn about initializing variable with self. */ -/* { dg-do compile } */ -/* { dg-options "-Wuninitialized" } */ - -int f() -{ - int i = i; - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-D.c b/gcc/testsuite/gcc.dg/uninit-D.c deleted file mode 100644 index ea957e49e98..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-D.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do not warn about initializing variable with self. */ -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -int f() -{ - int i = i; - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-E-O0.c b/gcc/testsuite/gcc.dg/uninit-E-O0.c deleted file mode 100644 index 2cc2459663d..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-E-O0.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do warn about initializing variable with self when -Winit-self is supplied. */ -/* { dg-do compile } */ -/* { dg-options "-Wuninitialized -Winit-self" } */ - -int f() -{ - int i = i; /* { dg-warning "i" "uninitialized variable warning" } */ - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-E.c b/gcc/testsuite/gcc.dg/uninit-E.c deleted file mode 100644 index eb356c3ee0d..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-E.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do warn about initializing variable with self when -Winit-self is supplied. */ -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized -Winit-self" } */ - -int f() -{ - int i = i; /* { dg-warning "i" "uninitialized variable warning" } */ - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-F-O0.c b/gcc/testsuite/gcc.dg/uninit-F-O0.c deleted file mode 100644 index 737cc65007e..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-F-O0.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do warn about initializing variable with self in the initialization. */ -/* { dg-do compile } */ -/* { dg-options "-Wuninitialized" } */ - -int f() -{ - int i = i + 1; /* { dg-warning "i" "uninitialized variable warning" } */ - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-F.c b/gcc/testsuite/gcc.dg/uninit-F.c deleted file mode 100644 index 1dbb365e5b7..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-F.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do warn about initializing variable with self in the initialization. */ -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -int f() -{ - int i = i + 1; /* { dg-warning "i" "uninitialized variable warning" } */ - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-G-O0.c b/gcc/testsuite/gcc.dg/uninit-G-O0.c deleted file mode 100644 index d6edffede66..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-G-O0.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do not warn about initializing variable with address of self in the initialization. */ -/* { dg-do compile } */ -/* { dg-options "-Wuninitialized" } */ - -void *f() -{ - void *i = &i; - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-G.c b/gcc/testsuite/gcc.dg/uninit-G.c deleted file mode 100644 index 08f5f532116..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-G.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test we do not warn about initializing variable with address of self in the initialization. */ -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -void *f() -{ - void *i = &i; - return i; -} diff --git a/gcc/testsuite/gcc.dg/uninit-pred-7_d.c b/gcc/testsuite/gcc.dg/uninit-pred-7_d.c new file mode 100644 index 00000000000..06111731a63 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pred-7_d.c @@ -0,0 +1,54 @@ + +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-Wuninitialized -O2 -mbranch-cost=0" } */ + +int g; +void bar(); +void blah(int); + +int foo (int n, int l, int m, int r) +{ + int v; + + if (n || l) + v = r; + + if (m) g++; + else bar(); + + if ( n && l) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + if ( n ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + if ( l ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + return 0; +} + +int foo_2 (int n, int l, int m, int r) +{ + int v; + + if (n || l) + v = r; + + if (m) g++; + else bar(); + + if ( n && l) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + if ( n ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + if (m || l) + blah (v); /* { dg-warning "uninitialized" "warning" } */ + + if ( l ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/uninit-pred-8_d.c b/gcc/testsuite/gcc.dg/uninit-pred-8_d.c new file mode 100644 index 00000000000..ccdea2967ad --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pred-8_d.c @@ -0,0 +1,45 @@ + +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-Wuninitialized -O2 -mbranch-cost=0" } */ + +int g; +void bar(); +void blah(int); + +int foo (int n, int l, int m, int r) +{ + int v; + + if (n || m || r || l) + v = r; + + if (m) g++; + else bar(); + + if ( n || m || r || l) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + if ( n ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + if ( l ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + return 0; +} + +int foo_2 (int n, int l, int m, int r) +{ + int v; + + if (n || m || r ) + v = r; + + if (m) g++; + else bar(); + + if ( n || m || r || l) + blah(v); /* { dg-warning "uninitialized" "warning" } */ + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/uninit-suppress.c b/gcc/testsuite/gcc.dg/uninit-suppress.c new file mode 100644 index 00000000000..64038a3a239 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-suppress.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-tree-ccp -O2 -Wuninitialized -Wno-maybe-uninitialized" } */ +void blah(); +int gflag; + +void foo() +{ + int v; + if (gflag) + v = 10; + + blah(); /* *gflag may be killed, but compiler won't know */ + + if (gflag) + bar(v); /* { dg-bogus "uninitialized" "should be suppressed" } */ +} diff --git a/gcc/testsuite/gcc.dg/uninit-suppress_2.c b/gcc/testsuite/gcc.dg/uninit-suppress_2.c new file mode 100644 index 00000000000..a48b182f8cb --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-suppress_2.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-tree-ccp -O2 -Wuninitialized -Werror=uninitialized -Wno-error=maybe-uninitialized" } */ +void blah(); +int gflag; + +void foo() +{ + int v; + if (gflag) + v = 10; + + blah(); /* *gflag may be killed, but compiler won't know */ + + if (gflag) + bar(v); /* { dg-warning "uninitialized" "should not be promoted to error" } */ +} diff --git a/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c b/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c index 7d6af7b82f3..400ff29164e 100644 --- a/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c +++ b/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c @@ -26,7 +26,7 @@ foo () } } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided_wide } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided_wide } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided4 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c index 4d75d565b98..d9adf6f333c 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c @@ -113,7 +113,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target { vect_strided && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target { vect_strided && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target { vect_strided8 && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target { vect_strided8 && vect_int_mult } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-ifcvt-1.c b/gcc/testsuite/gcc.dg/vect/fast-math-ifcvt-1.c new file mode 100644 index 00000000000..ba22d8d7889 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/fast-math-ifcvt-1.c @@ -0,0 +1,18 @@ +/* PR 47892 */ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_float } */ +/* { dg-require-effective-target vect_condition } */ + +void +bestseries9 (float * __restrict__ arr, int len) +{ + int i; + for (i = 0; i < len; ++i) + { + float or = arr[i]; + arr[i] = (or > 0.0f) * (2 - or * or); + } +} + +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c index 6a01782bb3d..d8394060bad 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c @@ -20,7 +20,7 @@ float method2_int16 (struct mem *mem) return avg; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c b/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c index 81240023777..4c2c5c510f4 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c @@ -13,5 +13,5 @@ void foo(void) } } -/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_strided } } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c b/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c index 3fcf77e0c34..db55b30098d 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c @@ -56,5 +56,5 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c b/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c new file mode 100644 index 00000000000..38906a94af2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c @@ -0,0 +1,69 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 50 + +typedef struct { + short a; + short b; +} data; + +data in1[N], in2[N], out[N]; +short result[N*2] = {10,-7,11,-6,12,-5,13,-4,14,-3,15,-2,16,-1,17,0,18,1,19,2,20,3,21,4,22,5,23,6,24,7,25,8,26,9,27,10,28,11,29,12,30,13,31,14,32,15,33,16,34,17,35,18,36,19,37,20,38,21,39,22,40,23,41,24,42,25,43,26,44,27,45,28,46,29,47,30,48,31,49,32,50,33,51,34,52,35,53,36,54,37,55,38,56,39,57,40,58,41,59,42}; +short out1[N], out2[N]; + +__attribute__ ((noinline)) void +foo () +{ + int i; + short c, d; + + for (i = 0; i < N; i++) + { + c = in1[i].b; + d = in2[i].b; + + if (c >= d) + { + out[i].b = in1[i].a; + out[i].a = d + 5; + } + else + { + out[i].b = d - 12; + out[i].a = in2[i].a + d; + } + } +} + +int +main (void) +{ + int i; + + check_vect (); + + for (i = 0; i < N; i++) + { + in1[i].a = i; + in1[i].b = i + 2; + in2[i].a = 5; + in2[i].b = i + 5; + __asm__ volatile (""); + } + + foo (); + + for (i = 0; i < N; i++) + { + if (out[i].a != result[2*i] || out[i].b != result[2*i+1]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || { ! vect_strided2 } } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c index 9a71b498da7..95906baedd6 100644 --- a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c +++ b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c @@ -54,5 +54,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c index b28111c22c8..544b89ae8c6 100644 --- a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c +++ b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c @@ -53,5 +53,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c index 7a6788a0da2..60cb00de485 100644 --- a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c +++ b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c @@ -47,5 +47,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_interleave } } } */ +/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave || vect_strided2 } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c index 18e50874a5c..22b4aa96f60 100644 --- a/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c +++ b/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c @@ -50,5 +50,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c index 954474eb925..0bbb8e943ce 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c @@ -8,7 +8,7 @@ __attribute__ ((noinline)) void with_restrict(int * __restrict p) { int i; - int *q = p - 2; + int *q = p - 1; for (i = 0; i < 1000; ++i) { p[i] = q[i]; @@ -19,7 +19,7 @@ __attribute__ ((noinline)) void without_restrict(int * p) { int i; - int *q = p - 2; + int *q = p - 1; for (i = 0; i < 1000; ++i) { p[i] = q[i]; @@ -38,8 +38,8 @@ int main(void) a[i] = b[i] = i; } - with_restrict(a + 2); - without_restrict(b + 2); + with_restrict(a + 1); + without_restrict(b + 1); for (i = 0; i < 1002; ++i) { if (a[i] != b[i]) @@ -48,6 +48,6 @@ int main(void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { xfail vect_no_align } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr30843.c b/gcc/testsuite/gcc.dg/vect/pr30843.c index 616b618f4d8..2e0855f6cb8 100644 --- a/gcc/testsuite/gcc.dg/vect/pr30843.c +++ b/gcc/testsuite/gcc.dg/vect/pr30843.c @@ -20,6 +20,6 @@ void dacP98FillRGBMap (unsigned char *pBuffer) } } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided4 } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr33866.c b/gcc/testsuite/gcc.dg/vect/pr33866.c index 9beaeff5b4b..8adb2e7edc1 100644 --- a/gcc/testsuite/gcc.dg/vect/pr33866.c +++ b/gcc/testsuite/gcc.dg/vect/pr33866.c @@ -27,6 +27,6 @@ void test_select_fill_hyper_simple (long *offset) } /* Needs interleaving support. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr37539.c b/gcc/testsuite/gcc.dg/vect/pr37539.c index 1e73425de9e..560c484636c 100644 --- a/gcc/testsuite/gcc.dg/vect/pr37539.c +++ b/gcc/testsuite/gcc.dg/vect/pr37539.c @@ -40,7 +40,7 @@ int main () return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_strided_wide } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_strided4 && vect_strided2 } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr48377.c b/gcc/testsuite/gcc.dg/vect/pr48377.c new file mode 100644 index 00000000000..b9aaf49ee73 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr48377.c @@ -0,0 +1,24 @@ +/* PR tree-optimization/48377 */ + +typedef unsigned int U __attribute__((__aligned__ (1), __may_alias__)); + +__attribute__((noinline, noclone)) unsigned int +foo (const char *s, int len) +{ + const U *p = (const U *) s; + unsigned int f = len / sizeof (unsigned int), hash = len, i; + + for (i = 0; i < f; ++i) + hash += *p++; + return hash; +} + +char buf[64] __attribute__((aligned (32))); + +int +main (void) +{ + return foo (buf + 1, 26) != 26; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr48765.c b/gcc/testsuite/gcc.dg/vect/pr48765.c new file mode 100644 index 00000000000..469c4f423ce --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr48765.c @@ -0,0 +1,82 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-options "-m64 -O3 -mcpu=power6" } */ + +enum reg_class +{ + NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, XGRF_REGS, ALL_REGS, + LIM_REG_CLASSES +}; +enum machine_mode +{ + VOIDmode, QImode, HImode, PSImode, SImode, PDImode, DImode, TImode, OImode, + QFmode, HFmode, TQFmode, SFmode, DFmode, XFmode, TFmode, SCmode, DCmode, + XCmode, TCmode, CQImode, CHImode, CSImode, CDImode, CTImode, COImode, + BLKmode, CCmode, CCEVENmode, MAX_MACHINE_MODE +}; +typedef struct rtx_def +{ + int mode:8; +} + *rtx; +extern rtx *regno_reg_rtx; +typedef unsigned int HARD_REG_ELT_TYPE; +typedef HARD_REG_ELT_TYPE HARD_REG_SET[((64 + 32 - 1) / 32)]; +extern int reg_alloc_order[64]; +extern int max_regno; +extern int *reg_n_calls_crossed; +extern short *reg_renumber; +static int *reg_where_dead; +static int *reg_where_born; +static int *reg_order; +static char *regs_change_size; +static HARD_REG_SET *after_insn_hard_regs; +static int stupid_find_reg (int, enum reg_class, enum machine_mode, int, int, + int); +void +stupid_life_analysis (f, nregs, file) + rtx f; +{ + register int i; + for (i = (((64)) + 3) + 1; i < max_regno; i++) + { + register int r = reg_order[i]; + if ((int) LIM_REG_CLASSES > 1) + reg_renumber[r] = + stupid_find_reg (reg_n_calls_crossed[r], reg_preferred_class (r), + ((regno_reg_rtx[r])->mode), reg_where_born[r], + reg_where_dead[r], regs_change_size[r]); + } +} + +static int +stupid_find_reg (call_preserved, class, mode, born_insn, dead_insn, + changes_size) + int call_preserved; + enum reg_class class; + enum machine_mode mode; +{ + register int i, ins; + HARD_REG_SET used, this_reg; + for (ins = born_insn; ins < dead_insn; ins++) + do + { + register HARD_REG_ELT_TYPE *scan_tp_ = (used), *scan_fp_ = + (after_insn_hard_regs[ins]); + for (i = 0; i < ((64 + 32 - 1) / 32); i++) + *scan_tp_++ |= *scan_fp_++; + } + while (0); + for (i = 0; i < 64; i++) + { + int regno = reg_alloc_order[i]; + if (((used)[(regno) / ((unsigned) 32)] & + (((HARD_REG_ELT_TYPE) (1)) << ((regno) % ((unsigned) 32))))) + { + register int j; + if (j == regno) + return regno; + } + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-11.c b/gcc/testsuite/gcc.dg/vect/slp-11a.c index 9f44e517e93..520bb74df2b 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-11.c +++ b/gcc/testsuite/gcc.dg/vect/slp-11a.c @@ -3,7 +3,7 @@ #include <stdarg.h> #include "tree-vect.h" -#define N 8 +#define N 8 int main1 () @@ -11,7 +11,6 @@ main1 () int i; unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - float out2[N*8]; /* Different operations - not SLPable. */ for (i = 0; i < N; i++) @@ -35,7 +34,7 @@ main1 () b7 = a7 * 2; out[i*8] = b0 - 2; - out[i*8 + 1] = b1 - 3; + out[i*8 + 1] = b1 - 3; out[i*8 + 2] = b2 - 2; out[i*8 + 3] = b3 - 1; out[i*8 + 4] = b4 - 8; @@ -58,41 +57,6 @@ main1 () abort (); } - /* Requires permutation - not SLPable. */ - for (i = 0; i < N*2; i++) - { - out[i*4] = (in[i*4] + 2) * 3; - out[i*4 + 1] = (in[i*4 + 2] + 2) * 7; - out[i*4 + 2] = (in[i*4 + 1] + 7) * 3; - out[i*4 + 3] = (in[i*4 + 3] + 3) * 4; - } - - /* check results: */ - for (i = 0; i < N*2; i++) - { - if (out[i*4] != (in[i*4] + 2) * 3 - || out[i*4 + 1] != (in[i*4 + 2] + 2) * 7 - || out[i*4 + 2] != (in[i*4 + 1] + 7) * 3 - || out[i*4 + 3] != (in[i*4 + 3] + 3) * 4) - abort (); - } - - /* Different operations - not SLPable. */ - for (i = 0; i < N*4; i++) - { - out2[i*2] = ((float) in[i*2] * 2 + 6) ; - out2[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7); - } - - /* check results: */ - for (i = 0; i < N*4; i++) - { - if (out2[i*2] != ((float) in[i*2] * 2 + 6) - || out2[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7)) - abort (); - } - - return 0; } @@ -105,9 +69,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_uintfloat_cvt && vect_strided_wide } && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { { ! vect_uintfloat_cvt } && vect_strided_wide } && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_int_mult && vect_strided_wide } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ - diff --git a/gcc/testsuite/gcc.dg/vect/slp-11b.c b/gcc/testsuite/gcc.dg/vect/slp-11b.c new file mode 100644 index 00000000000..6942c578b6f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-11b.c @@ -0,0 +1,49 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 8 + +int +main1 () +{ + int i; + unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; + unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + + /* Requires permutation - not SLPable. */ + for (i = 0; i < N*2; i++) + { + out[i*4] = (in[i*4] + 2) * 3; + out[i*4 + 1] = (in[i*4 + 2] + 2) * 7; + out[i*4 + 2] = (in[i*4 + 1] + 7) * 3; + out[i*4 + 3] = (in[i*4 + 3] + 3) * 4; + } + + /* check results: */ + for (i = 0; i < N*2; i++) + { + if (out[i*4] != (in[i*4] + 2) * 3 + || out[i*4 + 1] != (in[i*4 + 2] + 2) * 7 + || out[i*4 + 2] != (in[i*4 + 1] + 7) * 3 + || out[i*4 + 3] != (in[i*4 + 3] + 3) * 4) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided4 && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided4 && vect_int_mult } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-11c.c b/gcc/testsuite/gcc.dg/vect/slp-11c.c new file mode 100644 index 00000000000..42b358aa697 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-11c.c @@ -0,0 +1,46 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 8 + +int +main1 () +{ + int i; + unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + float out[N*8]; + + /* Different operations - not SLPable. */ + for (i = 0; i < N*4; i++) + { + out[i*2] = ((float) in[i*2] * 2 + 6) ; + out[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7); + } + + /* check results: */ + for (i = 0; i < N*4; i++) + { + if (out[i*2] != ((float) in[i*2] * 2 + 6) + || out[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7)) + abort (); + } + + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_uintfloat_cvt && vect_strided2 } && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { { vect_uintfloat_cvt && vect_strided2 } && vect_int_mult } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-12a.c b/gcc/testsuite/gcc.dg/vect/slp-12a.c index 6bbeb879faf..5c1c5a7a50c 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-12a.c +++ b/gcc/testsuite/gcc.dg/vect/slp-12a.c @@ -11,7 +11,7 @@ main1 () int i; unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned int ia[N], ib[N*2]; + unsigned int ia[N]; for (i = 0; i < N; i++) { @@ -61,27 +61,6 @@ main1 () abort (); } - for (i = 0; i < N*2; i++) - { - out[i*4] = (in[i*4] + 2) * 3; - out[i*4 + 1] = (in[i*4 + 1] + 2) * 7; - out[i*4 + 2] = (in[i*4 + 2] + 7) * 3; - out[i*4 + 3] = (in[i*4 + 3] + 7) * 7; - - ib[i] = 7; - } - - /* check results: */ - for (i = 0; i < N*2; i++) - { - if (out[i*4] != (in[i*4] + 2) * 3 - || out[i*4 + 1] != (in[i*4 + 1] + 2) * 7 - || out[i*4 + 2] != (in[i*4 + 2] + 7) * 3 - || out[i*4 + 3] != (in[i*4 + 3] + 7) * 7 - || ib[i] != 7) - abort (); - } - return 0; } @@ -94,11 +73,8 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" {target { vect_strided_wide && vect_int_mult} } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { {! {vect_strided_wide}} && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target { vect_strided_wide && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { {! {vect_strided_wide}} && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { ! vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ - diff --git a/gcc/testsuite/gcc.dg/vect/slp-12b.c b/gcc/testsuite/gcc.dg/vect/slp-12b.c index 863652a5b8a..69e9f315ff4 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-12b.c +++ b/gcc/testsuite/gcc.dg/vect/slp-12b.c @@ -43,9 +43,9 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { vect_strided_wide && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided_wide}}} } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { vect_strided_wide && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided_wide}}} } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided2 && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided2 && vect_int_mult } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_strided2 && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided2 && vect_int_mult } } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-12c.c b/gcc/testsuite/gcc.dg/vect/slp-12c.c new file mode 100644 index 00000000000..5152d21145b --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-12c.c @@ -0,0 +1,53 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 8 + +int +main1 () +{ + int i; + unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; + unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + unsigned int ia[N*2]; + + for (i = 0; i < N*2; i++) + { + out[i*4] = (in[i*4] + 2) * 3; + out[i*4 + 1] = (in[i*4 + 1] + 2) * 7; + out[i*4 + 2] = (in[i*4 + 2] + 7) * 3; + out[i*4 + 3] = (in[i*4 + 3] + 7) * 7; + + ia[i] = 7; + } + + /* check results: */ + for (i = 0; i < N*2; i++) + { + if (out[i*4] != (in[i*4] + 2) * 3 + || out[i*4 + 1] != (in[i*4 + 1] + 2) * 7 + || out[i*4 + 2] != (in[i*4 + 2] + 7) * 3 + || out[i*4 + 3] != (in[i*4 + 3] + 7) * 7 + || ia[i] != 7) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_int_mult } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_int_mult } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-18.c b/gcc/testsuite/gcc.dg/vect/slp-18.c index 8cdb0ddb9ee..6cc6fbae346 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-18.c +++ b/gcc/testsuite/gcc.dg/vect/slp-18.c @@ -91,7 +91,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_strided } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-19a.c b/gcc/testsuite/gcc.dg/vect/slp-19a.c new file mode 100644 index 00000000000..02a4cd008b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-19a.c @@ -0,0 +1,61 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 16 + +int +main1 () +{ + unsigned int i; + unsigned int out[N*8]; + unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + unsigned int ia[N*2]; + + for (i = 0; i < N; i++) + { + out[i*8] = in[i*8]; + out[i*8 + 1] = in[i*8 + 1]; + out[i*8 + 2] = in[i*8 + 2]; + out[i*8 + 3] = in[i*8 + 3]; + out[i*8 + 4] = in[i*8 + 4]; + out[i*8 + 5] = in[i*8 + 5]; + out[i*8 + 6] = in[i*8 + 6]; + out[i*8 + 7] = in[i*8 + 7]; + + ia[i] = in[i*8 + 2]; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (out[i*8] != in[i*8] + || out[i*8 + 1] != in[i*8 + 1] + || out[i*8 + 2] != in[i*8 + 2] + || out[i*8 + 3] != in[i*8 + 3] + || out[i*8 + 4] != in[i*8 + 4] + || out[i*8 + 5] != in[i*8 + 5] + || out[i*8 + 6] != in[i*8 + 6] + || out[i*8 + 7] != in[i*8 + 7] + || ia[i] != in[i*8 + 2]) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_strided8 } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided8 } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_strided8} } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-19b.c b/gcc/testsuite/gcc.dg/vect/slp-19b.c new file mode 100644 index 00000000000..1f29a0d2e4d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-19b.c @@ -0,0 +1,58 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 16 + +int +main1 () +{ + unsigned int i; + unsigned int out[N*8]; + unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + unsigned int ia[N*2], a0, a1, a2, a3; + + for (i = 0; i < N*2; i++) + { + a0 = in[i*4] + 1; + a1 = in[i*4 + 1] + 2; + a2 = in[i*4 + 2] + 3; + a3 = in[i*4 + 3] + 4; + + out[i*4] = a0; + out[i*4 + 1] = a1; + out[i*4 + 2] = a2; + out[i*4 + 3] = a3; + + ia[i] = a2; + } + + /* check results: */ + for (i = 0; i < N*2; i++) + { + if (out[i*4] != in[i*4] + 1 + || out[i*4 + 1] != in[i*4 + 1] + 2 + || out[i*4 + 2] != in[i*4 + 2] + 3 + || out[i*4 + 3] != in[i*4 + 3] + 4 + || ia[i] != in[i*4 + 2] + 3) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_strided4 } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided4 } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_strided4 } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-19.c b/gcc/testsuite/gcc.dg/vect/slp-19c.c index 349c5ec6c92..f0df25f5346 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-19.c +++ b/gcc/testsuite/gcc.dg/vect/slp-19c.c @@ -3,7 +3,7 @@ #include <stdarg.h> #include "tree-vect.h" -#define N 16 +#define N 16 int main1 () @@ -13,62 +13,7 @@ main1 () unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; unsigned int ia[N*2], a0, a1, a2, a3; - for (i = 0; i < N; i++) - { - out[i*8] = in[i*8]; - out[i*8 + 1] = in[i*8 + 1]; - out[i*8 + 2] = in[i*8 + 2]; - out[i*8 + 3] = in[i*8 + 3]; - out[i*8 + 4] = in[i*8 + 4]; - out[i*8 + 5] = in[i*8 + 5]; - out[i*8 + 6] = in[i*8 + 6]; - out[i*8 + 7] = in[i*8 + 7]; - - ia[i] = in[i*8 + 2]; - } - - /* check results: */ - for (i = 0; i < N; i++) - { - if (out[i*8] != in[i*8] - || out[i*8 + 1] != in[i*8 + 1] - || out[i*8 + 2] != in[i*8 + 2] - || out[i*8 + 3] != in[i*8 + 3] - || out[i*8 + 4] != in[i*8 + 4] - || out[i*8 + 5] != in[i*8 + 5] - || out[i*8 + 6] != in[i*8 + 6] - || out[i*8 + 7] != in[i*8 + 7] - || ia[i] != in[i*8 + 2]) - abort (); - } - - for (i = 0; i < N*2; i++) - { - a0 = in[i*4] + 1; - a1 = in[i*4 + 1] + 2; - a2 = in[i*4 + 2] + 3; - a3 = in[i*4 + 3] + 4; - - out[i*4] = a0; - out[i*4 + 1] = a1; - out[i*4 + 2] = a2; - out[i*4 + 3] = a3; - - ia[i] = a2; - } - - /* check results: */ - for (i = 0; i < N*2; i++) - { - if (out[i*4] != in[i*4] + 1 - || out[i*4 + 1] != in[i*4 + 1] + 2 - || out[i*4 + 2] != in[i*4 + 2] + 3 - || out[i*4 + 3] != in[i*4 + 3] + 4 - || ia[i] != in[i*4 + 2] + 3) - abort (); - } - - /* The last stmt requires interleaving of not power of 2 size - not + /* The last stmt requires interleaving of not power of 2 size - not vectorizable. */ for (i = 0; i < N/2; i++) { @@ -116,10 +61,10 @@ main1 () out[i*6 + 3] = in[i*6 + 3]; out[i*6 + 4] = in[i*6 + 4]; out[i*6 + 5] = in[i*6 + 5]; - + ia[i] = i; - } - + } + /* check results: */ for (i = 0; i < N/2; i++) { @@ -133,7 +78,6 @@ main1 () abort (); } - return 0; } @@ -146,9 +90,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_strided_wide } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided_wide } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_strided_wide } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! { vect_strided_wide } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ - diff --git a/gcc/testsuite/gcc.dg/vect/slp-21.c b/gcc/testsuite/gcc.dg/vect/slp-21.c index b4f4e24e0f4..39146b8fd11 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-21.c +++ b/gcc/testsuite/gcc.dg/vect/slp-21.c @@ -199,9 +199,9 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target { vect_strided || vect_extract_even_odd } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided || vect_extract_even_odd } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target { vect_strided4 || vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided4 || vect_extract_even_odd } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided4 } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided4 } } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-23.c b/gcc/testsuite/gcc.dg/vect/slp-23.c index 3a64284b056..5a04c900e02 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-23.c +++ b/gcc/testsuite/gcc.dg/vect/slp-23.c @@ -106,8 +106,8 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided_wide } && {! { vect_no_align} } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided_wide || vect_no_align} } } } } */ +/* { 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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-3.c b/gcc/testsuite/gcc.dg/vect/slp-3.c index 8c99b01e8e4..9a504d901e0 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-3.c +++ b/gcc/testsuite/gcc.dg/vect/slp-3.c @@ -4,9 +4,9 @@ #include <stdarg.h> #include "tree-vect.h" -#define N 8 +#define N 12 -unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; int main1 () @@ -101,7 +101,7 @@ main1 () } /* SLP with unrolling by 8. */ - for (i = 0; i < N/2; i++) + for (i = 0; i < N/4; i++) { out[i*9] = in[i*9]; out[i*9 + 1] = in[i*9 + 1]; @@ -115,7 +115,7 @@ main1 () } /* check results: */ - for (i = 0; i < N/2; i++) + for (i = 0; i < N/4; i++) { if (out[i*9] != in[i*9] || out[i*9 + 1] != in[i*9 + 1] @@ -142,7 +142,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_align } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { xfail vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c index 5c0761ebaab..3c04b6d21c5 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c @@ -1,5 +1,5 @@ /* { dg-require-effective-target vect_int } */ -/* { dg-do run { xfail { sparc*-*-* && ilp32 } } } PR rtl-opt/46603 */ +/* { dg-xfail-run-if "PR rtl-optimization/46603" { sparc*-*-* && { ilp32 && gas } } } */ #include <stdarg.h> #include "tree-vect.h" diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c b/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c index ccfb888fc5a..d43f329a9cb 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c +++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c @@ -42,7 +42,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! vect_unpack } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! { vect_unpack || vect_strided2 } } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-1.c b/gcc/testsuite/gcc.dg/vect/vect-1.c index 21975afa01e..04392ea78da 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-1.c @@ -85,6 +85,6 @@ foo (int n) fbar (a); } -/* { dg-final { scan-tree-dump-times "vectorized 6 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 5 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 6 loops" 1 "vect" { target vect_strided2 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 5 loops" 1 "vect" { xfail vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-10.c b/gcc/testsuite/gcc.dg/vect/vect-10.c index 6447b75a4f8..faa500d2a18 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-10.c +++ b/gcc/testsuite/gcc.dg/vect/vect-10.c @@ -22,5 +22,5 @@ int foo () return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_strided2 } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-107.c b/gcc/testsuite/gcc.dg/vect/vect-107.c index 201d4ab4e34..0053b3321a4 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-107.c +++ b/gcc/testsuite/gcc.dg/vect/vect-107.c @@ -40,6 +40,6 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-119.c b/gcc/testsuite/gcc.dg/vect/vect-119.c new file mode 100644 index 00000000000..fa40f15c934 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-119.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ + +#define OUTER 32 +#define INNER 40 + +static unsigned int +bar (const unsigned int x[INNER][2], unsigned int sum) +{ + int i; + + for (i = 0; i < INNER; i++) + sum += x[i][0] * x[i][0] + x[i][1] * x[i][1]; + return sum; +} + +unsigned int foo (const unsigned int x[OUTER][INNER][2]) +{ + int i; + unsigned int sum; + + sum = 0.0f; + for (i = 0; i < OUTER; i++) + sum = bar (x[i], sum); + return sum; +} + +/* { dg-final { scan-tree-dump-times "Detected interleaving of size 2" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-98.c b/gcc/testsuite/gcc.dg/vect/vect-98.c index 118f28fd334..01c9153878f 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-98.c +++ b/gcc/testsuite/gcc.dg/vect/vect-98.c @@ -38,6 +38,6 @@ int main (void) } /* Needs interleaving support. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail { vect_interleave && vect_extract_even_odd_wide } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided4 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c b/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c new file mode 100644 index 00000000000..3c21918efb7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c @@ -0,0 +1,86 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 50 + +typedef struct { + short a; + short b; +} data; + +data in1[N], in2[N], out[N]; +short result[N*2] = {7,-7,9,-6,11,-5,13,-4,15,-3,17,-2,19,-1,21,0,23,1,25,2,27,3,29,4,31,5,33,6,35,7,37,8,39,9,41,10,43,11,45,12,47,13,49,14,51,15,53,16,55,17,57,18,59,19,61,20,63,21,65,22,67,23,69,24,71,25,73,26,75,27,77,28,79,29,81,30,83,31,85,32,87,33,89,34,91,35,93,36,95,37,97,38,99,39,101,40,103,41,105,42}; +short out1[N], out2[N]; + +__attribute__ ((noinline)) void +foo () +{ + int i; + short c, d; + + /* Vectorizable with conditional store sinking. */ + for (i = 0; i < N; i++) + { + c = in1[i].b; + d = in2[i].b; + + if (c >= d) + { + out[i].b = c; + out[i].a = d + 5; + } + else + { + out[i].b = d - 12; + out[i].a = c + d; + } + } + + /* Not vectorizable. */ + for (i = 0; i < N; i++) + { + c = in1[i].b; + d = in2[i].b; + + if (c >= d) + { + out1[i] = c; + } + else + { + out2[i] = c + d; + } + } +} + +int +main (void) +{ + int i; + + check_vect (); + + for (i = 0; i < N; i++) + { + in1[i].a = i; + in1[i].b = i + 2; + in2[i].a = 5; + in2[i].b = i + 5; + __asm__ volatile (""); + } + + foo (); + + for (i = 0; i < N; i++) + { + if (out[i].a != result[2*i] || out[i].b != result[2*i+1]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || { ! vect_strided2 } } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-cselim-2.c b/gcc/testsuite/gcc.dg/vect/vect-cselim-2.c new file mode 100644 index 00000000000..accfcf398c6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-cselim-2.c @@ -0,0 +1,65 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 50 + +int a[N], b[N], in1[N], in2[N]; +int result[2*N] = {5,-7,7,-6,9,-5,11,-4,13,-3,15,-2,17,-1,19,0,21,1,23,2,25,3,27,4,29,5,31,6,33,7,35,8,37,9,39,10,41,11,43,12,45,13,47,14,49,15,51,16,53,17,55,18,57,19,59,20,61,21,63,22,65,23,67,24,69,25,71,26,73,27,75,28,77,29,79,30,81,31,83,32,85,33,87,34,89,35,91,36,93,37,95,38,97,39,99,40,101,41,103,42}; + +__attribute__ ((noinline)) void +foo (int *pa, int *pb) +{ + int i; + int c, d; + + /* Store sinking should not work here since the pointers may alias. */ + for (i = 0; i < N; i++) + { + c = in1[i]; + d = in2[i]; + + if (c >= d) + { + *pa = c; + *pb = d + 5; + } + else + { + *pb = d - 12; + *pa = c + d; + } + + pa++; + pb++; + } +} + +int +main (void) +{ + int i; + + check_vect (); + + for (i = 0; i < N; i++) + { + in1[i] = i; + in2[i] = i + 5; + __asm__ volatile (""); + } + + foo (a, b); + + for (i = 0; i < N; i++) + { + if (a[i] != result[2*i] || b[i] != result[2*i+1]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-5.c b/gcc/testsuite/gcc.dg/vect/vect-outer-5.c index f5027d626cc..05ed39a3da2 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-5.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-5.c @@ -17,7 +17,7 @@ int main1 () float B[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); float C[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); float D[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); - float E[4] = {0,1,2,480}; + float E[4] = {0,480,960,1440}; float s; int i, j; @@ -55,7 +55,7 @@ int main1 () s = 0; for (j=0; j<N; j+=4) s += C[j]; - B[i+3] = B[i] + s; + B[i+1] = B[i] + s; } /* check results: */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-peel-1.c b/gcc/testsuite/gcc.dg/vect/vect-peel-1.c index 58a0cdbf203..2a150e91203 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-peel-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-peel-1.c @@ -14,10 +14,10 @@ int main1 () int i; int ia[N+1]; - /* All the accesses are misaligned. With cost model disabled, we count the - the number of aligned accesses for each peeling option, and in this case - we align the two loads if possible (i.e., if misaligned stores are - supported). */ + /* All the accesses are misaligned. With cost model disabled, we + count the number of aligned accesses for each peeling option, and + in this case we align the two loads if possible (i.e., if + misaligned stores are supported). */ for (i = 1; i <= N; i++) { ia[i] = ib[i+2] + ib[i+6]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-shift-3.c b/gcc/testsuite/gcc.dg/vect/vect-shift-3.c new file mode 100644 index 00000000000..78ed935ae59 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-shift-3.c @@ -0,0 +1,37 @@ +/* { dg-require-effective-target vect_shift } */ +/* { dg-require-effective-target vect_int } */ + +#include "tree-vect.h" + +#define N 32 + +unsigned short dst[N] __attribute__((aligned(N))); +unsigned short src[N] __attribute__((aligned(N))); + +__attribute__ ((noinline)) +void array_shift(void) +{ + int i; + for (i = 0; i < N; i++) + dst[i] = src[i] >> 3; +} + +int main() +{ + volatile int i; + check_vect (); + + for (i = 0; i < N; i++) + src[i] = i << 3; + + array_shift (); + + for (i = 0; i < N; i++) + if (dst[i] != i) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-shift-4.c b/gcc/testsuite/gcc.dg/vect/vect-shift-4.c new file mode 100644 index 00000000000..e705feadde0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-shift-4.c @@ -0,0 +1,37 @@ +/* { dg-require-effective-target vect_shift_char } */ +/* { dg-require-effective-target vect_int } */ + +#include "tree-vect.h" + +#define N 32 + +unsigned char dst[N] __attribute__((aligned(N))); +unsigned char src[N] __attribute__((aligned(N))); + +__attribute__ ((noinline)) +void array_shift(void) +{ + int i; + for (i = 0; i < N; i++) + dst[i] = src[i] >> 3; +} + +int main() +{ + volatile int i; + check_vect (); + + for (i = 0; i < N; i++) + src[i] = i << 3; + + array_shift (); + + for (i = 0; i < N; i++) + if (dst[i] != i) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c index c88814297ec..779913a4f2b 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c @@ -71,6 +71,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c index 702d911ad4c..25cabb693c5 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c @@ -55,6 +55,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c index 93c1b582ca8..8f04b730f57 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c @@ -68,6 +68,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c index afb2f4697bc..cd941a827f1 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c @@ -62,6 +62,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c index bac1caa1ce9..4e742b20180 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c @@ -61,6 +61,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c index cda57393538..9b0142b1d8d 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c @@ -69,6 +69,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c index 426069ffe46..4fb5494a4d3 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c @@ -76,6 +76,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c index 8dfb21be915..cc09fa608dc 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c @@ -81,6 +81,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-float.c b/gcc/testsuite/gcc.dg/vect/vect-strided-float.c index 38c50b9cd43..302be5f578b 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-float.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-float.c @@ -39,7 +39,7 @@ int main (void) } /* Needs interleaving support. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave && vect_extract_even_odd_wide } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c b/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c index 3890a796888..3c8062cea12 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c @@ -71,6 +71,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c b/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c index 6ddf0932411..49399c4e78c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c @@ -71,6 +71,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c b/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c index 5f18baab4e3..f16aa1a94d7 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c @@ -72,5 +72,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c index 8548d267ede..26311a8bc80 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c @@ -55,6 +55,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c index 5c02c0da214..19af351e6cf 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c @@ -65,8 +65,8 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_interleave && vect_pack_trunc } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { ! { vect_interleave } } && { vect_pack_trunc } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { { vect_interleave || vect_strided4 } && vect_pack_trunc } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { ! { vect_interleave || vect_strided4 } } && { vect_pack_trunc } } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c index c30c98d7e0d..3be94f10c8a 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c @@ -39,7 +39,7 @@ int main (void) } /* Needs interleaving support. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave || vect_strided2 } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c index eb6ecc69bd4..6694897316e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c @@ -55,6 +55,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c new file mode 100644 index 00000000000..e423148407d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c @@ -0,0 +1,112 @@ +#include <stdarg.h> +#include "tree-vect.h" + +#define N 128 + +typedef struct { + unsigned short a; + unsigned short b; + unsigned short c; +} s; + +#define A(I) (I) +#define B(I) ((I) * 2) +#define C(I) ((unsigned short) ~((I) ^ 0x18)) + +void __attribute__ ((noinline)) +check1 (s *res) +{ + int i; + + for (i = 0; i < N; i++) + if (res[i].a != C (i) + || res[i].b != A (i) + || res[i].c != B (i)) + abort (); +} + +void __attribute__ ((noinline)) +check2 (unsigned short *res) +{ + int i; + + for (i = 0; i < N; i++) + if (res[i] != (unsigned short) (A (i) + B (i) + C (i))) + abort (); +} + +void __attribute__ ((noinline)) +check3 (s *res) +{ + int i; + + for (i = 0; i < N; i++) + if (res[i].a != i + || res[i].b != i + || res[i].c != i) + abort (); +} + +void __attribute__ ((noinline)) +check4 (unsigned short *res) +{ + int i; + + for (i = 0; i < N; i++) + if (res[i] != (unsigned short) (A (i) + B (i))) + abort (); +} + +void __attribute__ ((noinline)) +main1 (s *arr) +{ + int i; + s *ptr = arr; + s res1[N]; + unsigned short res2[N]; + + for (i = 0; i < N; i++) + { + res1[i].a = arr[i].c; + res1[i].b = arr[i].a; + res1[i].c = arr[i].b; + } + check1 (res1); + + for (i = 0; i < N; i++) + res2[i] = arr[i].a + arr[i].b + arr[i].c; + check2 (res2); + + for (i = 0; i < N; i++) + { + res1[i].a = i; + res1[i].b = i; + res1[i].c = i; + } + check3 (res1); + + for (i = 0; i < N; i++) + res2[i] = arr[i].a + arr[i].b; + check4 (res2); +} + +int main (void) +{ + int i; + s arr[N]; + + check_vect (); + + for (i = 0; i < N; i++) + { + arr[i].a = A (i); + arr[i].b = B (i); + arr[i].c = C (i); + } + main1 (arr); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_strided3 } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c index da5a72855d9..82a6c605674 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c @@ -68,6 +68,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c index 96ee2544242..d743fac1d62 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c @@ -63,6 +63,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c index 5f5a66e6318..663f3763249 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c @@ -77,6 +77,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c index f900b71f10d..d825898a469 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c @@ -60,6 +60,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c index b18b6605851..8055c9b5f8f 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c @@ -71,6 +71,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c index 2f44b8e4a3d..be06437550e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c @@ -54,6 +54,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c index f5285361a3b..349e8693926 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c @@ -78,6 +78,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c index 1bd932b8af7..537bcc87dfb 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c @@ -98,6 +98,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c index be8ef671a36..76cb66d0861 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c @@ -83,6 +83,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c index ff5171d92e6..ff80c0418e9 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c @@ -85,6 +85,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c b/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c index 7d684aa1ff0..2c06ce6b0ae 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c +++ b/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c @@ -53,6 +53,6 @@ main (void) } /* Needs interleaving support. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail { vect_interleave && vect_extract_even_odd } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp index 170c33db2a5..b783ec39ba8 100644 --- a/gcc/testsuite/gcc.dg/vect/vect.exp +++ b/gcc/testsuite/gcc.dg/vect/vect.exp @@ -75,15 +75,20 @@ lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details" lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details" # Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \ - "" $VECT_SLP_CFLAGS - +set VECT_ADDITIONAL_FLAGS [list ""] +if { [check_effective_target_lto] } { + lappend VECT_ADDITIONAL_FLAGS "-flto" +} +foreach flags $VECT_ADDITIONAL_FLAGS { + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \ + $flags $DEFAULT_VECTCFLAGS + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \ + $flags $DEFAULT_VECTCFLAGS + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \ + $flags $DEFAULT_VECTCFLAGS + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \ + $flags $VECT_SLP_CFLAGS +} #### Tests with special options global SAVED_DEFAULT_VECTCFLAGS @@ -210,6 +215,12 @@ lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heaps dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS +# -ftree-loop-if-convert-stores +set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS +lappend DEFAULT_VECTCFLAGS "-ftree-loop-if-convert-stores" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/if-cvt-stores-vect-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS + # With -O3. # Don't allow IPA cloning, because it throws our counts out of whack. set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS diff --git a/gcc/testsuite/gcc.dg/winline-5.c b/gcc/testsuite/gcc.dg/winline-5.c index ad1fc4100bb..a42ae943fe0 100644 --- a/gcc/testsuite/gcc.dg/winline-5.c +++ b/gcc/testsuite/gcc.dg/winline-5.c @@ -15,15 +15,7 @@ inline int q(void) /* { dg-warning "inline-unit-growth" } */ big(); big(); } -inline int q1(void) -{ - big(); - big(); - big(); -} int t (void) { - /* We allow one inlining over limit. */ - q1(); return q (); /* { dg-warning "called from here" } */ } |