Fix atomic_xchg* intrinsics

This commit is contained in:
bjorn3 2019-02-16 16:24:03 +01:00
parent 26289edf1a
commit de94b62ba4
2 changed files with 4 additions and 1 deletions

View File

@ -12,4 +12,7 @@ fn main() {
let _ = std::process::Command::new("true").env("c", "d").spawn();
println!("cargo:rustc-link-lib=z");
static ONCE: std::sync::Once = std::sync::ONCE_INIT;
ONCE.call_once(|| {});
}

View File

@ -386,7 +386,7 @@ pub fn codegen_intrinsic_call<'a, 'tcx: 'a>(
// Compare
let is_eq = fx.bcx.ins().icmp(IntCC::Equal, old, test_old);
let new = crate::common::codegen_select(&mut fx.bcx, is_eq, old, new); // Keep old if not equal to test_old
let new = crate::common::codegen_select(&mut fx.bcx, is_eq, new, old); // Keep old if not equal to test_old
// Write new
fx.bcx.ins().store(MemFlags::new(), new, ptr, 0);