------- Comment #2 from burnus at gcc dot gnu dot org 2007-06-25 20:13 ------- Besides with gfortran, it is also rejected by three further compilers. It still might be an oversight, but one has to check the OpenMP 2.5 standard; by compiler voting gfortran wins ;-)
Intel's ifort rejects it with: fortcom: Error: a.f90, line 6: Variables that appear on the FIRSTPRIVATE, LASTPRIVATE, and REDUCTION clauses on a work-sharing directive must have shared scope in the enclosing region [PEAK] Open64's openf95 with: "a.f90", line 1: Error: Reduction variable PEAK not SHARED in enclosing parallel region and Sun's sunf95 with: ERROR: Variable "PEAK" appears in REDUCTION clause. Therefore, it must be SHARED in the enclosing context. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32502