Keil Logo Arm Logo

Technical Support

On-Line Manuals

Compiler User Guide

Conventions and Feedback Overview of the Compiler Getting Started with the Compiler Compiler Features Compiler intrinsics Performance benefits of compiler intrinsics ARM assembler instruction intrinsics supported by Generic intrinsics supported by the compiler Compiler intrinsics for controlling IRQ and FIQ in Compiler intrinsics for inserting optimization bar Compiler intrinsics for inserting native instructi Compiler intrinsics for Digital Signal Processing European Telecommunications Standards Institute (E Compiler support for European Telecommunications S Overflow and carry status flags for C and C++ code Texas Instruments (TI) C55x intrinsics for optimiz Compiler support for accessing registers using nam Pragmas recognized by the compiler Compiler and processor support for bit-banding Compiler type attribute, __attribute__((bitband)) --bitband compiler command-line option How the compiler handles bit-band objects placed o Compiler support for thread-local storage Compiler eight-byte alignment features Using compiler and linker support for symbol versi PreCompiled Header (PCH) files Automatic PreCompiled Header (PCH) file processing PreCompiled Header (PCH) file processing and the h PreCompiled Header (PCH) file creation requirement Compilation with multiple PreCompiled Header (PCH) Obsolete PreCompiled Header (PCH) files Manually specifying the filename and location of a Selectively applying PreCompiled Header (PCH) file Suppressing PreCompiled Header (PCH) file processi Message output during PreCompiled Header (PCH) pro Performance issues with PreCompiled Header (PCH) f Default compiler options that are affected by opti Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR

Compiler User Guide

Compiler intrinsics for inserting optimization barriers

Compiler intrinsics for inserting optimization barriers

The compiler can perform a range of optimizations, including re-ordering instructions and merging some operations. In some cases, such as system level programming where memory is being accessed concurrently by multiple processes, it might be necessary to disable instruction re-ordering and force memory to be updated.

The optimization barrier intrinsics __schedule_barrier, __force_stores and __memory_changed do not generate code, but they can result in slightly increased code size and additional memory accesses.

Note

On some systems the memory barrier intrinsics might not be sufficient to ensure memory consistency. For example, the __memory_changed intrinsic forces values held in registers to be written out to memory. However, if the destination for the data is held in a region that can be buffered it might wait in a write buffer. In this case you might also have to write to CP15 or use a memory barrier instruction to drain the write buffer. See the Technical Reference Manual for your ARM processor for more information.

Show/hideSee also

Reference
Other information

The Technical Reference Manual for your ARM processor.

Copyright © 2007-2008, 2011-2012 ARM. All rights reserved.ARM DUI 0375D
Non-ConfidentialID062912

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.