diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
66 files changed, 280 insertions, 420 deletions
diff --git a/gcc/testsuite/gcc.dg/20040203-1.c b/gcc/testsuite/gcc.dg/20040203-1.c index 59c824e..b92c0ec 100644 --- a/gcc/testsuite/gcc.dg/20040203-1.c +++ b/gcc/testsuite/gcc.dg/20040203-1.c @@ -1,6 +1,6 @@ /* PR/13994; bug_cond2 was rejected on gcc up to version 3.4.x */ -/* { dg-do compile }*/ -/* { dg-options "-std=gnu89" }*/ +/* { dg-do compile } */ +/* { dg-options "-std=gnu89" } */ struct s { char c[1]; }; struct s a; diff --git a/gcc/testsuite/gcc.dg/980502-1.c b/gcc/testsuite/gcc.dg/980502-1.c index f06491c..6a64c76 100644 --- a/gcc/testsuite/gcc.dg/980502-1.c +++ b/gcc/testsuite/gcc.dg/980502-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile }*/ +/* { dg-do compile } */ /* { dg-options "-O2" } */ char *const f(void) diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c b/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c index 8d32e85..37c7159 100644 --- a/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c +++ b/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c @@ -102,7 +102,7 @@ void test_listen_on_datagram_socket_with_bind (const char *sockname) memset (&addr, 0, sizeof (addr)); addr.sun_family = AF_UNIX; strncpy (addr.sun_path, sockname, sizeof(addr.sun_path) - 1); - if (bind (fd, (struct sockaddr *)&addr, sizeof (addr)) == -1) /* { dg message "datagram socket bound here" } */ + if (bind (fd, (struct sockaddr *)&addr, sizeof (addr)) == -1) /* { dg-message "datagram socket bound here" } */ { close (fd); return; diff --git a/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c b/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c index 201ca00..6e62a9d 100644 --- a/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c +++ b/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-Wno-stringop-overflow"} */ +/* { dg-additional-options "-Wno-stringop-overflow" } */ /* -Wstringop-overflow= triggers on test5. */ #include <stdint.h> diff --git a/gcc/testsuite/gcc.dg/analyzer/strchr-1.c b/gcc/testsuite/gcc.dg/analyzer/strchr-1.c index 08c429d..181f182 100644 --- a/gcc/testsuite/gcc.dg/analyzer/strchr-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/strchr-1.c @@ -16,13 +16,13 @@ const char* test_literal (int x) void test_2 (const char *s, int c) { - char *p = __builtin_strchr (s, c); /* { dg-message "when '__builtin_strchr' returns NULL"} */ + char *p = __builtin_strchr (s, c); /* { dg-message "when '__builtin_strchr' returns NULL" } */ *p = 'A'; /* { dg-warning "dereference of NULL 'p'" "null deref" } */ } void test_3 (const char *s, int c) { - char *p = strchr (s, c); /* { dg-message "when 'strchr' returns NULL"} */ + char *p = strchr (s, c); /* { dg-message "when 'strchr' returns NULL" } */ *p = 'A'; /* { dg-warning "dereference of NULL 'p'" "null deref" } */ } diff --git a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c index 44141a3..950466b 100644 --- a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c +++ b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c @@ -20,7 +20,7 @@ typedef __SIZE_TYPE__ size_t; /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-19.c b/gcc/testsuite/gcc.dg/builtin-object-size-19.c index 1aab1ef..090d422 100644 --- a/gcc/testsuite/gcc.dg/builtin-object-size-19.c +++ b/gcc/testsuite/gcc.dg/builtin-object-size-19.c @@ -17,7 +17,7 @@ typedef __SIZE_TYPE__ size_t; /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c index 0cd9011..6a89c25 100644 --- a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c +++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c @@ -12,4 +12,4 @@ int variable; /* { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)#define foo bar($|\\n)" } } { dg-final { scan-file-not cmdlne-dM-M.i "variable" } } - { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)cmdlne-dM-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dM-M.c"} } */ + { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)cmdlne-dM-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dM-M.c" } } */ diff --git a/gcc/testsuite/gcc.dg/gomp/attrs-21.c b/gcc/testsuite/gcc.dg/gomp/attrs-21.c index 551fe6c..e572f21 100644 --- a/gcc/testsuite/gcc.dg/gomp/attrs-21.c +++ b/gcc/testsuite/gcc.dg/gomp/attrs-21.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fopenmp -std=c23" */ +/* { dg-options "-fopenmp -std=c23" } */ void foo () diff --git a/gcc/testsuite/gcc.dg/gomp/parallel-2.c b/gcc/testsuite/gcc.dg/gomp/parallel-2.c index b2d653d..38875ad 100644 --- a/gcc/testsuite/gcc.dg/gomp/parallel-2.c +++ b/gcc/testsuite/gcc.dg/gomp/parallel-2.c @@ -8,7 +8,7 @@ void foo() { #pragma omp parallel { - #pragma omp parallel default(none) // { dg-message: "note: enclosing 'parallel'" } + #pragma omp parallel default(none) // { dg-message "note: enclosing 'parallel'" } { i++; // { dg-error "not specified" } } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c new file mode 100644 index 0000000..ab328ba --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-icf-optimized" } */ + +int c0 = 0; +typedef int v4si __attribute__((vector_size(4*sizeof(int)))); +v4si a; +int f() +{ + return a[c0]; +} +int g() +{ + return a[c0]; +} + +/* { dg-final { scan-ipa-dump "optimized: Semantic equality hit:f/\[0-9+\]+->g/\[0-9+\]+" "icf" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c index 75619c6..81bfd3c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -fipa-sra -fdump-ipa-sra" } */ +/* { dg-options "-O2 -fipa-sra -fdump-ipa-sra" } */ /* Check of a transitive recursive structure split. */ diff --git a/gcc/testsuite/gcc.dg/ipa/pr110377.c b/gcc/testsuite/gcc.dg/ipa/pr110377.c index 63120a9..76faef5 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr110377.c +++ b/gcc/testsuite/gcc.dg/ipa/pr110377.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2 -fdump-ipa-cp" } */ int test3(int); __attribute__ ((noinline)) diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-1.c b/gcc/testsuite/gcc.dg/plugin/infoleak-1.c index 4c5a86a..07e3101 100644 --- a/gcc/testsuite/gcc.dg/plugin/infoleak-1.c +++ b/gcc/testsuite/gcc.dg/plugin/infoleak-1.c @@ -69,7 +69,7 @@ void test_2d (void __user *dst, u32 a) { struct s2 s = {0}; s.i = a; - copy_to_user(dst, &s, sizeof (struct s2)); /* { dg-bogus" } */ + copy_to_user(dst, &s, sizeof (struct s2)); /* { dg-bogus "" } */ } struct empty {}; diff --git a/gcc/testsuite/gcc.dg/pr101364-1.c b/gcc/testsuite/gcc.dg/pr101364-1.c index e7c94a0..c2e3211 100644 --- a/gcc/testsuite/gcc.dg/pr101364-1.c +++ b/gcc/testsuite/gcc.dg/pr101364-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=c90 "} */ +/* { dg-options "-std=c90" } */ void fruit(); /* { dg-message "previous declaration" } */ void fruit( /* { dg-error "conflicting types for" } */ diff --git a/gcc/testsuite/gcc.dg/pr110992.c b/gcc/testsuite/gcc.dg/pr110992.c new file mode 100644 index 0000000..05e9b92 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr110992.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-evrp" } */ + +void foo (int); + +int f(unsigned b, short c) +{ + int bt = b; + int bt1 = bt; + int t = bt1 & -(c!=0); + // int t = bt1 * (c!=0); + + if (!t) return 0; + foo(bt == 0); + return 0; +} + +/* { dg-final { scan-tree-dump-times "foo \\(0\\)" 1 "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr113207.c b/gcc/testsuite/gcc.dg/pr113207.c index 81f53d8..a8bc80d 100644 --- a/gcc/testsuite/gcc.dg/pr113207.c +++ b/gcc/testsuite/gcc.dg/pr113207.c @@ -1,4 +1,4 @@ -/* { dg-compile } */ +/* { dg-do compile } */ /* { dg-require-effective-target lto } */ /* { dg-options "-flto -fchecking" } */ diff --git a/gcc/testsuite/gcc.dg/pr118765-2.c b/gcc/testsuite/gcc.dg/pr118765-2.c new file mode 100644 index 0000000..0c3e498 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr118765-2.c @@ -0,0 +1,33 @@ +/* { dg-do "compile" } */ +/* { dg-options "-std=gnu23" } */ + +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; + +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; + +extern struct s { int x; } s; +extern struct s { int x; } s; +extern struct s { int x; } s; +extern struct s { int x; } s; +extern struct s { int x; } s; + +struct t { int x; }; +struct t { int x; }; +struct t { int x; }; +struct t { int x; }; +struct t { int x; }; + +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; + diff --git a/gcc/testsuite/gcc.dg/pr118765-3.c b/gcc/testsuite/gcc.dg/pr118765-3.c new file mode 100644 index 0000000..e86d110 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr118765-3.c @@ -0,0 +1,33 @@ +/* { dg-do "compile" } */ +/* { dg-options "-std=gnu23" } */ + +typedef struct q { int x; } q_t; +typedef struct q q_t; +typedef struct q { int x; } q_t; +typedef struct q q_t; +typedef struct q { int x; } q_t; + +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; + +extern struct s { int x; } s; +extern struct s s; +extern struct s { int x; } s; +extern struct s s; +extern struct s { int x; } s; + +struct t { int x; }; +struct t; +struct t { int x; }; +struct t; +struct t { int x; }; + +typedef enum e { E = 1 } e_t; +typedef enum e_t; /* { dg-warning "useless storage class specifier in empty declaration" } */ +typedef enum e { E = 1 } e_t; +typedef enum e_t; /* { dg-warning "empty declaration with storage class specifier does not redeclare tag" } */ +typedef enum e { E = 1 } e_t; + diff --git a/gcc/testsuite/gcc.dg/pr119471.c b/gcc/testsuite/gcc.dg/pr119471.c new file mode 100644 index 0000000..4c55d85 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr119471.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-evrp" } */ + +int fa(int a, int b) +{ + int c = a * b; + if (c != 0) + return (a != 0); + return 0; +} +int fb(int a, int b) +{ + int c = a * b; + if (c != 0) + return (b != 0); + return 0; +} + +/* { dg-final { scan-tree-dump-times "PHI <1" 2 "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr35468.c b/gcc/testsuite/gcc.dg/pr35468.c index 085c073..1bd7a9d 100644 --- a/gcc/testsuite/gcc.dg/pr35468.c +++ b/gcc/testsuite/gcc.dg/pr35468.c @@ -1,5 +1,5 @@ /* PR tree-optimization/35468 */ -/* { dg-do compile }*/ +/* { dg-do compile } */ /* { dg-options "-O2 -fno-tree-dce" } */ char *const f(void) diff --git a/gcc/testsuite/gcc.dg/pr82597.c b/gcc/testsuite/gcc.dg/pr82597.c index 98ae264..5c034f3 100644 --- a/gcc/testsuite/gcc.dg/pr82597.c +++ b/gcc/testsuite/gcc.dg/pr82597.c @@ -1,5 +1,5 @@ /* PR rtl-optimization/82597 */ -/* { dg-do compile }*/ +/* { dg-do compile } */ /* { dg-options "-O2 -funroll-loops" } */ int pb; diff --git a/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c b/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c index d5e3b0c..643a709 100644 --- a/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c +++ b/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c @@ -1,6 +1,6 @@ +/* { dg-do compile } */ /* { dg-require-effective-target analyzer } */ /* { dg-options "-fanalyzer -fdiagnostics-format=sarif-file" } */ -/* { dg-do compile } */ /* Verify that SARIF output can capture chains of include files in diagnostic paths within result locations. diff --git a/gcc/testsuite/gcc.dg/strlenopt-40.c b/gcc/testsuite/gcc.dg/strlenopt-40.c index 7a97ebb..3e61c71 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-40.c +++ b/gcc/testsuite/gcc.dg/strlenopt-40.c @@ -19,7 +19,7 @@ /* Macros to emit a call to funcation named call_in_{true,false}_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM_TRUE(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -30,7 +30,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-44.c b/gcc/testsuite/gcc.dg/strlenopt-44.c index 0af78ac..239695c 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-44.c +++ b/gcc/testsuite/gcc.dg/strlenopt-44.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ASSERT_ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -25,7 +25,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define ASSERT_KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-45.c b/gcc/testsuite/gcc.dg/strlenopt-45.c index 31c1e53..61637b9 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-45.c +++ b/gcc/testsuite/gcc.dg/strlenopt-45.c @@ -26,7 +26,7 @@ extern size_t strnlen (const char *, size_t); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -34,7 +34,7 @@ extern size_t strnlen (const char *, size_t); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-50.c b/gcc/testsuite/gcc.dg/strlenopt-50.c index 8e7c9db..b78ffba 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-50.c +++ b/gcc/testsuite/gcc.dg/strlenopt-50.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-51.c b/gcc/testsuite/gcc.dg/strlenopt-51.c index 22a8938..7b5d261 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-51.c +++ b/gcc/testsuite/gcc.dg/strlenopt-51.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-52.c b/gcc/testsuite/gcc.dg/strlenopt-52.c index 97b3da7..29727dd 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-52.c +++ b/gcc/testsuite/gcc.dg/strlenopt-52.c @@ -16,7 +16,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-53.c b/gcc/testsuite/gcc.dg/strlenopt-53.c index 489c22b..298665c 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-53.c +++ b/gcc/testsuite/gcc.dg/strlenopt-53.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-54.c b/gcc/testsuite/gcc.dg/strlenopt-54.c index d4e57ff..1044162 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-54.c +++ b/gcc/testsuite/gcc.dg/strlenopt-54.c @@ -16,7 +16,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-55.c b/gcc/testsuite/gcc.dg/strlenopt-55.c index ca89ecd..6b54db8 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-55.c +++ b/gcc/testsuite/gcc.dg/strlenopt-55.c @@ -157,7 +157,7 @@ const char ax_100_3[] = { '1', '2', '3', [100] = '\0' }; /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-58.c b/gcc/testsuite/gcc.dg/strlenopt-58.c index 034961c..6bfc389 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-58.c +++ b/gcc/testsuite/gcc.dg/strlenopt-58.c @@ -24,7 +24,7 @@ extern void* memchr (const void*, int, size_t); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-59.c b/gcc/testsuite/gcc.dg/strlenopt-59.c index 9bacf87..58bb74b 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-59.c +++ b/gcc/testsuite/gcc.dg/strlenopt-59.c @@ -20,7 +20,7 @@ extern __SIZE_TYPE__ strlen (const char*); /* Macros to emit a call to funcation named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (test_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-62.c b/gcc/testsuite/gcc.dg/strlenopt-62.c index 0e09a7a..38edfde 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-62.c +++ b/gcc/testsuite/gcc.dg/strlenopt-62.c @@ -21,7 +21,7 @@ typedef __INT32_TYPE__ int32_t; /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-65.c b/gcc/testsuite/gcc.dg/strlenopt-65.c index 521d7ac..23c69ef 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-65.c +++ b/gcc/testsuite/gcc.dg/strlenopt-65.c @@ -17,7 +17,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM_IF_TRUE(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -25,7 +25,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define TEST_KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-70.c b/gcc/testsuite/gcc.dg/strlenopt-70.c index 0853023..b2dac9a 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-70.c +++ b/gcc/testsuite/gcc.dg/strlenopt-70.c @@ -28,7 +28,7 @@ typedef __UINT64_TYPE__ uint64_t; /* Macros to emit a call to function named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-72.c b/gcc/testsuite/gcc.dg/strlenopt-72.c index 9c00a95..b1ae20d 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-72.c +++ b/gcc/testsuite/gcc.dg/strlenopt-72.c @@ -26,7 +26,7 @@ /* Macros to emit a call to function named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-73.c b/gcc/testsuite/gcc.dg/strlenopt-73.c index 6e15303..f439247 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-73.c +++ b/gcc/testsuite/gcc.dg/strlenopt-73.c @@ -26,7 +26,7 @@ /* Macros to emit a call to function named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-77.c b/gcc/testsuite/gcc.dg/strlenopt-77.c index 76cd11d..44d2bc6 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-77.c +++ b/gcc/testsuite/gcc.dg/strlenopt-77.c @@ -17,7 +17,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ASSERT_ELIM(expr) \ if (!!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-82.c b/gcc/testsuite/gcc.dg/strlenopt-82.c index 8070f6c..e1e60f4 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-82.c +++ b/gcc/testsuite/gcc.dg/strlenopt-82.c @@ -21,7 +21,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -29,7 +29,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strub-pr118007.c b/gcc/testsuite/gcc.dg/strub-pr118007.c index 51f4824..92cd31e 100644 --- a/gcc/testsuite/gcc.dg/strub-pr118007.c +++ b/gcc/testsuite/gcc.dg/strub-pr118007.c @@ -1,5 +1,5 @@ -/* { dg-require-effective-target strub } */ /* { dg-do compile } */ +/* { dg-require-effective-target strub } */ /* { dg-options "-fstrub=all -O2" } */ void rb_ec_error_print(struct rb_execution_context_struct *volatile) {} /* { dg-warning "declared inside parameter list" } */ diff --git a/gcc/testsuite/gcc.dg/tanhbysinh.c b/gcc/testsuite/gcc.dg/tanhbysinh.c index 9dbe133..74fdd52 100644 --- a/gcc/testsuite/gcc.dg/tanhbysinh.c +++ b/gcc/testsuite/gcc.dg/tanhbysinh.c @@ -30,12 +30,12 @@ tanhbysinhl_ (long double x) /* There must be no calls to sinh or atanh */ /* There must be calls to cosh */ -/* {dg-final { scan-tree-dump-not "sinh " "optimized" } } */ -/* {dg-final { scan-tree-dump-not "tanh " "optimized" }} */ -/* {dg-final { scan-tree-dump-not "sinhf " "optimized" } } */ -/* {dg-final { scan-tree-dump-not "tanhf " "optimized" }} */ -/* {dg-final { scan-tree-dump-not "sinhl " "optimized" } } */ -/* {dg-final { scan-tree-dump-not "tanhl " "optimized" }} */ +/* { dg-final { scan-tree-dump-not "sinh " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "tanh " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "sinhf " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "tanhf " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "sinhl " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "tanhl " "optimized" } } */ /* { dg-final { scan-tree-dump "cosh " "optimized" } } */ /* { dg-final { scan-tree-dump "coshf " "optimized" } } */ /* { dg-final { scan-tree-dump "coshl " "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr117811.c b/gcc/testsuite/gcc.dg/torture/pr117811.c new file mode 100644 index 0000000..13d7e13 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr117811.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ + +#include <string.h> + +typedef int v4 __attribute__((vector_size (4 * sizeof (int)))); + +void __attribute__((noclone,noinline)) do_shift (v4 *vec, int shift) +{ + v4 t = *vec; + + if (shift > 0) + { + t = t >> shift; + } + + *vec = t; +} + +int main () +{ + v4 vec = {0x1000000, 0x2000, 0x300, 0x40}; + v4 vec2 = {0x100000, 0x200, 0x30, 0x4}; + do_shift (&vec, 4); + if (memcmp (&vec, &vec2, sizeof (v4)) != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr119133.c b/gcc/testsuite/gcc.dg/torture/pr119133.c index 5369bec..f0c8f73 100644 --- a/gcc/testsuite/gcc.dg/torture/pr119133.c +++ b/gcc/testsuite/gcc.dg/torture/pr119133.c @@ -1,5 +1,6 @@ /* { dg-additional-options "-fno-tree-ter" } */ /* { dg-require-effective-target float16 } */ +/* { dg-add-options float16 } */ int foo(_Float16 f, int i) diff --git a/gcc/testsuite/gcc.dg/torture/pr119417.c b/gcc/testsuite/gcc.dg/torture/pr119417.c new file mode 100644 index 0000000..d0b5378 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr119417.c @@ -0,0 +1,24 @@ +/* PR tree-optimization/119417 */ +/* { dg-do run { target int32 } } */ + +__attribute__((noipa)) void +foo (unsigned long long x) +{ + if (x != 0) + __builtin_abort (); +} + +unsigned v = 0x10000; + +int +main () +{ + unsigned long long a = 0; + while (1) + { + a = a + ((v & 0xFFFF) * 2); + foo (a); + if (v) + break; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr119532.c b/gcc/testsuite/gcc.dg/torture/pr119532.c new file mode 100644 index 0000000..bba2e45 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr119532.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fixed_point } */ + +extern _Fract sinuhk_deg (unsigned short _Accum); + +_Fract cosuhk_deg (unsigned short _Accum deg) +{ + unsigned short _Accum _90_deg = 90uhk; + __asm ("" : "+r" (_90_deg)); + + return deg <= _90_deg + ? sinuhk_deg (_90_deg - deg) + : -sinuhk_deg (deg - _90_deg); +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c index 97a385e..d25a960 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c @@ -26,7 +26,7 @@ extern int vsnprintf (char*, size_t, const char*, va_list); /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each expression that's expected to fold to false but that - GCC does not fold. The dg-final scan-tree-dump-time directive + GCC does not fold. The dg-final scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ @@ -35,7 +35,7 @@ extern int vsnprintf (char*, size_t, const char*, va_list); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c index df09c81..806a1f4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c @@ -23,7 +23,7 @@ int snprintf (char * restrict, size_t, const char *restrict, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c index bf5072e..f7cb280 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c @@ -25,7 +25,7 @@ void sink (void*, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define VERIFY_ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 @@ -33,7 +33,7 @@ void sink (void*, ...); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define VERIFY_KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c index 489af62..73e807f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c @@ -21,7 +21,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -29,7 +29,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c index 3be18c7..fca7800 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c @@ -20,7 +20,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each expression that's expected to fold to false but that - GCC does not fold. The dg-final scan-tree-dump-time directive + GCC does not fold. The dg-final scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ @@ -29,7 +29,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c index 3ee43e5..9b180d5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c @@ -16,7 +16,7 @@ int f(int t, int c) } /* There should be no ifs as this is converted into `(t != 0) & (c != 0)`. -/* { dg-final { scan-tree-dump-not "if" "optimized" } }*/ +/* { dg-final { scan-tree-dump-not "if" "optimized" } } */ /* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = c_\[0-9\]*.D. != 0" 1 "optimized" } } */ /* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = t_\[0-9\]*.D. != 0" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c index 8062eb1..12ba475 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* PR treee-optimization/114894 */ +/* PR tree-optimization/114894 */ /* Phi-OPT should be able to optimize these without sinking being invoked. */ /* { dg-options "-O -fdump-tree-phiopt2 -fdump-tree-phiopt3 -fdump-tree-optimized -fno-tree-sink" } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr98265.C b/gcc/testsuite/gcc.dg/tree-ssa/pr98265.C deleted file mode 100644 index 9c798e6..0000000 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr98265.C +++ /dev/null @@ -1,348 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -extern void __assert_fail(const char*, const char*, int, const char*); -namespace Eigen { -enum { AutoAlign }; -template <int, typename> -struct conditional; -template <typename Else> -struct conditional<false, Else> { - typedef Else type; -}; -template <typename T> -struct remove_reference { - typedef T type; -}; -struct is_arithmetic { - enum { value }; -}; -template <typename> -struct traits; -template <typename T> -struct traits<const T> : traits<T> {}; -template <typename> -struct evaluator; -template <typename> -struct EigenBase; -template <typename> -class PlainObjectBase; -template <typename, int _Rows, int _Cols, int = AutoAlign, int = _Rows, - int = _Cols> -class Matrix; -template <typename> -class MatrixBase; -template <typename, typename> -class CwiseNullaryOp; -template <typename, typename, typename> -class CwiseBinaryOp; -template <typename> -struct scalar_constant_op; -template <int _Rows> -struct size_at_compile_time { - enum { ret = _Rows }; -}; -struct ref_selector { - typedef const Matrix<float, 3, 1>& type; -}; -template <typename Derived> -struct dense_xpr_base { - typedef MatrixBase<Derived> type; -}; -template <typename Derived, typename = typename traits<Derived>::XprKind> -struct generic_xpr_base { - typedef typename dense_xpr_base<Derived>::type type; -}; -template <typename Expr, typename Scalar = typename Expr::Scalar> -struct plain_constant_type { - ; - typedef CwiseNullaryOp<scalar_constant_op<Scalar>, - Matrix<Scalar, traits<Expr>::ColsAtCompileTime, - traits<Expr>::MaxRowsAtCompileTime, - traits<Expr>::MaxColsAtCompileTime>> - type; -}; -struct scalar_product_op { - float operator()(float a, float b) { return a * b; } -}; -template <typename> -struct scalar_constant_op { - scalar_constant_op(float other) : m_other(other) {} - float operator()() { return m_other; } - float m_other; -}; -struct assign_op { - void assignCoeff(float& a, float b) { a = b; } -}; -template <typename Derived> -class DenseCoeffsBase : public EigenBase<Derived> { - public: - typedef typename traits<Derived>::Scalar Scalar; - typedef - typename conditional<is_arithmetic::value, Scalar>::type CoeffReturnType; -}; -template <typename Derived> -class DenseBase : public DenseCoeffsBase<Derived> { - public: - enum { - RowsAtCompileTime = traits<Derived>::RowsAtCompileTime, - SizeAtCompileTime = size_at_compile_time<RowsAtCompileTime>::ret, - MaxSizeAtCompileTime - }; -}; -template <typename Derived> -class MatrixBase : public DenseBase<Derived> { - public: - using DenseBase<Derived>::derived; - template <typename T> - CwiseBinaryOp<scalar_product_op, const Derived, - const typename plain_constant_type<Derived, T>::type> - operator*(T& scalar) { - return CwiseBinaryOp<scalar_product_op, const Derived, - const typename plain_constant_type<Derived>::type>( - derived(), typename plain_constant_type<Derived>::type(derived().rows(), - 0, scalar)); - } -}; -template <typename Derived> -struct EigenBase { - const Derived& derived() const { return *static_cast<const Derived*>(this); } - Derived& const_cast_derived() const { - return *static_cast<Derived*>(const_cast<EigenBase*>(this)); - } -}; -template <typename> -struct binary_evaluator; -template <typename T> -struct evaluator<const T> : evaluator<T> { - evaluator(const T& xpr) : evaluator<T>(xpr) {} -}; -template <typename Derived> -struct evaluator { - typedef Derived PlainObjectType; - typedef typename PlainObjectType::Scalar Scalar; - evaluator(const PlainObjectType& m) : m_data(m.data()) {} - typename PlainObjectType::CoeffReturnType coeff(long row, long) { - return m_data[row]; - } - Scalar& coeffRef(long row, long) { return const_cast<Scalar*>(m_data)[row]; } - const Scalar* m_data; -}; -template <typename Scalar, int Rows, int Cols, int Options, int MaxRows, - int MaxCols> -struct evaluator<Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols>> - : evaluator<PlainObjectBase<Matrix<Scalar, Rows, Cols>>> { - typedef Matrix<Scalar, Rows, Cols> XprType; - evaluator(const XprType& m) : evaluator<PlainObjectBase<XprType>>(m) {} -}; -struct nullary_wrapper { - template <typename IndexType> - float operator()(scalar_constant_op<float> op, IndexType, IndexType) const { - return op(); - } -}; -template <typename NullaryOp, typename PlainObjectType> -struct evaluator<CwiseNullaryOp<NullaryOp, PlainObjectType>> { - typedef CwiseNullaryOp<NullaryOp, PlainObjectType> XprType; - evaluator(XprType n) : m_functor(n.functor()) {} - template <typename IndexType> - typename XprType::CoeffReturnType coeff(IndexType row, IndexType col) { - return m_wrapper(m_functor, row, col); - } - NullaryOp m_functor; - nullary_wrapper m_wrapper; -}; -template <typename BinaryOp, typename Lhs, typename Rhs> -struct evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>> - : binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>> { - evaluator(CwiseBinaryOp<BinaryOp, Lhs, Rhs> xpr) - : binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>>(xpr) {} -}; -template <typename BinaryOp, typename Lhs, typename Rhs> -struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>> { - typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType; - binary_evaluator(XprType xpr) : m_lhsImpl(xpr.lhs()), m_rhsImpl(xpr.rhs()) {} - typename XprType::CoeffReturnType coeff(long row, long col) { - return m_functor(m_lhsImpl.coeff(row, col), m_rhsImpl.coeff(row, col)); - } - BinaryOp m_functor; - evaluator<Lhs> m_lhsImpl; - evaluator<Rhs> m_rhsImpl; -}; -template <typename Kernel, int Index, int Stop> -struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling { - enum { outer, inner = Index }; - static void run(Kernel kernel) { - kernel.assignCoeffByOuterInner(outer, inner); - copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, Index + 1, - Stop>::run(kernel); - } -}; -template <typename Kernel, int Stop> -struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, Stop, - Stop> { - static void run(Kernel) {} -}; -template <typename Kernel> -struct dense_assignment_loop { - static void run(Kernel kernel) { - typedef typename Kernel::DstEvaluatorType::XprType DstXprType; - enum { size = DstXprType::SizeAtCompileTime, alignedSize = 0 }; - copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, alignedSize, - size>::run(kernel); - } -}; -template <typename DstEvaluatorTypeT, typename SrcEvaluatorTypeT, - typename Functor> -class generic_dense_assignment_kernel { - typedef typename DstEvaluatorTypeT::XprType DstXprType; - - public: - typedef DstEvaluatorTypeT DstEvaluatorType; - typedef SrcEvaluatorTypeT SrcEvaluatorType; - generic_dense_assignment_kernel(DstEvaluatorType dst, SrcEvaluatorType src, - Functor, DstXprType& dstExpr) - : m_dst(dst), m_src(src), m_dstExpr(dstExpr) {} - long assignCoeff_col; - void assignCoeffByOuterInner(long, long inner) { - long __trans_tmp_1 = inner; - m_functor.assignCoeff(m_dst.coeffRef(__trans_tmp_1, assignCoeff_col), - m_src.coeff(__trans_tmp_1, assignCoeff_col)); - } - DstEvaluatorType m_dst; - SrcEvaluatorType m_src; - Functor m_functor; - DstXprType& m_dstExpr; -}; -template <typename DstXprType, typename SrcXprType, typename Functor> -void call_dense_assignment_loop(DstXprType& dst, SrcXprType src, Functor func) { - typedef evaluator<DstXprType> DstEvaluatorType; - typedef evaluator<SrcXprType> SrcEvaluatorType; - SrcEvaluatorType srcEvaluator(src); - DstEvaluatorType dstEvaluator(dst); - typedef generic_dense_assignment_kernel<DstEvaluatorType, SrcEvaluatorType, - Functor> - Kernel; - Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived()); - dense_assignment_loop<Kernel>::run(kernel); -} -template <typename Dst, typename Src, typename Func> -void call_assignment_no_alias(Dst& dst, Src src, Func func) { - enum { NeedToTranspose }; - typename conditional<NeedToTranspose, Dst&>::type actualDst(dst); - CwiseBinaryOp<scalar_product_op, const Matrix<float, 3, 1>, - const CwiseNullaryOp<scalar_constant_op<float>, - const Matrix<float, 3, 1, 0, 2, 3>>> - __trans_tmp_4 = src; - call_dense_assignment_loop(actualDst, __trans_tmp_4, func); -} -template <int Size> -struct plain_array { - float array[Size]; -}; -template <int Size, int _Rows> -class DenseStorage { - plain_array<Size> m_data; - - public: - DenseStorage() {} - DenseStorage(const DenseStorage&); - static long rows() { return _Rows; } - const float* data() const { return m_data.array; } - float* data() { return m_data.array; } -}; -template <typename Derived> -class PlainObjectBase : public dense_xpr_base<Derived>::type { - public: - typedef typename dense_xpr_base<Derived>::type Base; - typedef typename traits<Derived>::Scalar Scalar; - DenseStorage<Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime> m_storage; - long rows() const { return m_storage.rows(); } - const Scalar* data() const { return m_storage.data(); } - PlainObjectBase() {} - template <typename OtherDerived> - PlainObjectBase(const DenseBase<OtherDerived>& other) { - _set_noalias(other); - } - template <typename OtherDerived> - void _set_noalias(const DenseBase<OtherDerived>& other) { - call_assignment_no_alias(this->derived(), other.derived(), assign_op()); - } -}; -template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, - int _MaxCols> -struct traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>> { - typedef _Scalar Scalar; - typedef int XprKind; - enum { - RowsAtCompileTime = _Rows, - ColsAtCompileTime, - MaxRowsAtCompileTime, - MaxColsAtCompileTime, - }; -}; -template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, - int _MaxCols> -class Matrix - : public PlainObjectBase< - Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>> { - public: - typedef PlainObjectBase<Matrix> Base; - typedef typename traits<Matrix>::Scalar Scalar; - Matrix(Scalar& x, Scalar& y, Scalar& z) { - m_storage.data()[0] = x; - m_storage.data()[1] = y; - m_storage.data()[2] = z; - } - template <typename OtherDerived> - Matrix(const EigenBase<OtherDerived>& other) : Base(other.derived()) {} - using Base::m_storage; -}; -template <typename BinaryOp, typename Lhs, typename Rhs> -struct traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs>> { - typedef typename traits<Lhs>::XprKind XprKind; - enum { RowsAtCompileTime }; - typedef float Scalar; -}; -template <typename> -class CwiseBinaryOpImpl; -template <typename, typename, typename RhsType> -class CwiseBinaryOp : public CwiseBinaryOpImpl<RhsType> { - public: - typedef ref_selector::type LhsNested; - typedef RhsType RhsNested; - CwiseBinaryOp(const Matrix<float, 3, 1>& aLhs, RhsType& aRhs) - : m_lhs(aLhs), m_rhs(aRhs) {} - remove_reference<LhsNested>::type& lhs() { return m_lhs; } - typename remove_reference<RhsNested>::type& rhs() { return m_rhs; } - LhsNested m_lhs; - RhsNested m_rhs; -}; -template <typename> -class CwiseBinaryOpImpl - : public generic_xpr_base<CwiseBinaryOp< - scalar_product_op, const Matrix<float, 3, 1>, - const CwiseNullaryOp<scalar_constant_op<float>, - const Matrix<float, 3, 1, 0, 2, 3>>>>::type {}; -template <typename NullaryOp, typename PlainObjectType> -struct traits<CwiseNullaryOp<NullaryOp, PlainObjectType>> - : traits<PlainObjectType> {}; -template <typename, typename PlainObjectType> -class CwiseNullaryOp - : public dense_xpr_base<CwiseNullaryOp<int, PlainObjectType>>::type { - public: - CwiseNullaryOp(long rows, long, scalar_constant_op<float> func) - : m_functor(func) { - rows ? void() : __assert_fail("", "", 1, __PRETTY_FUNCTION__); - } - scalar_constant_op<float> functor() { return m_functor; } - scalar_constant_op<float> m_functor; -}; -} // namespace Eigen -Eigen::Matrix<float, 3, 1> should_inline(float x, float y, float z, - float scale) { - return Eigen::Matrix<float, 3, 1>(x, y, z) * scale; -} - -// We should inline everything to should_inline - -/* { dg-final { scan-tree-dump-times "Function" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c index 093e7a5..545f316 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c @@ -25,4 +25,4 @@ int main () return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests .* 26" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests .* 26" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c index fa661d9..a89e068 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c @@ -23,4 +23,4 @@ main () __builtin_abort (); return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 3 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 3 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c index a4da8f7..1c4041b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c @@ -20,4 +20,4 @@ int main () __builtin_abort (); return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c index dde5d84..a81846c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c @@ -22,4 +22,4 @@ main () return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c index ffea714..a0489b9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c @@ -21,4 +21,4 @@ int main () return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c index 9befe18..de75566 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c @@ -104,4 +104,4 @@ f13 (double x) /* Can't reassoc here. */ return bar (tmp1 * tmp2, tmp2); } -/* { dg-final { scan-tree-dump-times "Optimizing copysign" 12 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing copysign" 12 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c index 8a18b88..9624c75 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c @@ -18,4 +18,4 @@ f2 (double y) return (-1.2 * __builtin_copysign (1.1, y)); } -/* { dg-final { scan-tree-dump-times "Optimizing copysign" 2 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing copysign" 2 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/typedef-redecl3.c b/gcc/testsuite/gcc.dg/typedef-redecl3.c new file mode 100644 index 0000000..a2424d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/typedef-redecl3.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ + +#define N 64 + +struct f { int x; }; +typedef struct f T; +typedef struct f T __attribute__((aligned (N))); +typedef struct f T __attribute__((aligned (N * 2))); +typedef struct f T __attribute__((aligned (N))); +typedef struct f T; + +_Static_assert (_Alignof (T) == N * 2, "N * 2"); + +enum g { A = 1 }; +typedef enum g S; +typedef enum g S __attribute__((aligned (N))); +typedef enum g S __attribute__((aligned (N * 2))); +typedef enum g S __attribute__((aligned (N))); +typedef enum g S; + +_Static_assert (_Alignof (S) == N * 2, "N * 2"); + diff --git a/gcc/testsuite/gcc.dg/uninit-pred-3_c.c b/gcc/testsuite/gcc.dg/uninit-pred-3_c.c index 1309790..2125448 100644 --- a/gcc/testsuite/gcc.dg/uninit-pred-3_c.c +++ b/gcc/testsuite/gcc.dg/uninit-pred-3_c.c @@ -23,6 +23,6 @@ int foo (int n, int m, int r) if (r > 0) if (flag < 0) - blah(v); /* {dg-bogus "uninitialized" "bogus warning" } */ + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ return 0; } diff --git a/gcc/testsuite/gcc.dg/uninit-pred-3_d.c b/gcc/testsuite/gcc.dg/uninit-pred-3_d.c index 9f93876..272e46b 100644 --- a/gcc/testsuite/gcc.dg/uninit-pred-3_d.c +++ b/gcc/testsuite/gcc.dg/uninit-pred-3_d.c @@ -23,6 +23,6 @@ int foo (int n, int m, int r) if (r > 0) if (flag == -1) - blah(v); /* {dg-bogus "uninitialized" "bogus warning" } */ + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ return 0; } diff --git a/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c b/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c index 3924937..2267af5 100644 --- a/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c +++ b/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c @@ -26,6 +26,6 @@ union flex_union_mid1 { int a; struct outer_flex_mid1 b; }; /* { dg-bogus "struc struct flexn { int n; int data[8]; }; struct out_flex_endn { int m; struct flexn flex_data; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ -struct out_flex_midn { struct flexn flex_data; int m; }; /* { dg-bogus"structure containing a flexible array member is not at the end of another structure" } */ -struct outer_flex_midn { struct out_flex_midn out_flex_data; int p; }; /* { dg-bogus"structure containing a flexible array member is not at the end of another structure" } */ +struct out_flex_midn { struct flexn flex_data; int m; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ +struct outer_flex_midn { struct out_flex_midn out_flex_data; int p; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ union flex_union_midn { int a; struct outer_flex_midn b; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ |