When -fopenmp is enabled, SAVE attribute causes an ICE when the entity is referenced in a FIRSTPRIVATE or LASTPRIVATE clause, e.g.: PROGRAM p IMPLICIT NONE ! This can be SAVE :: K and gfortran will ICE too SAVE INTEGER :: K, I K = 3 ! These two can be replaced with ! !$OMP PARALLEL DO LASTPRIVATE(K) and will ICE too !$OMP PARALLEL !$OMP DO LASTPRIVATE(K) DO I = 1, 100 K = I END DO !$OMP END DO !$OMP END PARALLEL PRINT *, K END PROGRAM p
Sorry, I got wrong when working with my test files. With !$OMP PARALLEL DO LASTPRIVATE(K) it does not ICE.
Created attachment 10388 [details] Small testcase that ICEs
This is not Fortran specific, int main (void) { static int i; static int k; k = 3; #pragma omp parallel #pragma omp for private(i) lastprivate(k) for (i = 1; i <= 100; i = i + 1) k = i; __builtin_printf ("%d\n", k); return 0; } ICEs the same. I can't reproduce this in the Fedora Core gcc though, so I think this got fixed by http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01192.html Dunno about its status, Diego, was it subsummed by your http://gcc.gnu.org/ml/gcc-patches/2006-01/msg00668.html patch?
Subject: Re: [GOMP] ICE with SAVE attribute and (FIRST|LAST)PRIVATE On Monday 16 January 2006 12:40, jakub at gcc dot gnu dot org wrote: > ICEs the same. I can't reproduce this in the Fedora Core gcc though, > so I think this got fixed by > http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01192.html > Dunno about its status, Diego, was it subsummed by your > http://gcc.gnu.org/ml/gcc-patches/2006-01/msg00668.html > patch? > No, it's unrelated. I've committed Aldy's patch.
Fixed with http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01192.html
Subject: Bug 25219 Author: jakub Date: Tue Jan 17 10:56:29 2006 New Revision: 109816 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109816 Log: PR fortran/25219 * testsuite/libgomp.fortran/pr25219.f90: New test. Added: branches/gomp-20050608-branch/libgomp/testsuite/libgomp.fortran/pr25219.f90 Modified: branches/gomp-20050608-branch/libgomp/ChangeLog