mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
`=m` output operand means that value is write only, gcc may discard previous value because it assumes that it will be overwritten. This bug was not triggered in gcc v4 because `asm volatile` triggered full memory barrier. With old version, this code will increase `markme` only by 2, not 3: ``` static int markme = 0; markme++; ATOMIC_BLOCK_NB(0xff) { ATOMIC_BARRIER(markme); // markme is marked as overwritten, previous increment can be discarded markme++; } markme++; ``` |
||
---|---|---|
.. | ||
main | ||
test |