Skip to content

compiler_fence may emit machine code #62256

Open
@Disasm

Description

@Disasm

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

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-atomicArea: Atomics, barriers, and sync primitivesA-codegenArea: Code generationA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.I-heavyIssue: Problems and improvements with respect to binary size of generated code.O-riscvTarget: RISC-V architectureT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions