There must be something inherently evil with the code below as both, gfortran
and ifort, crash.

If either "func" is not array valued or not listed in the REDUCE-clause,
everything is fine.

$> cat omp.f90
PROGRAM omp
  write (*,*) func(n)
  CONTAINS
   FUNCTION func(n)
    INTEGER, INTENT(in)   :: n
    INTEGER, DIMENSION(n) :: func
    INTEGER               :: k
    func = 0
    !$OMP PARALLEL DO PRIVATE(k), REDUCTION(+:func)
    DO k = 1, n
      func = func + 1
    END DO
    !$OMP END PARALLEL DO
   END FUNCTION
END PROGRAM

$> gfortran-svn -g -Wall -fopenmp omp.f90
omp.f90: In function 'func':
omp.f90:11: internal compiler error: in gfc_conv_variable, at
fortran/trans-expr.c:404
Please submit a full bug report,
with preprocessed source if appropriate.

$> gfortran-svn -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../svn/gcc/configure
--prefix=/home/daniel/nfs/packages/i686-pc-linux-gnu/gcc-svn --disable-nls
--enable-threads=posix --enable-shared --enable-bootstrap --with-system-zlib
--program-suffix=-svn --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.3.0 20061026 (experimental)


$> ifort -g -warn all -check all -openmp omp.f90
fortcom: Severe: **Internal compiler error: segmentation violation signal
raised** Please report this error along with the circumstances in which it
occurred in a Software Problem Report.  Note: File and line given may not be
explicit cause of this error.

$> ifort -v
Version 9.0


-- 
           Summary: ICE on OpenMP-enabled program (gfc_conv_variable, at
                    fortran/trans-expr.c:404)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: franke dot daniel at gmail dot com
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29629

Reply via email to