AVR: interrupt code broken by optimization flags #77541
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
O-AVR
Target: AVR processors (ATtiny, ATmega, etc.)
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I've run into an issue with code that uses interrupts on AVR. I'm not sure if this applies to any other platform.
This issue has same behavior as #75504 but It can't resolved after update compiler to current nightly version.
This issue reproduce on everything nightly rust compiler with AVR target support (I trying to compile it every nightly compiler updates).
I create minimal reproduce project for this issue - https://github.com/no111u3/m328p_robo_rust. Than I change optimization flags to size optimization level
opt-level="z"
oropt-level="s"
upper code doesn't work correctly, there has two options:I run upper code on two different mcu's that I have: on Atmega48 and Atmega328p, if we use same flags we have same behavior for run. For optimization level 2 I can use huge code in interrupt such as - https://github.com/no111u3/m48_robo_rust/blob/master/examples/dynamic_indication.rs#L119 but If I use
z
ors
optimization interrupt works only for short code such as - https://github.com/no111u3/m48_robo_rust/blob/master/examples/pwm_int.rs#L39The text was updated successfully, but these errors were encountered: