https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120518
--- Comment #3 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:9788a1e24822226b55dd1ab521e34bfaf9f4974d commit r16-1119-g9788a1e24822226b55dd1ab521e34bfaf9f4974d Author: Sandra Loosemore <sloosem...@baylibre.com> Date: Wed Jun 4 04:03:03 2025 +0000 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.