Open
Description
As discovered there compiler_fence
produces atomic_fence(ordering, SingleThread)
construction, which in turn can produce a non-empty code sequence. In fact, LLVM backends for AVR, PowerPC, RISC-V and Spark do not treat SingleThread fence as something special. At the same time Rust docs tell that "compiler_fence does not emit any machine code".
Seems like Rust misuses this "SingleThread means CompilerBarrier" semantics, but I could be wrong.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Atomics, barriers, and sync primitivesArea: Code generationArea: Documentation for any part of the project, including the compiler, standard library, and toolsCategory: This is a bug.Issue: Problems and improvements with respect to binary size of generated code.Target: RISC-V architectureRelevant to the compiler team, which will review and decide on the PR/issue.