[patch, fortran/OpenMP] Allow more than one space after "!$omp" sentinel

Tobias Burnus burnus@net-b.de
Thu Feb 15 10:44:00 GMT 2007


:ADDPATCH fortran:

Currently, gfortran gives an "Unclassifiable OpenMP directive" error
when there is more than one space after the "!$omp" directive. (cf.
http://gcc.gnu.org/ml/fortran/2007-02/msg00305.html).

Unless I misread the standard, multiple spaces are allowed, having one
is mandatory.

The following patch by Bernard Fischer fixes this, by gobbling all extra
spaces.

The patch was regression tested (make check-gfortran, make check in
libgomp) on
x86_64-unknown-linux-gnu.

------------
The OpenMP 2.5 standard states for Fortran free-form source:

http://www.openmp.org/drupal/mp-documents/spec25.pdf
(Words in [ ] brackets are added by me.)

"2.1.2 Free Source Form Directives"
[...]
"The sentinel ["!$omp"] can appear in any column as long as it is
preceded only by white space (spaces and tab characters). It must appear
as a single word with no intervening character. Fortran free form line
length, white space, and continuation rules apply to the directive line.
[>] Initial directive lines must have a space after the sentinel. [<]
Continued directive lines must have an ampersand as the last nonblank
character on the line, prior to any comment placed inside the directive.
Continuation directive lines can have an ampersand after the directive
sentinel with optional white space before and after the
ampersand."
------------


Tobias

PS: I ignore the two regression test errors, which seem to be races:
FAIL: gfortran.dg/secnds-1.f  -Os  execution test
FAIL: gfortran.dg/secnds.f  -O3 -fomit-frame-pointer  execution test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp.diff
Type: text/x-patch
Size: 1453 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070215/f5b75fe6/attachment.bin>


More information about the Fortran mailing list