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

            Bug ID: 109413
           Summary: [OpenMP] ICE for 'OMP ERROR at(compilation)' when
                    using a named constant/parameter
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, openmp
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

The following gives an ICE in gfc_enforce_clean_symbol_state.

character(*), parameter :: pt = "hkgj"
!$omp error at(compilation) message(pt)
end


The current wording implies that this is valid.

TODO: Check what C/C++ do for non-literals.

Note: OpenMP Spec Issue 3558 might change what is permitted.

* * *

Possibly, the printing needs to me moved from directly after parsing to later:

It sounds as if code placed in non-executable context (→ declaration part),
metadirectives needs to be honored – which may imply a delayed printing after
evaluating the static context selector?

For executable context, the 'at' clause has the following, but not when used in
declarative/non-executable context:

"If _action-time_ is **compilation** and the directive appears in an executable
context that is not reachable at runtime, the action may or may not be
performed."

Reply via email to