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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sandra Loosemore <san...@gcc.gnu.org>:

https://gcc.gnu.org/g:aca8155c09001f269a20d6df438fa0e749dd5388

commit r15-9152-gaca8155c09001f269a20d6df438fa0e749dd5388
Author: Sandra Loosemore <sloosem...@baylibre.com>
Date:   Mon Mar 31 22:02:35 2025 +0000

    OpenMP: Require target and/or targetsync init modifier [PR118965]

    As noted in PR 118965, the initial interop implementation overlooked
    the requirement in the OpenMP spec that at least one of the "target"
    and "targetsync" modifiers is required in both the interop construct
    init clause and the declare variant append_args clause.

    Adding the check was fairly straightforward, but it broke about a
    gazillion existing test cases.  In particular, things like "init (x, y)"
    which were previously accepted (and tested for being accepted) aren't
    supposed to be allowed by the spec, much less things like "init (target)"
    where target was previously interpreted as a variable name instead of a
    modifier.  Since one of the effects of the change is that at least one
    modifier is always required, I found that deleting all the code that was
    trying to detect and handle the no-modifier case allowed for better
    diagnostics.

    gcc/c/ChangeLog
            PR middle-end/118965
            * c-parser.cc (c_parser_omp_clause_init_modifiers): Adjust
            error message.
            (c_parser_omp_clause_init): Remove code for recognizing clauses
            without modifiers.  Diagnose missing target/targetsync modifier.
            (c_finish_omp_declare_variant): Diagnose missing target/targetsync
            modifier.

    gcc/cp/ChangeLog
            PR middle-end/118965
            * parser.cc (c_parser_omp_clause_init_modifiers): Adjust
            error message.
            (cp_parser_omp_clause_init): Remove code for recognizing clauses
            without modifiers.  Diagnose missing target/targetsync modifier.
            (cp_finish_omp_declare_variant): Diagnose missing target/targetsync
            modifier.

    gcc/fortran/ChangeLog
            PR middle-end/118965
            * openmp.cc (gfc_parser_omp_clause_init_modifiers): Fix some
            inconsistent code indentation.  Remove code for recognizing
            clauses without modifiers.  Diagnose prefer_type without a
            following paren.  Adjust error message for an unrecognized
modifier.
            Diagnose missing target/targetsync modifier.
            (gfc_match_omp_init): Fix more inconsistent code indentation.

    gcc/testsuite/ChangeLog
            PR middle-end/118965
            * c-c++-common/gomp/append-args-1.c: Add target/targetsync
            modifiers so tests do what they were previously supposed to do.
            Adjust expected output.
            * c-c++-common/gomp/append-args-7.c: Likewise.
            * c-c++-common/gomp/append-args-8.c: Likewise.
            * c-c++-common/gomp/append-args-9.c: Likewise.
            * c-c++-common/gomp/interop-1.c: Likewise.
            * c-c++-common/gomp/interop-2.c: Likewise.
            * c-c++-common/gomp/interop-3.c: Likewise.
            * c-c++-common/gomp/interop-4.c: Likewise.
            * c-c++-common/gomp/pr118965-1.c: New.
            * c-c++-common/gomp/pr118965-2.c: New.
            * g++.dg/gomp/append-args-1.C: Add target/targetsync modifiers
            and adjust expected output.
            * g++.dg/gomp/append-args-2.C: Likewise.
            * g++.dg/gomp/append-args-6.C: Likewise.
            * g++.dg/gomp/append-args-7.C: Likewise.
            * g++.dg/gomp/append-args-8.C: Likewise.
            * g++.dg/gomp/interop-5.C: Likewise.
            * gfortran.dg/gomp/append_args-1.f90: Add target/targetsync
            modifiers and adjust expected output.
            * gfortran.dg/gomp/append_args-2.f90: Likewise.
            * gfortran.dg/gomp/append_args-3.f90: Likewise.
            * gfortran.dg/gomp/append_args-4.f90: Likewise.
            * gfortran.dg/gomp/interop-1.f90: Likewise.
            * gfortran.dg/gomp/interop-2.f90: Likewise.
            * gfortran.dg/gomp/interop-3.f90: Likewise.
            * gfortran.dg/gomp/interop-4.f90: Likewise.
            * gfortran.dg/gomp/pr118965-1.f90: New.
            * gfortran.dg/gomp/pr118965-2.f90: New.

Reply via email to