ARM® Compiler Software Development Guide

Version 6.00

Table of Contents

About this book
Using this book
Typographic conventions
Other information
1 Introducing the Toolchain
1.1 Toolchain overview
1.2 Common compiler toolchain options
1.3 "Hello world" example
1.4 Passing options from the compiler to the linker
2 Diagnostics
2.1 Understanding diagnostics
2.2 Options for controlling diagnostics with armclang
2.3 Options for controlling diagnostics with the other tools
3 Compiling C and C++ Code
3.1 Specifying a target architecture, processor, and instruction set
3.2 Using PCH files to reduce compile time
3.3 Using inline assembly code
3.4 Using intrinsics
3.5 Preventing the use of floating-point instructions and registers
4 Assembling Assembly Code
4.1 Assembling GNU and ARM syntax assembly code
4.2 Preprocessing assembly code
5 Linking Object Files to Produce an Executable
5.1 Linking object files to produce an executable
6 Optimization
6.1 Optimizing for code size or performance
6.2 How optimization affects the debug illusion
7 Coding Considerations
7.1 Optimization of loop termination in C code
7.2 Loop unrolling in C code
7.3 Compiler optimization and the volatile keyword
7.4 Stack use in C and C++
7.5 Methods of minimizing function parameter passing overhead
7.6 Inline functions
7.7 Integer division-by-zero errors in C code
7.8 About trapping integer division-by-zero errors with __aeabi_idiv0()
7.9 About trapping integer division-by-zero errors with __rt_raise()
7.10 Identification of integer division-by-zero errors in C code
8 Language Compatibility and Extensions
8.1 Language compatibility and extensions

List of Figures

1-1 Compiler toolchain

List of Tables

1-1 armclang common options
1-2 armlink common options
1-3 armar common options
1-4 fromelf common options
1-5 armasm common options
1-6 armclang linker control options
3-1 Compiling for different combinations of architecture and instruction set
7-1 C code for incrementing and decrementing loops
7-2 C Disassembly for incrementing and decrementing loops
7-3 C code for rolled and unrolled bit-counting loops
7-4 Disassembly for rolled and unrolled bit-counting loops
7-5 C code for nonvolatile and volatile buffer loops
7-6 Disassembly for nonvolatile and volatile buffer loop

Release Information

Document History
Issue Date Confidentiality Change
A 14 March 2014 Non-Confidential ARM Compiler v6.0 Release

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

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.
Unrestricted Access is an ARM internal classification.

Product Status

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

Web Address

Non-ConfidentialPDF file icon PDF versionARM DUI0773A
Copyright © 2014 ARM. All rights reserved.