------- Comment #4 from eric dot weddington at atmel dot com 2009-08-24 17:07 ------- The cli() and sei() macros from avr-libc are volatile and generate inline assembly, which the compiler knows nothing about. The compiler is not aware that the load of the constant into a register can be done, and should be done, outside of your critical block.
I suggest that you write this whole code snippet in inline assembly to get the shortest possible time with interrupts disabled. -- eric dot weddington at atmel dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34736