ARM® Compiler toolchain v4.1 for µVision Using the Compiler


List of Topics

Conventions and Feedback
Overview of the compiler
The compiler
Source language modes of the compiler
The C and C++ libraries
Getting started with the Compiler
Compiler command-line syntax
Compiler command-line options listed by group
Default compiler behavior
Order of compiler command-line options
Using stdin to input source code to the compiler
Directing output to stdout
Filename suffixes recognized by the compiler
Compiler output files
Factors influencing how the compiler searches for header files
Compiler command-line options and search paths
Compiler search rules and the current place
The ARMCCnnINC environment variable
Code compatibility between separately compiled and assembled modules
Linker feedback during compilation
Unused function code
Minimizing code size by eliminating unused functions during compilation
Minimizing code size by reducing compilation required for interworking
How to minimize compilation build time
Minimizing compilation build time with a single armcc invocation
Effect of --multifile on compilation build time
Minimizing compilation build time with parallel make
Compilation build time and Windows
Compiler Features
Compiler intrinsics
Performance benefits of compiler intrinsics
ARM assembler instruction intrinsics supported by the compiler
Generic intrinsics supported by the compiler
Compiler intrinsics for controlling IRQ and FIQ interrupts
Compiler intrinsics for inserting optimization barriers
Compiler intrinsics for inserting native instructions
Compiler intrinsics for Digital Signal Processing (DSP)
European Telecommunications Standards Institute (ETSI) basic operations
Compiler support for European Telecommunications Standards Institute (ETSI) basic operations
Overflow and carry status flags for C and C++ code
Texas Instruments (TI) C55x intrinsics for optimizing C code
Compiler support for accessing registers using named register variables
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 outside bit-band regions
Compiler support for thread-local storage
Compiler eight-byte alignment features
PreCompiled Header (PCH) files
Automatic PreCompiled Header (PCH) file processing
PreCompiled Header (PCH) file processing and the header stop point
PreCompiled Header (PCH) file creation requirements
Compilation with multiple PreCompiled Header (PCH) files
Obsolete PreCompiled Header (PCH) files
Manually specifying the filename and location of a PreCompiled Header (PCH) file
Selectively applying PreCompiled Header (PCH) file processing
Suppressing PreCompiled Header (PCH) file processing
Message output during PreCompiled Header (PCH) processing
Performance issues with PreCompiled Header (PCH) files
Default compiler options that are affected by optimization level
Compiler Coding Practices
The compiler as an optimizing compiler
Compiler optimization for code size versus speed
Compiler optimization levels and the debug view
Selecting the target CPU at compile time
Optimization of loop termination in C code
Loop unrolling in C code
Compiler optimization and the volatile keyword
Code metrics
Code metrics for measurement of code size and data size
Stack use in C and C++
Benefits of reducing debug information in objects and libraries
Methods of reducing debug information in objects and libraries
Guarding against multiple inclusion of header files
Methods of minimizing function parameter passing overhead
Functions that return multiple values through registers
Functions that return the same result when called with the same arguments
Comparison of pure and impure functions
Recommendation of postfix syntax when qualifying functions with ARM function modifiers
Inline functions
Compiler decisions on function inlining
Automatic function inlining and static functions
Inline functions and removal of unused out-of-line functions at link time
Automatic function inlining and multifile compilation
Restriction on overriding compiler decisions about function inlining
Compiler modes and inline functions
Inline functions in C++ and C90 mode
Inline functions in C99 mode
Inline functions and debugging
Types of data alignment
Advantages of natural data alignment
Compiler storage of data objects by natural byte alignment
Relevance of natural data alignment at compile time
Unaligned data access in C and C++ code
The __packed qualifier and unaligned data access in C and C++ code
Unaligned fields in structures
Performance penalty associated with marking whole structures as packed
Unaligned pointers in C and C++ code
Unaligned Load Register (LDR) instructions generated by the compiler
Detailed comparison of an unpacked struct, a __packed struct, and a struct with individually __packed fields
Compiler support for floating-point arithmetic
Default selection of hardware or software floating-point support
Example of hardware and software support differences for floating-point arithmetic
Vector Floating-Point (VFP) architectures
Limitations on hardware handling of floating-point arithmetic
Implementation of Vector Floating-Point (VFP) support code
Compiler and library support for half-precision floating-point numbers
Half-precision floating-point number format
Compiler support for floating-point computations and linkage
Types of floating-point linkage
Compiler options for floating-point linkage and computations
Integer division-by-zero errors in C code
About trapping integer division-by-zero errors with __aeabi_idiv0()
About trapping integer division-by-zero errors with __rt_raise()
Identification of integer division-by-zero errors in C code
Examining parameters when integer division-by-zero errors occur in C code
Software floating-point division-by-zero errors in C code
About trapping software floating-point division-by-zero errors
Identification of software floating-point division-by-zero errors
Software floating-point division-by-zero debugging
New language features of C99
New library features of C99
// comments in C99 and C90
Compound literals in C99
Designated initializers in C99
Hexadecimal floating-point numbers in C99
Flexible array members in C99
__func__ predefined identifier in C99
inline functions in C99
long long data type in C99 and C90
Macros with a variable number of arguments in C99
Mixed declarations and statements in C99
New block scopes for selection and iteration statements in C99
_Pragma preprocessing operator in C99
Restricted pointers in C99
Additional <math.h> library functions in C99
Complex numbers in C99
Boolean type and <stdbool.h> in C99
Extended integer types and functions in <inttypes.h> and <stdint.h> in C99
<fenv.h> floating-point environment access in C99
<stdio.h> snprintf family of functions in C99
<tgmath.h> type-generic math macros in C99
<wchar.h> wide character I/O functions in C99
How to prevent uninitialized data from being initialized to zero
Compiler Diagnostic Messages
Compiler diagnostics
Severity of compiler diagnostic messages
Options that change the severity of compiler diagnostic messages
Prefix letters in compiler diagnostic messages
Compiler exit status codes and termination messages
Compiler data flow warnings
Using the Inline and Embedded Assemblers of the ARM Compiler
Compiler support for inline assembly language
Inline assembler support in the compiler
Restrictions on inline assembler support in the compiler
Inline assembly language syntax with the __asm keyword in C and C++
Inline assembly language syntax with the asm keyword in C++
Inline assembler rules for compiler keywords __asm and asm
Restrictions on inline assembly operations in C and C++ code
Inline assembler register restrictions in C and C++ code
Inline assembler processor mode restrictions in C and C++ code
Inline assembler Thumb instruction set restrictions in C and C++ code
Inline assembler Vector Floating-Point (VFP) coprocessor restrictions in C and C++ code
Inline assembler instruction restrictions in C and C++ code
Miscellaneous inline assembler restrictions in C and C++ code
Inline assembler and register access in C and C++ code
Inline assembler and the # constant expression specifier in C and C++ code
Inline assembler and instruction expansion in C and C++ code
Expansion of inline assembler instructions that use constants
Expansion of inline assembler load and store instructions
Inline assembler effect on processor condition flags in C and C++ code
Inline assembler operands in C and C++ code
Inline assembler expression operands in C and C++ code
Inline assembler register list operands in C and C++ code
Inline assembler intermediate operands in C and C++ code
Inline assembler function calls and branches in C and C++ code
Behavior of BL and SVC without optional lists in C and C++ code
Inline assembler BL and SVC input parameter list in C and C++ code
Inline assembler BL and SVC output value list in C and C++ code
Inline assembler BL and SVC corrupted register list
Inline assembler branches and labels in C and C++ code
Inline assembler and virtual registers
Compiler support for embedded assembler
Embedded assembler syntax in C and C++
Effect of compiler ARM and Thumb states on embedded assembler
Restrictions on embedded assembly language functions in C and C++ code
Compiler generation of embedded assembly language functions
Access to C and C++ compile-time constant expressions from embedded assembler
Differences between expressions in embedded assembler and C or C++
Manual overload resolution in embedded assembler
__offsetof_base keyword for related base classes in embedded assembler
Compiler-supported keywords for calling class member functions in embedded assembler
__mcall_is_virtual(D, f)
__mcall_is_in_vbase(D, f)
__mcall_offsetof_vbase(D, f)
__mcall_this_offset(D, f)
__vcall_offsetof_vfunc(D, f)
Calling nonstatic member functions in embedded assembler
Calling a nonvirtual member function
Calling a virtual member function
Legacy inline assembler that accesses sp, lr, or pc
Accessing sp (r13), lr (r14), and pc (r15) in legacy code
Differences in compiler support of inline and embedded assembly code

Proprietary Notice

Words and logos marked with or are registered trademarks or trademarks of ARM in the EU and other countries, except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.

Some material in this document is based on IEEE 754 - 1985 IEEE Standard for Binary Floating-Point Arithmetic. The IEEE disclaims any responsibility or liability resulting from the placement and use in the described manner.

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Product Status

The information in this document is final, that is for a developed product.

Revision History
Revision AMay 2007Release for RVCT v3.1 for µVision
Revision BDecember 2008Release for RVCT v4.0 for µVision
Revision CJune 2011Release for ARM Compiler toolchain v4.1 for µVision
Copyright © 2007-2008, 2011 ARM. All rights reserved.ARM DUI 0375C
Non-ConfidentialID061811