Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1 View

Allocation status of intent(out) dummy arguments with -qopenmp flags

Hi there,

have a look at the following code

Module ModTmp
contains
  Subroutine SubA(CSIn,CVOut)
    Implicit None
    Character(len=*), Intent(In) :: CSIn
    Character(len=len(CSIn)), Intent(Out), Allocatable :: CVOut(:)
    write(*,*) allocated(CVOut)
  End Subroutine SubA
   Subroutine SubB()
     Implicit None
     Integer(kind=8) :: c1
     !$OMP PARALLEL
     !$OMP DO PRIVATE(c1)
     Do c1=1,2
     End Do
     !$OMP END DO
     !$OMP END PARALLEL
   end Subroutine SubB
end Module ModTmp
Program Test
  use ModTmp
  Character(len=20) :: CSTmp
  Character(len=20), Allocatable :: CVOut(:)
  call SubA(CSTmp,CVout)
  write(*,*) allocated(CVOut)
end Program Test

If I compile this with

ifort -mkl -warn nounused -warn declarations -static -O3 -parallel -qopenmp

the allocation status of "cvout" in SubA changes according to whether I comment or uncomment the openmp statements in SubB.

If uncommented, "allocated(CVOut)" yields "T", if commented "allocated(CVOut)" yields "F" (as expected). This does not happen if CVOut is declared with (len=*) in SubA.

I am doing anything wrong here???

Can anybody comment on this.

Thanks a lot

Karl

NB: ifort 16.0.2, linux 4.2.0-35

 

0 Kudos
1 Reply
Highlighted
1 View

I can reproduce this - it's

I can reproduce this - it's definitely a compiler bug. Escalated as issue DPD200410321. Thanks for the nice test case.

Retired 12/31/2016
0 Kudos