fix libgomp miscompilation on ppc64

Richard Guenther richard.guenther@gmail.com
Wed Jan 25 11:43:00 GMT 2006


On 1/25/06, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Jan 25, 2006 at 11:01:27AM +0100, Richard Guenther wrote:
> > On 1/25/06, Richard Henderson <rth@redhat.com> wrote:
> > > As discussed elsewhere, provides another way for memory barriers
> > > to have memory barrier semantics -- that is, conflict with all
> > > other memories, even when we could prove they don't overlap.
> > >
> > > Tested on ppc64-linux.
> >
> > Am I right that without this patch the use of the atomic builtins is
> > not safe?  Or
> > does the problem only affect gomp?
>
> It affects any use of atomic builtins.  While libgomp won't be miscompiled
> on gcc-4_1-branch, as it is not present there, user code might be.
> So I think it would be desirable to put this fix on gcc-4_1-branch as well.

I agree.  We need to pull

2006-01-03  Adrian Straetling  <straetling@de.ibm.com>

        * gcc/builtins.c (get_builtin_sync_mem): New function.
        (expand_builtin_sync_operation, expand_builtin_compare_and_swap,
        expand_builtin_lock_test_and_set, expand_builtin_lock_release):
        Call get_builtin_sync_mem to generate mem rtx.

too, then.  I'll give a combined patch a quick test.

Richard.



More information about the Gcc-patches mailing list