Skip to content

[TSan] Invalid IR generated for atomicrmw with pointers #85226

Closed
@nikic

Description

@nikic

https://llvm.godbolt.org/z/o3nej9cKj

; RUN: opt -S -passes=tsan
define void @atomic8_xchg_monotonic_ptr(ptr %a, ptr %b) {
entry:
  atomicrmw xchg ptr %a, ptr %b monotonic
  ret void
}

This produces:

define void @atomic8_xchg_monotonic_ptr(ptr %a, ptr %b) {
entry:
  %0 = call ptr @llvm.returnaddress(i32 0)
  call void @__tsan_func_entry(ptr %0)
  %1 = zext ptr %b to i64
  %2 = call i64 @__tsan_atomic64_exchange(ptr %a, i64 %1, i32 0)
  call void @__tsan_func_exit()
  ret void
}

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions