Miscompile for riscv64gc-unknown-none-elf
using inout()
in asm!()
#126221
Labels
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
O-riscv
Target: RISC-V architecture
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code with flags
--target riscv64gc-unknown-none-elf -C opt-level=1
. And here is the compiler explorer link.The above code compiles to the following assembly:
I expect
f1()
andf2()
compiles to the exact same assembly. However, in the assembly off1()
, theaddi ..., %pcrel_lo(...)
instruction is missing after theauipc
instruction. That would make the value ofa1
register wrong for mynop
instruction.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: