diff options
author | Tobias Burnus <burnus@net-b.de> | 2014-04-30 21:08:19 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2014-04-30 21:08:19 +0200 |
commit | 2c060879af5a92b49c11e70004fcd377f6a5a3ea (patch) | |
tree | 1cfe03d3d0de012ae2a9dd9f1dde82089539a137 /gcc | |
parent | a8a5f4a9721cba832bf734c4be40d4a3f523d031 (diff) | |
download | gcc-2c060879af5a92b49c11e70004fcd377f6a5a3ea.zip gcc-2c060879af5a92b49c11e70004fcd377f6a5a3ea.tar.gz gcc-2c060879af5a92b49c11e70004fcd377f6a5a3ea.tar.bz2 |
resolve.c (resolve_function): Don't do assumed-size check for lcobound/ucobound.
2014-04-30 Tobias Burnus <burnus@net-b.de>
* resolve.c (resolve_function): Don't do
assumed-size check for lcobound/ucobound.
* trans-types.c (gfc_build_array_type): Only build an array
descriptor with codimensions for allocatable coarrays.
2014-04-30 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_lib_this_image_2.f90: Update dump.
* gfortran.dg/coarray_lib_token_4.f90: Ditto.
* gfortran.dg/coarray/codimension.f90: New.
From-SVN: r209952
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray/codimension.f90 | 49 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray_lib_this_image_2.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray_lib_token_4.f90 | 4 |
6 files changed, 67 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3502f48..1dcde5d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,12 @@ 2014-04-30 Tobias Burnus <burnus@net-b.de> + * resolve.c (resolve_function): Don't do + assumed-size check for lcobound/ucobound. + * trans-types.c (gfc_build_array_type): Only build an array + descriptor with codimensions for allocatable coarrays. + +2014-04-30 Tobias Burnus <burnus@net-b.de> + * gfortran.h (gfc_init_coarray_decl): Remove. * parse.c (translate_all_program_units): Remove call to it. (gfc_parse_file): Update call. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 38755fe..15c9463 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -2942,6 +2942,8 @@ resolve_function (gfc_expr *expr) else if (expr->value.function.actual != NULL && expr->value.function.isym != NULL && GENERIC_ID != GFC_ISYM_LBOUND + && GENERIC_ID != GFC_ISYM_LCOBOUND + && GENERIC_ID != GFC_ISYM_UCOBOUND && GENERIC_ID != GFC_ISYM_LEN && GENERIC_ID != GFC_ISYM_LOC && GENERIC_ID != GFC_ISYM_C_LOC diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 74791d9..862f133 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2014-04-30 Tobias Burnus <burnus@net-b.de> + * gfortran.dg/coarray_lib_this_image_2.f90: Update dump. + * gfortran.dg/coarray_lib_token_4.f90: Ditto. + * gfortran.dg/coarray/codimension.f90: New. + +2014-04-30 Tobias Burnus <burnus@net-b.de> + * gfortran.dg/coarray_lib_this_image_1.f90: New. * gfortran.dg/coarray_lib_this_image_2.f90: New. diff --git a/gcc/testsuite/gfortran.dg/coarray/codimension.f90 b/gcc/testsuite/gfortran.dg/coarray/codimension.f90 new file mode 100644 index 0000000..706048f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray/codimension.f90 @@ -0,0 +1,49 @@ +! { dg-do run } +! +! Based on coarray_lib_token_4.f90 but checking whether the bounds +! are correctly handled. +! +program test_caf + implicit none + integer, allocatable :: A(:)[:] + integer, save :: B(3)[*] + integer :: i + + allocate (A(3)[*]) + A = [1, 2, 3 ] + B = [9, 7, 4 ] + call foo (A, A, test=1) + call foo (A(2:3), B, test=2) + call foo (B, A, test=3) +contains + subroutine foo(x, y, test) + integer :: x(:)[*] + integer, contiguous :: y(:)[*] + integer :: test + integer :: i, j + call bar (x) + call expl (y) + i = lcobound(x, dim=1) + j = ucobound(x, dim=1) + if (i /= 1 .or. j /= num_images()) call abort() + i = lcobound(y, dim=1) + j = ucobound(y, dim=1) + if (i /= 1 .or. j /= num_images()) call abort() + end subroutine foo + + subroutine bar(y) + integer :: y(:)[*] + integer :: i, j + i = lcobound(y, dim=1) + j = ucobound(y, dim=1) + if (i /= 1 .or. j /= num_images()) call abort() + end subroutine bar + + subroutine expl(z) + integer :: z(*)[*] + integer :: i, j + i = lcobound(z, dim=1) + j = ucobound(z, dim=1) + if (i /= 1 .or. j /= num_images()) call abort() + end subroutine expl +end program test_caf diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_this_image_2.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_this_image_2.f90 index 9219b2a..afa1a7e 100644 --- a/gcc/testsuite/gfortran.dg/coarray_lib_this_image_2.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_lib_this_image_2.f90 @@ -16,7 +16,7 @@ contains end subroutine bar end -! { dg-final { scan-tree-dump-times "bar \\(struct array2_real\\(kind=4\\) & restrict x, void \\* restrict caf_token.., integer\\(kind=8\\) caf_offset..\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "bar \\(struct array1_real\\(kind=4\\) & restrict x, void \\* restrict caf_token.., integer\\(kind=8\\) caf_offset..\\)" 1 "original" } } ! { dg-final { scan-tree-dump-times "mylcobound = 5;" 1 "original" } } ! { dg-final { scan-tree-dump-times "parm...dim\\\[1\\\].lbound = 5;" 1 "original" } } ! { dg-final { scan-tree-dump-times "myucobound = \\(integer\\(kind=4\\)\\) \\(\\(\\(unsigned int\\) parm...dim\\\[1\\\].lbound \\+ \\(unsigned int\\) _gfortran_caf_num_images \\(0, -1\\)\\) \\+ 4294967295\\);" 1 "original" } } diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_token_4.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_token_4.f90 index 43da9f4..9e445f4 100644 --- a/gcc/testsuite/gfortran.dg/coarray_lib_token_4.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_lib_token_4.f90 @@ -35,9 +35,9 @@ end program test_caf ! { dg-final { scan-tree-dump-times "expl \\(integer\\(kind=4\\).0:. . restrict z, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+\\)" 1 "original" } } ! -! { dg-final { scan-tree-dump-times "bar \\(struct array2_integer\\(kind=4\\) & restrict y, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "bar \\(struct array1_integer\\(kind=4\\) & restrict y, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+\\)" 1 "original" } } ! -! { dg-final { scan-tree-dump-times "foo \\(struct array2_integer\\(kind=4\\) & restrict x, struct array2_integer\\(kind=4\\) & restrict y, integer\\(kind=4\\) & restrict test, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "foo \\(struct array1_integer\\(kind=4\\) & restrict x, struct array1_integer\\(kind=4\\) & restrict y, integer\\(kind=4\\) & restrict test, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+\\)" 1 "original" } } ! ! { dg-final { scan-tree-dump-times "bar \\(&parm.\[0-9\]+, caf_token.\[0-9\]+, \\(\\(integer\\(kind=.\\)\\) parm.\[0-9\]+.data - \\(integer\\(kind=.\\)\\) x.\[0-9\]+\\) \\+ caf_offset.\[0-9\]+\\);" 1 "original" } } ! |