diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 42 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-ssa/sra-1.C | 29 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20070216-1.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr30189.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/andor-1.c | 65 | ||||
-rwxr-xr-x | gcc/testsuite/gcc.dg/vect/vect-106-alias.c | 51 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/enum_4.f90 | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/logical_2.f90 | 26 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/vect/vect-2.f90 | 8 |
10 files changed, 261 insertions, 8 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dcf63303c4e..f1aeffe2b18 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,45 @@ +2007-02-20 Ira Rosen <irar@il.ibm.com> + + * gfortran.dg/vect/vect-2.f90: Xfail to vectorize one of the loops + because of aliasing. + +2007-02-18 Roger Sayle <roger@eyesopen.com> + + PR middle-end/24427 + PR rtl-optimization/28173 + * gcc.dg/tree-ssa/andor-1.c: New test case. + +2007-02-18 Ira Rosen <irar@il.ibm.com> + + * gcc.dg/vect/vect-106-alias.c: New test. + +2007-02-16 Eric Botcazou <ebotcazou@libertysurf.fr> + + * gcc.c-torture/execute/20070216-1.c: New test. + +2007-02-15 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/30799 + * gfortran.dg/logical_2.f90: New test. + +2007-02-15 Alexandre Oliva <aoliva@redhat.com> + + * g++.dg/tree-ssa/sra-1.C: New. + +2007-02-10 Tobias Schlueter <tobi@gcc.gnu.org> + + PR fortran/30478 + * gfortran.dg/enum_4.f90: Update expected error message. + +2007-02-15 Alexandre Oliva <aoliva@redhat.com> + + PR debug/30189 + * gcc.dg/pr30189.c: New test. + +2007-02-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * g++.dg/tree-ssa/nothrow-1.C: Skip test if -fpic/-fPIC is used. + 2007-02-14 Jakub Jelinek <jakub@redhat.com> PR c++/30536 diff --git a/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C b/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C index 6dbf1393a39..4bb71589de3 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fdump-tree-cfg" } */ +/* { dg-skip-if "" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ double a; void t() { diff --git a/gcc/testsuite/g++.dg/tree-ssa/sra-1.C b/gcc/testsuite/g++.dg/tree-ssa/sra-1.C new file mode 100644 index 00000000000..e3e3918eb78 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/sra-1.C @@ -0,0 +1,29 @@ +/* https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=223576 */ + +/* SRA failed to canonicalize bit-field types, introducing type + mismatches. */ + +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +struct A +{ + int a:16; + /* These dummy bit-fields are here to prevent GCC 4.2+ from merging + the bit-field compares into a single word compare, which disables + SRA. */ + int a2:16; + int a3:16; + int a4:16; + int b:8; + bool operator==(A const x) const + { + return (this->a == x.a && this->b == x.b); + } +}; + +bool +foo (A const x, A const y) +{ + return x == y; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20070216-1.c b/gcc/testsuite/gcc.c-torture/execute/20070216-1.c new file mode 100644 index 00000000000..fc235606926 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20070216-1.c @@ -0,0 +1,23 @@ +/* PR rtl-optimization/30787 */ +/* Testcase by Jakub Jelinek <jakub@gcc.gnu.org> */ + +struct S +{ + int *s; +}; + +void test (int x, struct S *y) +{ + int i; + for (i = 0; i < x; i++) + { + if (y) + y->s[i] += 1; + } +} + +int main (void) +{ + test (1, (void *) 0); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr30189.c b/gcc/testsuite/gcc.dg/pr30189.c new file mode 100644 index 00000000000..6aa963e7a10 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr30189.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-g -O" } */ + +extern void foo (void); + +static +void baz (int i) +{ + foo (); + typedef char A[i]; + struct { A b; } *x = 0; +} + +void +bar (i) +{ + baz (i); +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c b/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c new file mode 100644 index 00000000000..1a53857401c --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c @@ -0,0 +1,65 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-original" } */ + +unsigned int test1(unsigned int a) +{ + return (a & 1) | 1; +} + +int test2(int b) +{ + return (b & 1) | 1; +} + +unsigned int test3(unsigned int c) +{ + return (c | 1) & 1; +} + +int test4(int d) +{ + return (d | 1) & 1; +} + +unsigned int test5(unsigned int e) +{ + return (e | 4) & 6; +} + +int test6(int f) +{ + return (f | 4) & 6; +} + +unsigned int test7(unsigned int g) +{ + return (g & -2) | 1; +} + +int test8(int h) +{ + return (h & -2) | 1; +} + +unsigned int test9(unsigned int i) +{ + return (i & 3) | 1; +} + +int test10(int j) +{ + return (j & 3) | 1; +} + +/* { dg-final { scan-tree-dump-times "a \& 1 \\| 1" 0 "original" } } */ +/* { dg-final { scan-tree-dump-times "b \& 1 \\| 1" 0 "original" } } */ +/* { dg-final { scan-tree-dump-times "\\(c \\| 1\\) \& 1" 0 "original" } } */ +/* { dg-final { scan-tree-dump-times "\\(d \\| 1\\) \& 1" 0 "original" } } */ +/* { dg-final { scan-tree-dump-times "e \& 2 \\| 4" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "f \& 2 \\| 4" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "g \\| 1" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "h \\| 1" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "i \& 2 \\| 1" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "j \& 2 \\| 1" 1 "original" } } */ +/* { dg-final { cleanup-tree-dump "original" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/vect-106-alias.c b/gcc/testsuite/gcc.dg/vect/vect-106-alias.c new file mode 100755 index 00000000000..011e7e4c2e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-106-alias.c @@ -0,0 +1,51 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdlib.h> +#include <stdarg.h> +#include "tree-vect.h" + +#define N 9 + +static int a[N] = {1,2,3,4,5,6,7,8,9}; +static int b[N] = {2,3,4,5,6,7,8,9,0}; + +int main1 () { + int i; + int *p, *q, *p1, *q1; + p = (unsigned int *) malloc (sizeof (unsigned int) * N); + q = (unsigned int *) malloc (sizeof (unsigned int) * N); + + p1 = p; q1 = q; + + /* Not vectorizable: because of the redundant cast (caused by ponter + arithmetics), alias analysis fails to distinguish between + the pointers. */ + for (i = 0; i < N; i++) + { + *(q + i) = a[i]; + *(p + i) = b[i]; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (*q != a[i] || *p != b[i]) + abort(); + q++; + p++; + } + + return 0; +} + +int main (void) +{ + check_vect (); + + return main1 (); +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gfortran.dg/enum_4.f90 b/gcc/testsuite/gfortran.dg/enum_4.f90 index 99acda0c818..be506b400db 100644 --- a/gcc/testsuite/gfortran.dg/enum_4.f90 +++ b/gcc/testsuite/gfortran.dg/enum_4.f90 @@ -5,12 +5,12 @@ program main implicit none enum, bind (c) enumerator :: red, black = 2 - enumerator :: blue = 1, red ! { dg-error "already" } + enumerator :: blue = 1, red ! { dg-error "already has basic type" } end enum enum, bind (c) - enumerator :: r, b(10) = 2 ! { dg-error "cannot be array" } - enumerator , save :: g = 1 ! { dg-error "cannot have attributes" } + enumerator :: r, b(10) = 2 ! { dg-error "Syntax error" } + enumerator , save :: g = 1 ! { dg-error "Syntax error" } end ! { dg-error " END ENUM" } end program main ! { dg-excess-errors "" } diff --git a/gcc/testsuite/gfortran.dg/logical_2.f90 b/gcc/testsuite/gfortran.dg/logical_2.f90 new file mode 100644 index 00000000000..1a28fefd50c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/logical_2.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! PR fortran/30799 +! Inconsistent handling of bad (invalid) LOGICAL kinds +! Reporter: Harald Anlauf <anlauf@gmx.de> +! Testcase altered by Steven G. Kargl +program gfcbug57 + implicit none + ! + ! These are logical kinds known by gfortran and many other compilers: + ! + print *, kind (.true._1) ! This prints "1" + print *, kind (.true._2) ! This prints "2" + print *, kind (.true._4) ! This prints "4" + print *, kind (.true._8) ! This prints "8" + ! + ! These are very strange (read: bad (invalid?)) logical kinds, + ! handled inconsistently by gfortran (there's no logical(kind=0) etc.) + ! + print *, kind (.true._0) ! { dg-error "kind for logical constant" } + print *, kind (.true._3) ! { dg-error "kind for logical constant" } + print *, kind (.true._123) ! { dg-error "kind for logical constant" } + ! + ! Here gfortran bails out with a runtime error: + ! + print *, .true._3 ! { dg-error "kind for logical constant" } +end program gfcbug57 diff --git a/gcc/testsuite/gfortran.dg/vect/vect-2.f90 b/gcc/testsuite/gfortran.dg/vect/vect-2.f90 index a881d9726d3..c7f0ad07c53 100644 --- a/gcc/testsuite/gfortran.dg/vect/vect-2.f90 +++ b/gcc/testsuite/gfortran.dg/vect/vect-2.f90 @@ -14,9 +14,7 @@ END ! support unaligned loads) or using peeling to align the store (on targets that ! support unaligned loads). -! { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } -! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail vect_no_align } } } -! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target vect_no_align } } } -! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } -! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" {target vect_no_align } } } +! { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } +! { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } +! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } ! { dg-final { cleanup-tree-dump "vect" } } |