[Bug target/34736] [avr] optimiser does not keep interrupt disabled blocks small

eric dot weddington at atmel dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 24 17:07:00 GMT 2009



------- 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



More information about the Gcc-bugs mailing list