Handle alignment in __atomic_is_lock_free
authorJonathan Wakely <redi@gcc.gnu.org>
Thu, 17 Sep 2015 15:46:04 +0000 (16:46 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 17 Sep 2015 15:46:04 +0000 (16:46 +0100)
commit310055e7b481eb86318dc75dcf67f4091e395757
tree1f0c51ea5f77e0d267433e5aeeec1b8ac770b3b8
parent308fbc42903ba2f97c29eea52928802686a917f1
Handle alignment in __atomic_is_lock_free

gcc:

2015-09-17  Richard Henderson  <rth@redhat.com>

PR libstdc++/65913
* builtins.c (fold_builtin_atomic_always_lock_free): Handle fake
pointers that encode the alignment of the object.

libstdc++-v3:

2015-09-17  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/65913
* include/bits/atomic_base.h (__atomic_base<_TTp>::is_lock_free(),
__atomic_base<_PTp*>::is_lock_free()): Call the built-in with the
immediate pointer value, not a variable.
* include/std/atomic (atomic<T>::is_lock_free()): Likewise.
* testsuite/29_atomics/atomic/65913.cc: New.

From-SVN: r227878
gcc/ChangeLog
gcc/builtins.c
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/atomic_base.h
libstdc++-v3/include/std/atomic
libstdc++-v3/testsuite/29_atomics/atomic/65913.cc [new file with mode: 0644]