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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <[email protected]>:

https://gcc.gnu.org/g:67b143a07bac3df9542b3a474bb2ffe6160da22c

commit r16-5692-g67b143a07bac3df9542b3a474bb2ffe6160da22c
Author: Tobias Burnus <[email protected]>
Date:   Fri Nov 28 11:44:41 2025 +0100

    OpenMP/Fortran: Reject ALLOCATE on non-local static variables with
trait:cgroup/pteam/thread [PR122892]

    OpenMP 6.0 clarified that static-storage objects may only specify the
    omp_cgroup_mem_alloc, omp_pteam_mem_alloc, or omp_thread_mem_alloc
allocator
    inside a BLOCK or procedure. Let's check for this for Fortran.

            PR c/122892

    gcc/fortran/ChangeLog:

            * openmp.cc (gfc_resolve_omp_allocate): Reject non-local
            static variables with cgroup/pteam/thread allocators.
            * parse.cc: Permit OMP ALLOCATE in BLOCK DATA.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/gomp/allocate-15.f90: Use another allocator as
            omp_{cgroup,pteam}_mem_alloc is invalid for non-local static vars.
            * gfortran.dg/gomp/allocate-7.f90: Likewise.
            * gfortran.dg/gomp/allocate-static-3.f90: New test.

Reply via email to