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

            Bug ID: 122439
           Summary: [16 Regression] ubsan: fortran/openmp.cc:12239:19:
                    runtime error: load of value 14, which is not a valid
                    value for type 'omp_tp_type'
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pheeck at gcc dot gnu.org
                CC: parras at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

With ubsan-instrumented trunk GCC:

configure --enable-languages=default,jit,lto,go,d --enable-host-shared
--enable-checking=release --disable-multilib
--with-build-config=bootstrap-ubsan

Running these testsuite tests

gfortran.dg/gomp/declare-variant-1.f90
gfortran.dg/gomp/declare-variant-2.f90

results in this error

fortran/openmp.cc:12239:19: runtime error: load of value 14, which is not a
valid value for type 'omp_tp_type'

Git blame seems to point to r16-4540-g80af807e52e4f4

commit 80af807e52e4f4c480454e5a54aaeb7ce44556fd
Author:     Paul-Antoine Arras <[email protected]>
AuthorDate: Thu Oct 16 17:22:08 2025 +0100
Commit:     Paul-Antoine Arras <[email protected]>
CommitDate: Tue Oct 21 16:14:57 2025 +0200

    OpenMP: Handle non-executable directives in intervening code
[PR120180,PR122306]

    OpenMP 6 permits non-executable directives in intervening code; this commit
adds
    support for a sensible subset, namely metadirectives, nothing, assume, and
    'error at(compilation)'.
    Also handle the special case where a metadirective can be resolved at parse
time
    to 'omp nothing'.
    This fixes a build issue that affects 10 out 12 SPECaccel benchmarks.

Reply via email to