Re: Fix PR51298, libgomp barrier failure

2011-11-29 Thread Alan Modra
On Tue, Nov 29, 2011 at 04:15:36PM +1030, Alan Modra wrote: On Mon, Nov 28, 2011 at 05:42:15PM -0800, Richard Henderson wrote: On 11/28/2011 06:02 AM, Alan Modra wrote: - unsigned int ret = bar-generation ~3; - /* Do we need any barrier here or is __sync_add_and_fetch acting -

Re: Fix PR51298, libgomp barrier failure

2011-11-28 Thread Jakub Jelinek
On Mon, Nov 28, 2011 at 10:12:09AM +1030, Alan Modra wrote: --- libgomp/config/linux/bar.c(revision 181718) +++ libgomp/config/linux/bar.c(working copy) @@ -36,18 +36,15 @@ gomp_barrier_wait_end (gomp_barrier_t *b if (__builtin_expect ((state 1) != 0, 0)) { /*

Re: Fix PR51298, libgomp barrier failure

2011-11-28 Thread Alan Modra
On Mon, Nov 28, 2011 at 09:13:27AM +0100, Jakub Jelinek wrote: On Mon, Nov 28, 2011 at 10:12:09AM +1030, Alan Modra wrote: --- libgomp/config/linux/bar.c (revision 181718) +++ libgomp/config/linux/bar.c (working copy) @@ -36,18 +36,15 @@ gomp_barrier_wait_end (gomp_barrier_t *b

Re: Fix PR51298, libgomp barrier failure

2011-11-28 Thread Alan Modra
On Mon, Nov 28, 2011 at 08:09:01PM +1030, Alan Modra wrote: On Mon, Nov 28, 2011 at 09:13:27AM +0100, Jakub Jelinek wrote: On Mon, Nov 28, 2011 at 10:12:09AM +1030, Alan Modra wrote: --- libgomp/config/linux/bar.c(revision 181718) +++ libgomp/config/linux/bar.c(working copy) @@

Re: Fix PR51298, libgomp barrier failure

2011-11-28 Thread Richard Henderson
On 11/28/2011 06:02 AM, Alan Modra wrote: - unsigned int ret = bar-generation ~3; - /* Do we need any barrier here or is __sync_add_and_fetch acting - as the needed LoadLoad barrier already? */ - ret += __sync_add_and_fetch (bar-awaited, -1) == 0; + unsigned int ret =

Re: Fix PR51298, libgomp barrier failure

2011-11-28 Thread Alan Modra
On Mon, Nov 28, 2011 at 05:42:15PM -0800, Richard Henderson wrote: On 11/28/2011 06:02 AM, Alan Modra wrote: - unsigned int ret = bar-generation ~3; - /* Do we need any barrier here or is __sync_add_and_fetch acting - as the needed LoadLoad barrier already? */ - ret +=

Fix PR51298, libgomp barrier failure

2011-11-27 Thread Alan Modra
This patch cures the remaining libgomp failures I see on power7. I'll admit to approaching this fix with a big hammer at first, liberally using MEMMODEL_SEQ_CST barriers all over bar.h and bar.c, then gradually reducing the number of places and strictness of the barriers. This may still have a