]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP: Integrate dynamic selectors with dispatch argument handling [PR118457]
authorSandra Loosemore <sloosemore@baylibre.com>
Sun, 9 Mar 2025 01:50:19 +0000 (01:50 +0000)
committerSandra Loosemore <sloosemore@baylibre.com>
Sun, 9 Mar 2025 01:52:52 +0000 (01:52 +0000)
commit44b1d52e2f4db57849ca54b63c52a687294b1793
treea6c60dcbe5f21a3c53e8c4966e4724b6a0cb86e9
parente270b8997854d56e8e8536fd1126de7541e3d826
OpenMP: Integrate dynamic selectors with dispatch argument handling [PR118457]

Support for dynamic selectors in "declare variant" was developed in
parallel with support for the adjust_args/append_args clauses and the
dispatch construct; they collided in a bad way.  This patch fixes the
"sorry" for calls that need both by removing the adjust_args/append_args
code from gimplify_call_expr and invoking it from the new variant
substitution code instead.  It's handled as a tree -> tree transformation
rather than tree -> gimple because eventually this code may end up being
invoked from the front ends instead of the gimplifier (see PR115076).

gcc/ChangeLog
PR middle-end/118457
* gimplify.cc (modify_call_for_omp_dispatch): New, containing
code split from gimplify_call_expr and modified to emit tree
instead of gimple.  Remove the error for falling through to a call
to the base function.
(expand_variant_call_expr): New, split from gimplify_variant_call_expr.
Call modify_call_for_omp_dispatch on calls to
variants in a dispatch construct context.
(gimplify_variant_call_expr): Make it call expand_variant_call_expr
to do the actual work.
(gimplify_call_expr): Remove sorry for calls involving both
dynamic/late selectors and adjust_args/append_args, and adjust
for new interface.  Move adjust_args/append_args code to
modify_call_for_omp_dispatch.
(gimplify_omp_dispatch): Add some comments.

gcc/testsuite/ChangeLog
PR middle-end/118457
* c-c++-common/gomp/adjust-args-6.c: Remove xfails and adjust
expected output.
* c-c++-common/gomp/append-args-5.c: Adjust expected output.
* c-c++-common/gomp/append-args-dynamic.c: New.
* c-c++-common/gomp/dispatch-11.c: Adjust expected output.
* gfortran.dg/gomp/dispatch-11.f90: Likewise.
gcc/gimplify.cc
gcc/testsuite/c-c++-common/gomp/adjust-args-6.c
gcc/testsuite/c-c++-common/gomp/append-args-5.c
gcc/testsuite/c-c++-common/gomp/append-args-dynamic.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/dispatch-11.c
gcc/testsuite/gfortran.dg/gomp/dispatch-11.f90