]> 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>
Thu, 5 Jun 2025 15:02:27 +0000 (15:02 +0000)
commitf2a61a287dbe1dea763b54868b4068ea112cb7d9
treee6c8ca8fbd0bac7384b3ddd628528fd1d0da0b53
parent98f8571728647a8f650c85f7b5d3d31666ef902a
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.

(cherry picked from commit 9788a1e24822226b55dd1ab521e34bfaf9f4974d)
gcc/omp-general.cc