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
This commit is contained in:
Tobias Burnus 2014-04-30 21:08:19 +02:00 committed by Tobias Burnus
parent a8a5f4a972
commit 2c060879af
6 changed files with 67 additions and 3 deletions

View File

@ -1,3 +1,10 @@
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.

View File

@ -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

View File

@ -1,3 +1,9 @@
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.

View File

@ -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

View File

@ -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" } }

View File

@ -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" } }
!