Index: runtime/src/kmp_lock.cpp =================================================================== --- runtime/src/kmp_lock.cpp +++ runtime/src/kmp_lock.cpp @@ -2520,7 +2520,7 @@ KMP_FSYNC_PREPARE(lck); KMP_INIT_YIELD(spins); - while (TCR_8(polls[ticket & mask]).poll < ticket) { // volatile load + while (TCR_8(polls[ticket & mask].poll) < ticket) { // volatile load // If we are oversubscribed, // or have waited a bit (and KMP_LIBRARY=turnaround), then yield. // CPU Pause is in the macros for yield. Index: runtime/src/kmp_os.h =================================================================== --- runtime/src/kmp_os.h +++ runtime/src/kmp_os.h @@ -596,8 +596,12 @@ #define TCR_4(a) (a) #define TCW_4(a,b) (a) = (b) +#define TCI_4(a) (++(a)) +#define TCD_4(a) (--(a)) #define TCR_8(a) (a) #define TCW_8(a,b) (a) = (b) +#define TCI_8(a) (++(a)) +#define TCD_8(a) (--(a)) #define TCR_SYNC_4(a) (a) #define TCW_SYNC_4(a,b) (a) = (b) #define TCX_SYNC_4(a,b,c) KMP_COMPARE_AND_STORE_REL32((volatile kmp_int32 *)(volatile void *)&(a), (kmp_int32)(b), (kmp_int32)(c)) Index: runtime/src/kmp_tasking.c =================================================================== --- runtime/src/kmp_tasking.c +++ runtime/src/kmp_tasking.c @@ -2843,7 +2843,7 @@ KMP_TEST_THEN_DEC32( (kmp_int32 *)(& taskdata->td_taskgroup->count) ); // Create an imaginary children for this task so the bottom half cannot release the task before we have completed the second top half - TCR_4(taskdata->td_incomplete_child_tasks++); + TCI_4(taskdata->td_incomplete_child_tasks); } static void __kmp_second_top_half_finish_proxy( kmp_taskdata_t * taskdata ) @@ -2855,7 +2855,7 @@ KMP_DEBUG_ASSERT( children >= 0 ); // Remove the imaginary children - TCR_4(taskdata->td_incomplete_child_tasks--); + TCD_4(taskdata->td_incomplete_child_tasks); } static void __kmp_bottom_half_finish_proxy( kmp_int32 gtid, kmp_task_t * ptask )