https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77636
Bug ID: 77636 Summary: OpenMP SIMD rejects an array in ALIGNED clause list Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: venovako at venovako dot eu Target Milestone: --- Created attachment 39641 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39641&action=edit The source file to reproduce the problem. I use GNU Fortran (GCC) 7.0.0 20160918 (experimental), bootstrapped from SVN rev. 240220, but the problem appears with some earlier builds, also. I've observed the following on x86_64 (Darwin), and power8le (Linux). The command line that fails to build an executable: gfortran -fopenmp simderr.f90 The output: simderr.f90:24:23: !$OMP SIMD ALIGNED(A:16) 1 Error: ‘a’ in ALIGNED clause must be POINTER, ALLOCATABLE, Cray pointer or C_PTR at (1) simderr.f90:12:21: !$OMP SIMD ALIGNED(A:16) 1 Error: ‘a’ in ALIGNED clause must be POINTER, ALLOCATABLE, Cray pointer or C_PTR at (1) So, when an array variable or a dummy argument (here, 'A') is referenced in ALIGNED clause of a SIMD directive, it is rejected with an explanation quoted above. If you refer to OpenMP standard, version 4.5 (November 2015), page 76, lines 3 to 8, the only constraints mentioned are in the conditional form (IF a list item ... has the ALLOCATABLE/POINTER attribute... THEN something must hold). I fail to see any statement that precludes having an "ordinary" array referenced in the list. Besides being a reasonable and the most simple use case conceivable of the ALIGNED clause, the same program as attached here is compiled correctly and without any errors/warnings with, e.g., Intel Fortran 17.0.0.102 Build 20160720 on Darwin; `ifort -qopenmp simderr.f90` would do. The restrictions that the error output mentions echo those in the same OpenMP standard, page 80, lines 19 to 20, pertaining to DECLARE SIMD (but not to SIMD) directive. Do I get it right that such restrictions should not apply in this case, and the code should be accepted as valid and compiled?