-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed as not planned
Closed as not planned
Copy link
Labels
flangFlang issues not falling into any other categoryFlang issues not falling into any other categoryquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
Version of flang-new : 20.0.0(2603c8b23be06116bc61bda36fae05b81d906c3f)/AArch64
When a variable with optional and pointer attributes defined is used as an argument to a subroutine, a run-time error occurs (Segmentation fault (core dumped)).
When pointer attribute is changed to allocatable attribute, the execution also fails.
When pointer and allocatable attributes are not specified, the execution succeeds.
The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.
F01_12.f90:
program main
call sub3()
print*,"Pass"
contains
subroutine sub3(ptr)
integer,optional,pointer :: ptr(:) ! Segmentation fault
! integer,optional,allocatable :: ptr(:) ! Segmentation fault
! integer,optional :: ptr(:) ! OK
call sub(ptr)
end subroutine sub3
subroutine sub(dmy)
integer,optional::dmy(:)
write(6,*) "present(dmy) = ", present(dmy)
end subroutine sub
end program main$ flang-new F01_12.f90; ./a.out
Segmentation fault (core dumped)
$
$ gfortran F01_12.f90; ./a.out
present(dmy) = F
Pass
$
$ ifort -diag-disable=10448 F01_12.f90; ./a.out
present(dmy) = F
Pass
$
Metadata
Metadata
Assignees
Labels
flangFlang issues not falling into any other categoryFlang issues not falling into any other categoryquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Type
Projects
Status
Done