Skip to content

Spurious errors emitted for global-scope asm with ThinLTO #61991

Open
@Amanieu

Description

@Amanieu

test.c

asm("fld f0, 0(sp)");

Output

$ clang test.c -c -target riscv64-unknown-linux-gnu -flto=thin
error: instruction requires the following: 'D' (Double-Precision Floating-Point)
fld f0, 0(sp)
^
error: instruction requires the following: 'D' (Double-Precision Floating-Point)
fld f0, 0(sp)
^

The D feature is enabled by default on riscv64-unknown-linux-gnu, so this error should normally not be emitted.

However compilation still completes successfully (exit code 0) and produces valid LLVM bitcode in test.o.

Similar bug in rustc: rust-lang/rust#80608

Metadata

Metadata

Assignees

No one assigned

    Labels

    LTOLink time optimization (regular/full LTO or ThinLTO)backend:RISC-V

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions