This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/34736] [avr] optimiser does not keep interrupt disabled blocks small
- From: "eric dot weddington at atmel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2009 17:07:31 -0000
- Subject: [Bug target/34736] [avr] optimiser does not keep interrupt disabled blocks small
- References: <bug-34736-15581@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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