This is the mail archive of the
mailing list for the GCC project.
Re: Patch for PR libgomp/37938, IA64 specific.
On Fri, Nov 7, 2008 at 10:35 AM, Steve Ellcey <email@example.com> wrote:
> On Thu, 2008-11-06 at 17:12 -0800, H.J. Lu wrote:
>> static inline void gomp_mutex_unlock (gomp_mutex_t *mutex)
>> int val = __sync_lock_test_and_set (mutex, 0);
>> if (__builtin_expect (val > 1, 0))
>> gomp_mutex_unlock_slow (mutex);
>> should work as long as mutex isn't updated with release or
>> unordered semantics prior to this function call. Who else
>> have updated mutux? What semantics are they using?
> Isn't the lock done with release semantics? gomp_mutex_lock
> calls __sync_bool_compare_and_swap and sync_compare_and_swap<mode> in
> sync.md generates a cmpxchg.rel instruction.
According to ia64 psABI, __sync_bool_compare_and_swap and
should have full barrier. That means they should use cmpxchg.acq,
which is icc 11.0 generates.