Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

[flang] More support for assumed-size Cray pointees (bug #77330 in trunk), Part #2 #257

Merged
merged 1 commit into from
Jan 11, 2024
Merged

[flang] More support for assumed-size Cray pointees (bug #77330 in trunk), Part #2 #257

merged 1 commit into from
Jan 11, 2024

Conversation

mjklemm
Copy link
Contributor

@mjklemm mjklemm commented Jan 11, 2024

No description provided.

Recognize Cray pointees as such when they are declared as
assumed size arrays, and don't emit a bogus error message
about implied shape arrays.

Fixes llvm/llvm-project#77330.
@mjklemm
Copy link
Contributor Author

mjklemm commented Jan 11, 2024

Passes this test case:

subroutine cp1(n)
    integer :: n
    real :: array(*)
    pointer (ptr, array)
    integer :: irray(*)
    pointer (itr, irray)
    double precision :: drray(*)
    pointer (dtr, drray)
    character(20) :: crray(*)
    pointer (ctr, crray)
end subroutine

subroutine cp2(n)
    integer :: n
    real :: array(n,*)
    pointer (ptr, array)
    integer :: irray(n,*)
    pointer (itr, irray)
    double precision :: drray(n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp3(n)
    integer :: n
    real :: array(n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp4(n)
    integer :: n
    real :: array(n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp5(n)
    integer :: n
    real :: array(n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp6(n)
    integer :: n
    real :: array(n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp7(n)
    integer :: n
    real :: array(n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp8(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp9(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp10(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp11(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp12(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp13(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp14(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

subroutine cp15(n)
    integer :: n
    real :: array(n,n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ptr, array)
    integer :: irray(n,n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (itr, irray)
    double precision :: drray(n,n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (dtr, drray)
    character(20) :: crray(n,n,n,n,n,n,n,n,n,n,n,n,n,n,*)
    pointer (ctr, crray)
end subroutine

@dpalermo dpalermo self-requested a review January 11, 2024 21:10
@dpalermo dpalermo merged commit 1657ee7 into ROCm-Developer-Tools:amd-trunk-dev Jan 11, 2024
3 checks passed
@mjklemm mjklemm deleted the bug77330-cray-ptrs-assumeds-size-2 branch January 11, 2024 21:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants