Named Address Spaces - Using the GNU Compiler Collection (GCC)

Next: Zero Length, Previous: Fixed-Point, Up: C Extensions

### 6.15 Named address spaces

As an extension, the GNU C compiler supports named address spaces as defined in the N1275 draft of ISO/IEC DTR 18037. Support for named address spaces in GCC will evolve as the draft technical report changes. Calling conventions for any target might also change. At present, only the SPU target supports other address spaces. On the SPU target, for example, variables may be declared as belonging to another address space by qualifying the type with the `__ea` address space identifier:

         extern int __ea i;

When the variable `i` is accessed, the compiler will generate special code to access this variable. It may use runtime library support, or generate special machine instructions to access that address space.

The `__ea` identifier may be used exactly like any other C type qualifier (e.g., `const` or `volatile`). See the N1275 document for more details.