llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.03k stars 11.58k forks source link

[Flang][OpenMP] Compilation error of a host-associated allocatable variable in a `private` clause #81946

Closed yus3710-fj closed 4 months ago

yus3710-fj commented 7 months ago

This is an issue from Fujitsu testsuite.

A compilation error occurs when compiling a host-associated allocatable variable in a private clause.

The following are the test program and the compilation results of flang-new and gfortran.

! test.f90
integer,allocatable::vs(:)
call ss1

contains
subroutine ss1
!$omp parallel private(vs)
!$omp end parallel
end subroutine
end
$ flang-new -v test.f90 -fopenmp
flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git a6b846ae1e58e11160185e427e20a995f6656859)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /path/to/install/bin
Found candidate GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12
Selected GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/path/to/install/bin/flang-new" -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +outline-atomics -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -mframe-pointer=non-leaf -o /tmp/test-f4e165.o -x f95-cpp-input test.f90
error: loc("/path/to/test.f90":7:24): 'fir.allocmem' op invalid type for allocation
error: verification of lowering to FIR failed
$ gfortran-13.2 test.f90 -fopenmp
$
llvmbot commented 7 months ago

@llvm/issue-subscribers-openmp

Author: Yusuke MINATO (yus3710-fj)

This is an issue from Fujitsu testsuite. A compilation error occurs when compiling a host-associated allocatable variable in a `private` clause. The following are the test program and the compilation results of flang-new and gfortran. ```fortran ! test.f90 integer,allocatable::vs(:) call ss1 contains subroutine ss1 !$omp parallel private(vs) !$omp end parallel end subroutine end ``` ```console $ flang-new -v test.f90 -fopenmp flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git a6b846ae1e58e11160185e427e20a995f6656859) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /path/to/install/bin Found candidate GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12 Selected GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12 Candidate multilib: .;@m64 Selected multilib: .;@m64 "/path/to/install/bin/flang-new" -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +outline-atomics -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -mframe-pointer=non-leaf -o /tmp/test-f4e165.o -x f95-cpp-input test.f90 error: loc("/path/to/test.f90":7:24): 'fir.allocmem' op invalid type for allocation error: verification of lowering to FIR failed ``` ```console $ gfortran-13.2 test.f90 -fopenmp $ ```
llvmbot commented 7 months ago

@llvm/issue-subscribers-flang-frontend

Author: Yusuke MINATO (yus3710-fj)

This is an issue from Fujitsu testsuite. A compilation error occurs when compiling a host-associated allocatable variable in a `private` clause. The following are the test program and the compilation results of flang-new and gfortran. ```fortran ! test.f90 integer,allocatable::vs(:) call ss1 contains subroutine ss1 !$omp parallel private(vs) !$omp end parallel end subroutine end ``` ```console $ flang-new -v test.f90 -fopenmp flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git a6b846ae1e58e11160185e427e20a995f6656859) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /path/to/install/bin Found candidate GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12 Selected GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12 Candidate multilib: .;@m64 Selected multilib: .;@m64 "/path/to/install/bin/flang-new" -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +outline-atomics -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -mframe-pointer=non-leaf -o /tmp/test-f4e165.o -x f95-cpp-input test.f90 error: loc("/path/to/test.f90":7:24): 'fir.allocmem' op invalid type for allocation error: verification of lowering to FIR failed ``` ```console $ gfortran-13.2 test.f90 -fopenmp $ ```
llvmbot commented 7 months ago

@llvm/issue-subscribers-flang-ir

Author: Yusuke MINATO (yus3710-fj)

This is an issue from Fujitsu testsuite. A compilation error occurs when compiling a host-associated allocatable variable in a `private` clause. The following are the test program and the compilation results of flang-new and gfortran. ```fortran ! test.f90 integer,allocatable::vs(:) call ss1 contains subroutine ss1 !$omp parallel private(vs) !$omp end parallel end subroutine end ``` ```console $ flang-new -v test.f90 -fopenmp flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git a6b846ae1e58e11160185e427e20a995f6656859) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /path/to/install/bin Found candidate GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12 Selected GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12 Candidate multilib: .;@m64 Selected multilib: .;@m64 "/path/to/install/bin/flang-new" -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +outline-atomics -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -mframe-pointer=non-leaf -o /tmp/test-f4e165.o -x f95-cpp-input test.f90 error: loc("/path/to/test.f90":7:24): 'fir.allocmem' op invalid type for allocation error: verification of lowering to FIR failed ``` ```console $ gfortran-13.2 test.f90 -fopenmp $ ```
kiranchandramohan commented 4 months ago

Fixed by https://github.com/llvm/llvm-project/pull/90449