Arm® Compiler armclang Reference Guide

Version 6.6

Table of Contents

About this book
Using this book
Typographic conventions
Other information
1 Compiler Command-line Options
1.1 Support level definitions
1.2 Summary of armclang command-line options
1.3 -c
1.4 -D
1.5 -E
1.6 -e
1.7 -fbare-metal-pie
1.8 -fbracket-depth=N
1.9 -fcommon, -fno-common
1.10 -fdata-sections, -fno-data-sections
1.11 -ffast-math, -fno-fast-math
1.12 -ffp-mode
1.13 -ffunction-sections, -fno-function-sections
1.14 @file
1.15 -fldm-stm, -fno-ldm-stm
1.16 -fno-builtin
1.17 -fno-inline-functions
1.18 -flto, -fno-lto
1.19 -fexceptions, -fno-exceptions
1.20 -fomit-frame-pointer, -fno-omit-frame-pointer
1.21 -fropi, -fno-ropi
1.22 -fropi-lowering, -fno-ropi-lowering
1.23 -frwpi, -fno-rwpi
1.24 -frwpi-lowering, -fno-rwpi-lowering
1.25 -fshort-enums, -fno-short-enums
1.26 -fshort-wchar, -fno-short-wchar
1.27 -fstack-protector, -fstack-protector-all, -fstack-protector-strong, -fno-stack-protector
1.28 -fstrict-aliasing, -fno-strict-aliasing
1.29 -fvectorize, -fno-vectorize
1.30 -ftrapv
1.31 -fwrapv
1.32 -g, -gdwarf-2, -gdwarf-3, -gdwarf-4
1.33 -I
1.34 -include
1.35 -L
1.36 -l
1.37 -M, -MM
1.38 -MD, -MMD
1.39 -MF
1.40 -MG
1.41 -MP
1.42 -MT
1.43 -march
1.44 -marm
1.45 -mbig-endian
1.46 -mcmse
1.47 -mcpu
1.48 -mexecute-only
1.49 -mfloat-abi
1.50 -mfpu
1.51 -mimplicit-it
1.52 -mlittle-endian
1.53 -munaligned-access, -mno-unaligned-access
1.54 -mthumb
1.55 -nostdlib
1.56 -nostdlibinc
1.57 -o
1.58 -O
1.59 -pedantic
1.60 -pedantic-errors
1.61 -Rpass
1.62 -S
1.63 -save-temps
1.64 -std
1.65 --target
1.66 -U
1.67 -u
1.68 -v
1.69 --version
1.70 --version_number
1.71 --vsn
1.72 -W
1.73 -Wl
1.74 -Xlinker
1.75 -x
1.76 -###
2 Compiler-specific Keywords and Operators
2.1 Compiler-specific keywords and operators
2.2 __alignof__
2.3 __asm
2.4 __declspec attributes
2.5 __declspec(noinline)
2.6 __declspec(noreturn)
2.7 __declspec(nothrow)
2.8 __inline
2.9 __unaligned
2.10 __promise
3 Compiler-specific Function, Variable, and Type Attributes
3.1 Function attributes
3.2 __attribute__((always_inline)) function attribute
3.3 __attribute__((cmse_nonsecure_call)) function attribute
3.4 __attribute__((cmse_nonsecure_entry)) function attribute
3.5 __attribute__((const)) function attribute
3.6 __attribute__((constructor(priority))) function attribute
3.7 __attribute__((format_arg(string-index))) function attribute
3.8 __attribute__((interrupt("type"))) function attribute
3.9 __attribute__((malloc)) function attribute
3.10 __attribute__((naked)) function attribute
3.11 __attribute__((noinline)) function attribute
3.12 __attribute__((nonnull)) function attribute
3.13 __attribute__((noreturn)) function attribute
3.14 __attribute__((nothrow)) function attribute
3.15 __attribute__((pcs("calling_convention"))) function attribute
3.16 __attribute__((pure)) function attribute
3.17 __attribute__((section("name"))) function attribute
3.18 __attribute__((used)) function attribute
3.19 __attribute__((unused)) function attribute
3.20 __attribute__((value_in_regs)) function attribute
3.21 __attribute__((visibility("visibility_type"))) function attribute
3.22 __attribute__((weak)) function attribute
3.23 __attribute__((weakref("target"))) function attribute
3.24 Type attributes
3.25 __attribute__((aligned)) type attribute
3.26 __attribute__((packed)) type attribute
3.27 __attribute__((transparent_union)) type attribute
3.28 Variable attributes
3.29 __attribute__((alias)) variable attribute
3.30 __attribute__((aligned)) variable attribute
3.31 __attribute__((deprecated)) variable attribute
3.32 __attribute__((packed)) variable attribute
3.33 __attribute__((section("name"))) variable attribute
3.34 __attribute__((used)) variable attribute
3.35 __attribute__((unused)) variable attribute
3.36 __attribute__((weak)) variable attribute
3.37 __attribute__((weakref("target"))) variable attribute
4 Compiler-specific Intrinsics
4.1 __breakpoint intrinsic
4.2 __current_pc intrinsic
4.3 __current_sp intrinsic
4.4 __disable_fiq intrinsic
4.5 __disable_irq intrinsic
4.6 __enable_fiq intrinsic
4.7 __enable_irq intrinsic
4.8 __force_stores intrinsic
4.9 __memory_changed intrinsic
4.10 __schedule_barrier intrinsic
4.11 __semihost intrinsic
4.12 __vfp_status intrinsic
5 Compiler-specific Pragmas
5.1 #pragma clang system_header
5.2 #pragma clang diagnostic
5.3 #pragma clang section
5.4 #pragma once
5.5 #pragma pack(...)
5.6 #pragma unroll[(n)], #pragma unroll_completely
5.7 #pragma weak symbol, #pragma weak symbol1 = symbol2
6 Other Compiler-specific Features
6.1 ACLE support
6.2 Predefined macros
6.3 Inline functions
6.4 Half-precision floating-point number format
6.5 TT instruction intrinsics
6.6 Non-secure function pointer intrinsics
7 Standard C Implementation Definition
7.1 Implementation definition
7.2 Translation
7.3 Translation limits
7.4 Environment
7.5 Identifiers
7.6 Characters
7.7 Integers
7.8 Floating-point
7.9 Arrays and pointers
7.10 Hints
7.11 Structures, unions, enumerations, and bitfields
7.12 Qualifiers
7.13 Preprocessing directives
7.14 Library functions
7.15 Architecture
8 Standard C++ Implementation Definition
8.1 Implementation definition
8.2 General
8.3 Lexical conventions
8.4 Basic concepts
8.5 Standard conversions
8.6 Expressions
8.7 Declarations
8.8 Declarators
8.9 Templates
8.10 Exception handling
8.11 Preprocessing directives
8.12 Library introduction
8.13 Language support library
8.14 General utilities library
8.15 Strings library
8.16 Localization library
8.17 Containers library
8.18 Input/output library
8.19 Regular expressions library
8.20 Atomic operations library
8.21 Thread support library
8.22 Implementation quantities
9 armclang Integrated Assembler
9.1 Syntax of assembly files for integrated assembler
9.2 Assembly expressions
9.3 Alignment directives
9.4 Data definition directives
9.5 String definition directives
9.6 Floating-point data definition directives
9.7 Section directives
9.8 Conditional assembly directives
9.9 Macro directives
9.10 Symbol binding directives
9.11 Org directive
9.12 AArch32 Target selection directives
9.13 AArch64 Target selection directives
9.14 Space-filling directives
9.15 Type directive
10 armclang Inline Assembler
10.1 Inline Assembly
10.2 File-scope inline assembly
10.3 Inline assembly statements within a function
10.3.1 Assembly string
10.3.2 Output and input operands
10.3.3 Clobber list
10.3.4 volatile
10.4 Inline assembly constraint strings
10.4.1 Constraint modifiers
10.4.2 Constraint codes
10.4.3 Constraint codes common to AArch32 state and AArch64 state
10.4.4 Constraint codes for AArch32 state
10.4.5 Constraint codes for AArch64 state
10.4.6 Using multiple alternative operand constraints
10.5 Inline assembly template modifiers
10.5.1 Template modifiers common to AArch32 state and AArch64 state
10.5.2 Template modifiers for AArch32 state
10.5.3 Template modifiers for AArch64 state
10.6 Forcing inline assembly operands into specific registers
10.7 Symbol references and branches into and out of inline assembly
10.8 Duplication of labels in inline assembly statements

List of Figures

1-1 Integration boundaries in Arm Compiler 6.
5-1 Nonpacked structure S
5-2 Packed structure SP
6-1 IEEE half-precision floating-point format

List of Tables

1-1 armclang command-line options
1-2 Floating-point library variants
1-3 Floating-point library variant selection
1-4 Compiling without the -o option
3-1 Function attributes that the compiler supports, and their equivalents
4-1 Modifying the FPSCR flags
6-1 Predefined macros
7-1 Translation limits
9-1 Modifiers
9-2 Unary operators
9-3 Binary operators
9-4 Binary logical operators
9-5 Binary bitwise operators
9-6 Binary comparison operators
9-7 Relocation specifiers for AArch32 state
9-8 Relocation specifiers for AArch64 state
9-9 Data definition directives
9-10 Expression types supported by the data definition directives
9-11 Aliases for the data definition directives
9-12 Escape characters for the string definition directives
9-13 Aliases for the floating-point data definition directives
9-14 Section flags
9-15 Section Type
9-16 Sections with implicit flags and default types
9-17 .if condition modifiers
9-18 Macro parameter qualifier
10-1 Constraint modifiers

Release Information

Document History
Issue Date Confidentiality Change
A 14 March 2014 Non-Confidential Arm Compiler v6.00 Release
B 15 December 2014 Non-Confidential Arm Compiler v6.01 Release
C 30 June 2015 Non-Confidential Arm Compiler v6.02 Release
D 18 November 2015 Non-Confidential Arm Compiler v6.3 Release
E 24 February 2016 Non-Confidential Arm Compiler v6.4 Release
F 29 June 2016 Non-Confidential Arm Compiler v6.5 Release
G 04 November 2016 Non-Confidential Arm Compiler v6.6 Release
H 08 May 2017 Non-Confidential Arm Compiler v6.6.1 Release
I 29 November 2017 Non-Confidential Arm Compiler v6.6.2 Release
J 28 August 2019 Non-Confidential Arm Compiler v6.6.3 Release

Non-Confidential Proprietary Notice

This document is protected by copyright and other related rights and the practice or implementation of the information contained in this document may be protected by one or more patents or pending patent applications. No part of this document may be reproduced in any form by any means without the express prior written permission of Arm. No license, express or implied, by estoppel or otherwise to any intellectual property rights is granted by this document unless specifically stated.

Your access to the information in this document is conditional upon your acceptance that you will not use or permit others to use the information for the purposes of determining whether implementations infringe any third party patents.

THIS DOCUMENT IS PROVIDED “AS IS”. ARM PROVIDES NO REPRESENTATIONS AND NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE DOCUMENT. For the avoidance of doubt, Arm makes no representation with respect to, and has undertaken no analysis to identify or understand the scope and content of, third party patents, copyrights, trade secrets, or other rights.

This document may include technical inaccuracies or typographical errors.


This document consists solely of commercial items. You shall be responsible for ensuring that any use, duplication or disclosure of this document complies fully with any relevant export laws and regulations to assure that this document or any portion thereof is not exported, directly or indirectly, in violation of such export laws. Use of the word “partner” in reference to Arm’s customers is not intended to create or refer to any partnership relationship with any other company. Arm may make changes to this document at any time and without notice.

If any of the provisions contained in these terms conflict with any of the provisions of any click through or signed written agreement covering this document with Arm, then the click through or signed written agreement prevails over and supersedes the conflicting provisions of these terms. This document may be translated into other languages for convenience, and you agree that if there is any conflict between the English version of this document and any translation, the terms of the English version of the Agreement shall prevail.

The Arm corporate logo and words marked with ® or ™ are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. All rights reserved. Other brands and names mentioned in this document may be the trademarks of their respective owners. Please follow Arm’s trademark usage guidelines at

Copyright © 2014–2017, 2019 Arm Limited (or its affiliates). All rights reserved.

Arm Limited. Company 02557590 registered in England.

110 Fulbourn Road, Cambridge, England CB1 9NJ.


Additional Notices

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.

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 versionDUI0774J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.