Hello! Attached fairly mechanical patch adds missing memory model argument masks when comparing comparing with various MEMMODEL_* types. Please note that we can modify the memory model with target flags, IX86_HLE_* in case of x86. Also, please note that this patch doesn't touch tsan.c. 2013-01-15 Uros Bizjak * emit-rtl.c (need_atomic_barrier_p): Mask memory model argument with MEMMODEL_MASK before comparing with MEMMODEL_* memory types. * optabs.c (maybe_emit_sync_lock_test_and_set): Ditto. (expand_mem_thread_fence): Ditto. (expand_mem_signal_fence): Ditto. (expand_atomic_load): Ditto. (expand_atomic_store): Ditto. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. OK for mainline? Uros.