[AVR] Invalid asm code "ldd rn, X+N" compiles and produces corrupted binary #109360
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
llvm-fixed-upstream
Issue expected to be fixed by the next major LLVM upgrade, or backported fixes
O-AVR
Target: AVR processors (ATtiny, ATmega, etc.)
AVR assembler instruction
ldd
is defined only for registersY
andZ
, but not forX
.asm!()
macro accepts it.I tried this code:
I expected to see this happen: compilation error.
Instead, this happened: rustc produces a binary with a corrupted code.
Pointer (0x0100) to a value is loaded into register
X
(r26:r27
) following by reads from*Y
.Meta
rustc --version --verbose
:Steps to reproduce:
repo: https://github.com/Slickis/rustc-ldd-x
The text was updated successfully, but these errors were encountered: