Skip to content
Snippets Groups Projects
Commit ead0824f authored by Anton's avatar Anton
Browse files

bare1_6

parent 3fc043a2
No related branches found
No related tags found
No related merge requests found
......@@ -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)
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment