This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/62131] New: Openmp Regression 4.9.1 : Subobject of an allocatable array not allowed in OMP ATOMIC
- From: "vladimir.fuka at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Aug 2014 08:18:04 +0000
- Subject: [Bug fortran/62131] New: Openmp Regression 4.9.1 : Subobject of an allocatable array not allowed in OMP ATOMIC
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62131
Bug ID: 62131
Summary: Openmp Regression 4.9.1 : Subobject of an allocatable
array not allowed in OMP ATOMIC
Product: gcc
Version: 4.9.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: vladimir.fuka at gmail dot com
layzrc raised this problem on comp.lang.fortran
https://groups.google.com/forum/#!topic/comp.lang.fortran/lVzeHW_X1aw
module storage
integer,allocatable :: nerrs(:,:)
end module
program atomic
use storage
allocate(nerrs(10,10))
!$omp parallel do
do k=1,10
call uperrs(k,1)
enddo
!$omp end parallel do
stop
contains
subroutine uperrs(i,io)
integer,intent(in) :: i,io
!$omp atomic
nerrs(i,io)=nerrs(i,io)+1
end subroutine
end
>gfortran -fopenmp atomic.f90
atomic.f90:18.29:
nerrs(i,io)=nerrs(i,io)+1
1
Error: !$OMP ATOMIC with ALLOCATABLE variable at (1)
I believe this is a wrong and causes a bad regression, because `nerrs(i,io)`
is not an allocatable variable. I believe the section 2.12.6 of OpenMP 4
concerns situations when the whole variable being updated or assigned is
allocatable (e.g. allocatable scalars) and it causes possible re-allocation.