Skip to content
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

flang openmp issue with use, only #53372

Closed
dsGoose opened this issue Jan 23, 2022 · 4 comments
Closed

flang openmp issue with use, only #53372

dsGoose opened this issue Jan 23, 2022 · 4 comments
Labels
flang:frontend invalid Resolved as invalid, i.e. not a bug openmp

Comments

@dsGoose
Copy link

dsGoose commented Jan 23, 2022

Hi,

A variable labeled threadprivate in a fortran module loose his state after a use instruction follow by : only, in user module. A simple test case attached to this email

This test case do not compile with flang and openmp(fland -fopenmp -…… -march=…. Main.f90)
F90-S-0155-tab is not THREADPRIVATE (main.f90: 7)
If we remove : only in mod1_m then the issue disappear.

below a test case to reproduce the issue (to be compile with fopenmp flags)

module mod_m
        implicit none
        integer, pointer, dimension(:) :: tab=>null()
!$omp threadprivate(tab)
        integer, parameter :: info=4
        integer:: autre=6

        contains

        subroutine create(n)
                implicit none
                integer, intent(in) ::n
                integer::i
                allocate (tab(n))
                do i=1,n
                   tab(i)=i
                end do
                print*,"alloue"
        end subroutine create
end module mod_m

module mod1_m
  use mod_m, only : tab, create

  implicit none

end module mod1_m



program main
        use mod1_m
        implicit none


        call create(4)
!$omp parallel default(private) copyin(tab)
        if (associated(tab)) then
 		print*,"associe"
        else
           	print*,"pas associe"
        endif
!$omp end parallel

end program main
@EugeneZelenko EugeneZelenko changed the title flan openmp issue with use, only flang openmp issue with use, only Jan 23, 2022
@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2022

@llvm/issue-subscribers-flang-frontend

@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2022

@llvm/issue-subscribers-openmp

@kiranchandramohan
Copy link
Contributor

From the error message, it looks like it is a Classic Flang issue. Can you file it in the repository of the Classic Flang project (https://github.com/flang-compiler/flang)?

@kiranchandramohan
Copy link
Contributor

Closing this issue since it refers to a Classic Flang issue. Ticket opened in Classic Flang repo by the author (flang-compiler/flang#1213).

@EugeneZelenko EugeneZelenko added the invalid Resolved as invalid, i.e. not a bug label Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:frontend invalid Resolved as invalid, i.e. not a bug openmp
Projects
None yet
Development

No branches or pull requests

4 participants