]> git.ipfire.org Git - thirdparty/gcc.git/commit - libgomp/env.c
libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]
authorHongyu Wang <hongyu.wang@intel.com>
Wed, 8 Mar 2023 03:29:46 +0000 (11:29 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Thu, 9 Mar 2023 01:01:13 +0000 (09:01 +0800)
commit288bc7b5d17511d1791899e4b2e3bf3489eb06dd
tree11c219f312548cc73e7e2f212d573eb6bded0daf
parent6a87fdd3ed6ef3511466f9cf41271726b643520b
libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

When OMP_WAIT_POLICY is not specified, current implementation will cause
icv flag GOMP_ICV_WAIT_POLICY unset, so global variable wait_policy
will remain its uninitialized value. Initialize it to -1 to make
GOMP_SPINCOUNT behavior consistent with its description.

libgomp/ChangeLog:

PR libgomp/109062
* env.c (wait_policy): Initialize to -1.
(initialize_icvs): Initialize icvs->wait_policy to -1.
* testsuite/libgomp.c-c++-common/pr109062.c: New test.
libgomp/env.c
libgomp/testsuite/libgomp.c-c++-common/pr109062.c [new file with mode: 0644]