https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113904
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> --- Patch for rejecting non-const arguments in Fortran (wrong-code bit) to bring it in line with C/C++: https://gcc.gnu.org/pipermail/gcc-patches/2024-February/645488.html * * * TODO as follow up: * Permit non-constant values for 'condition' and also for 'device_num' -> Middle end changes + update all front ends accordingly * For C/C++, consider rejecting nonconforming device numbers, if known at compile time, i.e. only permit positive numbers and omp_initial_device_number (= -1) and omp_invalid_device_number (GCC: -4). Cf. OpenMP Issue 3832 for the 'conforming' bit. [Current spec wording only permits 0 ... < omp_get_num_devices(), i.e. neither the host (= omp_initial_device and == omp_get_num_devices()) or omp_invalid_device_number are not permitted as explicit value; however, if absent, it is as if the trait appeared with the default-device-var ICV, which permits the discussed values.] -> If device_num(-4) (= omp_invalid_device_number), the selector can be folded to not matching. * Possible testcases for some of the features discussed here: - https://gcc.gnu.org/pipermail/gcc-patches/2024-February/645472.html - the OpenMP 6.0 Examples' program_control/sources/dispatch.1.{c,f90}