https://gcc.gnu.org/g:cdd32ab06889da013d2cde51bf537695e8795a76
commit cdd32ab06889da013d2cde51bf537695e8795a76 Author: Tobias Burnus <tbur...@baylibre.com> Date: Thu Aug 8 14:24:59 2024 +0200 libgomp/libgomp.texi: Mention -fno-builtin-omp_is_initial_device libgomp/ChangeLog: * libgomp.texi (omp_is_initial_device): Mention -fno-builtin-omp_is_initial_device and folding by default. (cherry picked from commit 8b5a8b1f60e7d1a51429f118e0fb3d851abe6cd4) Diff: --- libgomp/ChangeLog.omp | 6 ++++++ libgomp/libgomp.texi | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 6e99c7107c89..09cc7278e191 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -3,6 +3,12 @@ Backported from trunk: 2024-08-08 Tobias Burnus <tbur...@baylibre.com> + * libgomp.texi (omp_is_initial_device): Mention + -fno-builtin-omp_is_initial_device and folding by default. + + Backported from trunk: + 2024-08-08 Tobias Burnus <tbur...@baylibre.com> + * testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C: Split scan-tree-dump into with and without target offload_target_any. * testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C: diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 5190a04f6648..5c87769273c5 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -1819,6 +1819,10 @@ This function returns @code{true} if currently running on the host device, @code{false} otherwise. Here, @code{true} and @code{false} represent their language-specific counterparts. +Note that in GCC this value is already folded to a constant in the compiler; +compile with @option{-fno-builtin-omp_is_initial_device} if a run-time function +is desired. + @item @emph{C/C++}: @multitable @columnfractions .20 .80 @item @emph{Prototype}: @tab @code{int omp_is_initial_device(void);}