diff options
author | Roger Sayle <roger@eyesopen.com> | 2007-01-20 20:12:44 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2007-01-20 20:12:44 +0000 |
commit | b01e2f88ef92c331a9df908212f7ec5ecd537908 (patch) | |
tree | 6d196f924038576c22983777c23d934bf69cf070 /gcc/testsuite | |
parent | 0eadc0917ab47b272102e3f337045c7fe8437a38 (diff) | |
download | gcc-b01e2f88ef92c331a9df908212f7ec5ecd537908.tar.gz |
dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL, i.e.
* dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL,
i.e. that the ARRAY_REF doesn't mention components.
* trans-array.c (gfc_constant_array_constructor_p): Export external
function renamed from constant_array_constructor_p.
(gfc_build_constant_array_constructor): Export.
(gfc_trans_array_constructor): Update call to the renamed function
constant_array_constructor_p.
* trans-array.h (gfc_constant_array_constructor_p): Prototype here.
(gfc_build_constant_array_constructor): Likewise.
* trans-expr.c (gfc_build_memcpy_call): New helper function split
out from gfc_trans_array_copy.
(gfc_trans_array_copy): Use gfc_build_memcpy_call.
(gfc_trans_array_constructor_copy): New function to optimize
assigning an entire array from a constant array constructor.
(gfc_trans_assignment): Call gfc_trans_array_constructor_copy
when appropriate.
* gfortran.dg/array_memcpy_3.f90: New test case.
* gfortran.dg/vect/vect-5.f90: Update vectorized loop count.
From-SVN: r121010
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/array_memcpy_3.f90 | 15 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/vect/vect-5.f90 | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d1b2ddb6533..07d2e5f5fc1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ 2007-01-20 Roger Sayle <roger@eyesopen.com> + + * gfortran.dg/array_memcpy_3.f90: New test case. + * gfortran.dg/vect/vect-5.f90: Update vectorized loop count. + +2007-01-20 Roger Sayle <roger@eyesopen.com> Brooks Moses <brooks.moses@codesourcery.com> Francois-Xavier Coudert <coudert@clipper.ens.fr> diff --git a/gcc/testsuite/gfortran.dg/array_memcpy_3.f90 b/gcc/testsuite/gfortran.dg/array_memcpy_3.f90 new file mode 100644 index 00000000000..05915877b15 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_memcpy_3.f90 @@ -0,0 +1,15 @@ +! { dg-do compile } +! { dg-options "-O2 -fdump-tree-original" } + +subroutine foo(x) + integer :: x(4) + x(:) = (/ 3, 1, 4, 1 /) +end subroutine + +subroutine bar(x) + integer :: x(4) + x = (/ 3, 1, 4, 1 /) +end subroutine + +! { dg-final { scan-tree-dump-times "memcpy" 2 "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/vect/vect-5.f90 b/gcc/testsuite/gfortran.dg/vect/vect-5.f90 index 90b0f325775..d657656ea1c 100644 --- a/gcc/testsuite/gfortran.dg/vect/vect-5.f90 +++ b/gcc/testsuite/gfortran.dg/vect/vect-5.f90 @@ -35,7 +35,7 @@ stop end -! { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } +! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } ! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align } } } } ! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } ! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target { ilp32 && vect_no_align } } } } |