https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67660
--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> --- Just a note ... It might also make sense to tell the compiler (via function attribute) whether the ISR is re-entrant or not. On a single-core system, atomic ops in an ISR can be converted into normal load-modify-store ops if the ISR context can't be interrupted.