-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[Flang] Incorrect execution result when a pointer variable of the same name is defined for each cray pointer in two dependent modules, and a different array address is defined for each pointer variable #135579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A Cray pointer declaration ( |
@llvm/issue-subscribers-flang-frontend Author: None (ohno-fj)
```
Version of flang : 21.0.0(9fe6f6a)/AArch64
```
In the attached program, a pointer variable of the same name is defined for each The following are the test program, Flang, Gfortran and ifx compilation/execution result. sngg752d_2.f90: module m1
implicit none
real::v1
pointer (ptr,v1) ! (1)
real::x(2)
contains
subroutine s
implicit none
x=[1,2]
ptr=loc(x) ! (2)
end subroutine s
end module m1
module m2
use m1
implicit none
private ptr
contains
subroutine ss
real::v2,y(2)
pointer (ptr,v2) ! (1)
dimension v2(2)
y=[11,12]
ptr=loc(y) ! (2) The address assigned to ptr changes from the address of x to the address of y.
write(6,*) "ss : v1 = ", v1, " v2 = ", v2
end subroutine ss
end module m2
program main
use m2
implicit none
call s
call ss
write(6,*) "main : v1 = ", v1
print *,'pass'
end program main
|
…itialization (llvm#136776) This PR: - makes Cray pointer declarations shadow previous bindings instead of modifying them, - errors when the pointee of a cray pointee has the SAVE attribute, and - adds a missing newline after dumping the list of cray pointers in a scope. Closes llvm#135579
…itialization (llvm#136776) This PR: - makes Cray pointer declarations shadow previous bindings instead of modifying them, - errors when the pointee of a cray pointee has the SAVE attribute, and - adds a missing newline after dumping the list of cray pointers in a scope. Closes llvm#135579
…itialization (llvm#136776) This PR: - makes Cray pointer declarations shadow previous bindings instead of modifying them, - errors when the pointee of a cray pointee has the SAVE attribute, and - adds a missing newline after dumping the list of cray pointers in a scope. Closes llvm#135579
…itialization (llvm#136776) This PR: - makes Cray pointer declarations shadow previous bindings instead of modifying them, - errors when the pointee of a cray pointee has the SAVE attribute, and - adds a missing newline after dumping the list of cray pointers in a scope. Closes llvm#135579
In the attached program, a pointer variable of the same name is defined for each
cray pointer
in two dependent modules (1), and a different array address is defined for each pointer variable (2).The execution result of such a program is incorrect.
The value of
v1
in the main program is expected to be 1.0.The following are the test program, Flang, Gfortran and ifx compilation/execution result.
sngg752d_2.f90:
The text was updated successfully, but these errors were encountered: