Compiling the following invalid OpenMP program with -Wall results in no warning message at -O0 and a poorly-formed warning message at -O1 or higher. No warning is printed at any optimization level if compiled without -Wall.
The program violates the constraint on allocatable arrays in private clauses given near the end of section 2.8.3.3 of the OpenMP API manual v2.5: allocatable arrays in private clauses must be unallocated on entry and exit to the parallel region. The Fortran frontend should detect this violation and issue a fully-formed warning (or error) regardless of optimization level. [EMAIL PROTECTED] $ cat test.f program test integer :: i integer, allocatable :: array(:) allocate(array(200)) !$omp parallel do private(i,array) do i = 1, 100 array(i) = i end do end program [EMAIL PROTECTED] $ gfortran -Wall -O0 -fopenmp test.f -o test [EMAIL PROTECTED] $ gfortran -Wall -O1 -fopenmp test.f -o test 'array.dim[0].stridetest.f: In function 'MAIN__.omp_fn.0': test.f:5: warning: ' is used uninitialized in this function 'array.offsettest.f:5: warning: ' is used uninitialized in this function [EMAIL PROTECTED] $ gfortran -O1 -fopenmp test.f -o test [EMAIL PROTECTED] $ gfortran -v Using built-in specs. Target: powerpc-apple-darwin8.8.0 Configured with: ../gcc-4.3-20061223/configure --enable-languages=fortran Thread model: posix gcc version 4.3.0 20061223 (experimental) -- Summary: Incomplete warning on non-conforming code with -fopenmp Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: spam dot brian dot taylor at gmail dot com GCC host triplet: powerpc-apple-darwin8.8.0 GCC target triplet: powerpc-apple-darwin8.8.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30676