diff --git a/examples/rtic_bare1.rs b/examples/rtic_bare1.rs index 6a48f5d5844635726dd653207d809b24a03a2401..b09d722b234ada21fccdedc00c2c9b83b445448e 100644 --- a/examples/rtic_bare1.rs +++ b/examples/rtic_bare1.rs @@ -26,7 +26,7 @@ const APP: () = { // prevent optimization by read-volatile (unsafe) unsafe { - core::ptr::read_volatile(&x); + //core::ptr::read_volatile(&x); } } } @@ -355,12 +355,17 @@ const APP: () = { // // Dump the generated assembly. // -// ** your answer here ** +// 0x08000240 <+0>: push {r7, lr} +// 0x08000242 <+2>: mov r7, sp +// => 0x08000244 <+4>: bkpt 0x0000 +// 0x08000246 <+6>: bkpt 0x0000 +// 0x08000248 <+8>: b.n 0x8000244 <rtic_bare1::init+4> // // Where is the local variable stored? // What happened, and why is Rust + LLVM allowed to optimize out your code? // -// ** your answer here ** +// Since the local variable is no longer read then the compiler can +// optimize away the variable. // // Commit your answers (bare1_6) //