public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27395] New: Problem with arrays in the OpenMP REDUCTION clause in Fortran
@ 2006-05-02 19:10 benjamin dot reveille at gmail dot com
2006-05-02 19:30 ` [Bug fortran/27395] " kargl at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: benjamin dot reveille at gmail dot com @ 2006-05-02 19:10 UTC (permalink / raw)
To: gcc-bugs
Below are 2 programs which test the REDUCTION clause for arrays in OpenMP.
gfortran ICE's when trying to compile them.
gfortran information:
Using built-in specs.
Target: i386-linux
Configured with: ../gcc/configure
--prefix=/cosmic/coudert/tmp/gfortran-20060502/irun
--enable-languages=c,fortran --host=i386-linux
--with-gmp=/cosmic/coudert/tmp/gfortran-20060502/gfortran_libs
Thread model: posix
gcc version 4.2.0 20060502 (experimental)
Extra info:
1) xlf 10.1 and pgi 6.1 compile array_reduction1.f90 and execute it correclty
intel 8.1 compiles array_reduction1.f90 but aborts on execution
2) xlf 10.1, pgi 6.1 and intel 8.1 compile array_reduction1.f90 and execute
it correclty
The openMP 2.5 Specifications (p83 of
http://www.openmp.org/drupal/mp-documents/spec25.pdf) "2.8.3. Restrictions to
the reduction clause": says : Fortran pointers, Cray pointers, assumed-size
arrays and allocatable arrays may not appear in a reduction clause.
In both programs it seems that the arrays are acceptable candidates for
reduction.
See http://gcc.gnu.org/ml/fortran/2006-05/msg00022.html for discussion about
this bug report.
array_reduction1.f90
----------------------------------
program array_reduction1
implicit none
integer, parameter :: n=10,m=1000
integer :: i
integer, dimension(n) :: sumarray
!
call foo1(n,m,sumarray)
do i=1,n
print*,sumarray(i)
end do
end program array_reduction1
subroutine foo1(n,m,sumarray)
use omp_lib, only : omp_get_thread_num
implicit none
integer, intent(in) :: n,m
integer, dimension(n), intent(out) :: sumarray
!
integer :: i,j
!
sumarray(:)=0
!$OMP PARALLEL DEFAULT(shared)
print*,'hello from thread ',omp_get_thread_num()
!$OMP DO PRIVATE(j,i), REDUCTION(+:sumarray)
do j=1,m
do i=1,n
sumarray(i)=sumarray(i)+i
end do
end do
!$OMP END DO
!$OMP END PARALLEL
end subroutine foo1
----------------------------------
>> gfortran -fopenmp array_reduction1.f90
array_reduction1.f90: In function 'foo1':
array_reduction1.f90:13: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
array_reduction2.f90
----------------------------------
program array_reduction2
implicit none
integer, parameter :: n=10,m=1000
integer :: i
!
call foo2(n,m)
end program array_reduction2
subroutine foo2(n,m)
use omp_lib, only : omp_get_thread_num
implicit none
integer, intent(in) :: n,m
!
integer :: i,j
integer, dimension(n) :: sumarray
!
sumarray(:)=0
!$OMP PARALLEL DEFAULT(shared)
print*,'hello from thread ',omp_get_thread_num()
!$OMP DO PRIVATE(j,i), REDUCTION(+:sumarray)
do j=1,m
do i=1,n
sumarray(i)=sumarray(i)+i
end do
end do
!$OMP END DO
!$OMP END PARALLEL
do i=1,n
print*,sumarray(i)
end do
end subroutine foo2
----------------------------------
>> gfortran -fopenmp array_reduction2.f90
array_reduction2.f90: In function 'foo2':
array_reduction2.f90:9: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--
Summary: Problem with arrays in the OpenMP REDUCTION clause in
Fortran
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: benjamin dot reveille at gmail dot com
GCC build triplet: i386-linux
GCC host triplet: i386-linux
GCC target triplet: i386-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27395
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-03 13:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02 19:10 [Bug fortran/27395] New: Problem with arrays in the OpenMP REDUCTION clause in Fortran benjamin dot reveille at gmail dot com
2006-05-02 19:30 ` [Bug fortran/27395] " kargl at gcc dot gnu dot org
2006-05-02 19:37 ` jakub at gcc dot gnu dot org
2006-05-03 12:51 ` jakub at gcc dot gnu dot org
2006-05-03 13:07 ` jakub at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).