libgomp.c++/task-6 occasionally aborts on power7 with symptoms that indicate "#pragma omp taskwait" is failing to wait for a child thread. On replacing the abort() with an asm illegal insn to get a core with the register state at the failure point, you see "a" or "n" has been loaded to regs with their original value. By the time the core dump is written, the memory value for "a" and "n" is correct.
Investigating possible fix
Author: amodra Date: Fri Dec 9 02:21:43 2011 New Revision: 182151 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182151 Log: PR libgomp/51376 * task.c (GOMP_taskwait): Don't access task->children outside of task_lock mutex region. (GOMP_task): Likewise. Modified: trunk/libgomp/ChangeLog trunk/libgomp/task.c
Fixed
Author: amodra Date: Tue Jan 22 11:41:53 2013 New Revision: 195370 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195370 Log: PR libgomp/51376 PR libgomp/56073 * task.c (GOMP_task): Revert 2011-12-09 change. (GOMP_taskwait): Likewise. Instead use atomic load with acquire barrier to read task->children.. (gomp_barrier_handle_tasks): ..and matching atomic store with release barrier here when setting parent->children to NULL. Modified: trunk/libgomp/ChangeLog trunk/libgomp/task.c
Author: amodra Date: Thu Jan 24 21:51:58 2013 New Revision: 195444 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195444 Log: PR libgomp/51376 PR libgomp/56073 * task.c (GOMP_task): Revert 2011-12-09 change. (GOMP_taskwait): Likewise. Instead use atomic load with acquire barrier to read task->children.. (gomp_barrier_handle_tasks): ..and matching atomic store with release barrier here when setting parent->children to NULL. Added: branches/ibm/gcc-4_7-branch/libgomp/ChangeLog.ibm Modified: branches/ibm/gcc-4_7-branch/libgomp/task.c
Author: amodra Date: Tue Feb 5 13:40:25 2013 New Revision: 195756 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195756 Log: PR libgomp/51376 PR libgomp/56073 * task.c (GOMP_task): Revert 2011-12-09 change. (GOMP_taskwait): Likewise. Instead use atomic load with acquire barrier to read task->children.. (gomp_barrier_handle_tasks): ..and matching atomic store with release barrier here when setting parent->children to NULL. Modified: branches/gcc-4_7-branch/libgomp/ChangeLog branches/gcc-4_7-branch/libgomp/task.c