https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91496

            Bug ID: 91496
           Summary: !GCC$ directives error if mistyped or unknown
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickpapior at gmail dot com
  Target Milestone: ---

In fortran codes I would like to use directives such as:

!GCC$ unroll <>

When trying to compile a fortran source code with the above directive it fails
with:

Error: Unclassifiable GCC directive at (1)

A small test code:

program test

  integer :: i
  real :: a(3)

!GCC$ unroll 3
  do i = 1, 3
    a(i) = 2.
  end do

  print *, sum(a)
end program


Tested versions:
Failed: 4.7.2
Failed: 4.8.3
Failed: 4.8.4
Failed: 4.8.5
Failed: 4.9.1
Failed: 4.9.2
Failed: 5.1.0
Failed: 5.2.0
Failed: 5.3.0
Failed: 5.4.0
Failed: 6.1.0
Failed: 6.2.0
Failed: 6.3.0
Failed: 6.4.0
Failed: 6.5.0
Failed: 7.1.0
Failed: 7.2.0
Failed: 7.3.0
Failed: 7.4.0
Success: 8.1.0
Success: 8.2.0
Success: 8.3.0


I would recommend that using non-existing or mis-typed directives should
*never* issues errors, but rather warnings.

The reasoning is that if new directives are added the source would need
pre-processor statements to determine the used gfortran version in order to
decide on the acceptance of each directive. This becomes cumbersome and
unnecessary.

Reply via email to