]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP: Fix regressions in metadirective-target-device-2.c [PR120518]
authorSandra Loosemore <sloosemore@baylibre.com>
Wed, 4 Jun 2025 04:03:03 +0000 (04:03 +0000)
committerSandra Loosemore <sloosemore@baylibre.com>
Wed, 4 Jun 2025 20:31:16 +0000 (20:31 +0000)
commit9788a1e24822226b55dd1ab521e34bfaf9f4974d
tree68a19021fb3178fb8bf4da67b8363f97472507c3
parentd045eb13b0b42870a1f081895df3901112a358f0
OpenMP: Fix regressions in metadirective-target-device-2.c [PR120518]

My previous patch that added a CLEANUP_POINT_EXPR around the device_num
selector expression in the C++ front end broke the testcase
c-c++-common/gomp/metadirective-target-device-2.c on offload targets.
It confused the code in omp_device_num_check that tries to bypass error
checking and do early resolution when the expression is a call to one
of the OpenMP library functions.  The solution is to make that code smart
enough to look inside a CLEANUP_POINT_EXPR.

gcc/ChangeLog
PR c++/120518
* omp-general.cc (omp_device_num_check): Look inside a
CLEANUP_POINT_EXPR when trying to optimize special cases.
gcc/omp-general.cc