Bug 109413 - [OpenMP] ICE for 'OMP ERROR at(compilation)' when using a named constant/parameter
Summary: [OpenMP] ICE for 'OMP ERROR at(compilation)' when using a named constant/para...
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, openmp
Depends on:
Blocks:
 
Reported: 2023-04-04 17:28 UTC by Tobias Burnus
Modified: 2023-04-04 17:28 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2023-04-04 17:28:10 UTC
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."