Bug 29629 - ICE on OpenMP-enabled program (gfc_conv_variable, at fortran/trans-expr.c:404)
Summary: ICE on OpenMP-enabled program (gfc_conv_variable, at fortran/trans-expr.c:404)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, openmp, patch
Depends on:
Blocks:
 
Reported: 2006-10-28 21:07 UTC by Daniel Franke
Modified: 2007-01-10 19:23 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-10-29 07:12:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2006-10-28 21:07:02 UTC
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
Comment 1 Andrew Pinski 2006-10-29 06:50:04 UTC
Confirmed.
Comment 2 Jakub Jelinek 2006-10-29 10:27:51 UTC
Subject: Bug 29629

Author: jakub
Date: Sun Oct 29 10:27:39 2006
New Revision: 118134

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118134
Log:
	PR fortran/29629
	* trans-openmp.c (gfc_trans_omp_array_reduction): Set attr.flavor
	of init_val_sym and outer_sym to FL_VARIABLE.

	* testsuite/libgomp.fortran/pr29629.f90: New test.

Added:
    trunk/libgomp/testsuite/libgomp.fortran/pr29629.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-openmp.c
    trunk/libgomp/ChangeLog

Comment 3 Jakub Jelinek 2006-10-29 11:21:02 UTC
Subject: Bug 29629

Author: jakub
Date: Sun Oct 29 11:20:53 2006
New Revision: 118139

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118139
Log:
	PR fortran/29629
	* trans-openmp.c (gfc_trans_omp_array_reduction): Set attr.flavor
	of init_val_sym and outer_sym to FL_VARIABLE.

	* testsuite/libgomp.fortran/pr29629.f90: New test.

Added:
    branches/gcc-4_2-branch/libgomp/testsuite/libgomp.fortran/pr29629.f90
Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/trans-openmp.c
    branches/gcc-4_2-branch/libgomp/ChangeLog

Comment 4 Jakub Jelinek 2006-10-29 11:38:45 UTC
Fixed on the trunk, gcc-4_2-branch and redhat/gcc-4_1-branch.
Comment 5 Daniel Franke 2006-10-29 11:52:40 UTC
Great. Jakub, thank you very much!