Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
202: Prevent unnecessary bounds check in SCB::{get_priority, set_priority} r=therealprof a=qwerty19106 SystemHandler.index() gives true index for SCB.shpr array. But now it produce unnecessary bounds check. For example, SCB::set_priority: ``` 48: sym.cortex_m::peripheral::scb::__impl_cortex_m::peripheral::SCB_::set_priority::h622cd21bcc3321be (); 0x08000376 push {r7, lr} 0x08000378 mov r7, sp 0x0800037a bl cortex_m::peripheral::scb::SystemHandler::index::hdaf1a31aa5a6a8c5 ; sym.cortex_m::peripheral::scb::SystemHandler::index::hdaf1a31aa5a6a8c5 0x0800037e subs r0, 4 0x08000380 uxtb r0, r0 0x08000382 cmp r0, 0xb ; 11 0x08000384 itttt ls 0x08000386 movw r1, 0xed18 0x0800038a movt r1, 0xe000 0x0800038e movs r2, 0xff 0x08000390 strb r2, [r0, r1] 0x08000392 it ls 0x08000394 pop {r7, pc} 0x08000396 movw r2, 0x1dc0 0x0800039a movs r1, 0xc 0x0800039c movt r2, 0x800 0x080003a0 bl core::panicking::panic_bounds_check::h5181f47ae17a04a5 ; sym.core::panicking::panic_bounds_check::h5181f47ae17a04a5 0x080003a4 trap ``` This PR fix it. Co-authored-by: Роман Кривенков <[email protected]>
- Loading branch information