
Transcription
Using the GNU Compiler CollectionFor gcc version 12.0.0 (pre-release)(GCC)Richard M. Stallman and the GCC Developer Community
Published by:GNU Pressa division of theFree Software Foundation51 Franklin Street, Fifth FloorBoston, MA 02110-1301 USAWebsite: http://www.gnupress.orgGeneral: [email protected]: [email protected] 617-542-5942Fax 617-542-2652Last printed October 2003 for GCC 3.3.1.Printed copies are available for 45 each.Copyright c 1988-2021 Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this document under the terms ofthe GNU Free Documentation License, Version 1.3 or any later version published by theFree Software Foundation; with the Invariant Sections being “Funding Free Software”, theFront-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (seebelow). A copy of the license is included in the section entitled “GNU Free DocumentationLicense”.(a) The FSF’s Front-Cover Text is:A GNU Manual(b) The FSF’s Back-Cover Text is:You have freedom to copy and modify this GNU Manual, like GNU software. Copiespublished by the Free Software Foundation raise funds for GNU development.
iShort ContentsIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Programming Languages Supported by GCC . . . . . . . . . . . . . . . 32 Language Standards Supported by GCC . . . . . . . . . . . . . . . . . . 53 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 C Implementation-Defined Behavior . . . . . . . . . . . . . . . . . . . . 4975 C Implementation-Defined Behavior . . . . . . . . . . . . . . . . . 5076 Extensions to the C Language Family . . . . . . . . . . . . . . . . . . . 5097 Extensions to the C Language . . . . . . . . . . . . . . . . . . . . . . 8658 GNU Objective-C Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 8799 Binary Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89510 gcov—a Test Coverage Program . . . . . . . . . . . . . . . . . . . . . . . 89911 gcov-tool—an Offline Gcda Profile Processing Tool . . . . . . . 91312 gcov-dump—an Offline Gcda and Gcno Profile Dump Tool . . 91713 lto-dump—Tool for dumping LTO object files. . . . . . . . . . . . 91914 Known Causes of Trouble with GCC . . . . . . . . . . . . . . . . . . . . 92115 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93716 How To Get Help with GCC . . . . . . . . . . . . . . . . . . . . . . . . . . 93917 Contributing to GCC Development . . . . . . . . . . . . . . . . . . . . . 941Funding Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 943The GNU Project and GNU/Linux . . . . . . . . . . . . . . . . . . . . . . . . . 945GNU General Public License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . 959Contributors to GCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967Option Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985Keyword Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1013
iiiTable of ContentsIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Programming Languages Supported by GCC. 32Language Standards Supported by GCC . . . . . 52.12.22.32.42.52.63C Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Objective-C and Objective-C Languages . . . . . . . . . . . . . . . . . . . .Go Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .References for Other Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .567889GCC Command Options . . . . . . . . . . . . . . . . . . . . . . 113.1 Option Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2 Options Controlling the Kind of Output . . . . . . . . . . . . . . . . . . . . . . . 333.3 Compiling C Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.4 Options Controlling C Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.5 Options Controlling C Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.6 Options Controlling Objective-C and Objective-C Dialects . . 723.7 Options to Control Diagnostic Messages Formatting . . . . . . . . . . . 763.8 Options to Request or Suppress Warnings . . . . . . . . . . . . . . . . . . . . . 873.9 Options That Control Static Analysis . . . . . . . . . . . . . . . . . . . . . . . . 1393.10 Options for Debugging Your Program . . . . . . . . . . . . . . . . . . . . . . . 1463.11 Options That Control Optimization . . . . . . . . . . . . . . . . . . . . . . . . . 1533.12 Program Instrumentation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 2243.13 Options Controlling the Preprocessor. . . . . . . . . . . . . . . . . . . . . . . . 2403.14 Passing Options to the Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . 2483.15 Options for Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2483.16 Options for Directory Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2543.17 Options for Code Generation Conventions . . . . . . . . . . . . . . . . . . . 2573.18 GCC Developer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2673.19 Machine-Dependent Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2843.19.1 AArch64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2843.19.1.1 ‘-march’ and ‘-mcpu’ Feature Modifiers . . . . . . . . . . . . 2893.19.2 Adapteva Epiphany Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 2913.19.3 AMD GCN Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2933.19.4 ARC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2943.19.5 ARM Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3043.19.6 AVR Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3193.19.6.1 EIND and Devices with More Than 128 Ki Bytes ofFlash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
ivUsing the GNU Compiler Collection (GCC)3.19.6.2 Handling of the RAMPD, RAMPX, RAMPY and RAMPZ SpecialFunction Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3263.19.6.3 AVR Built-in Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3273.19.7 Blackfin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3303.19.8 C6X Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3323.19.9 CRIS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3333.19.10 CR16 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3353.19.11 C-SKY Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3353.19.12 Darwin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3383.19.13 DEC Alpha Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3413.19.14 eBPF Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3463.19.15 FR30 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3463.19.16 FT32 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3473.19.17 FRV Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3473.19.18 GNU/Linux Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3513.19.19 H8/300 Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3513.19.20 HPPA Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3523.19.21 IA-64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3553.19.22 LM32 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3583.19.23 M32C Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3593.19.24 M32R/D Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3593.19.25 M680x0 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3613.19.26 MCore Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3663.19.27 MeP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3673.19.28 MicroBlaze Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3683.19.29 MIPS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3703.19.30 MMIX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3853.19.31 MN10300 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3863.19.32 Moxie Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3873.19.33 MSP430 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3873.19.34 NDS32 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3903.19.35 Nios II Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3913.19.36 Nvidia PTX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3973.19.37 OpenRISC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3983.19.38 PDP-11 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3993.19.39 picoChip Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4003.19.40 PowerPC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4003.19.41 PRU Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4003.19.42 RISC-V Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4013.19.43 RL78 Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4043.19.44 IBM RS/6000 and PowerPC Options . . . . . . . . . . . . . . . . . . 4063.19.45 RX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4223.19.46 S/390 and zSeries Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4253.19.47 Score Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4283.19.48 SH Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4293.19.49 Solaris 2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4353.19.50 SPARC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4363.19.51 Options for System V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
v3.19.52 TILE-Gx Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.53 TILEPro Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.54 V850 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.55 VAX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.56 Visium Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.57 VMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.58 VxWorks Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.59 x86 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.60 x86 Windows Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.61 Xstormy16 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.62 Xtensa Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.19.63 zSeries Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.20 Specifying Subprocesses and the Switches to Pass to Them . .3.21 Environment Variables Affecting GCC . . . . . . . . . . . . . . . . . . . . . .3.22 Using Precompiled Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.23 C Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.23.1 Module Mapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.23.2 Module Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.23.3 Compiled Module Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4C Implementation-Defined Behavior . . . . . . . 6489491493495495Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Floating Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Arrays and Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Structures, Unions, Enumerations, and Bit-Fields . . . . . . . . . . . . .Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Declarators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Preprocessing Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Library Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Locale-Specific Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497497497498499499500501501502503503503504504505C Implementation-Defined Behavior . . . 5075.15.2Conditionally-Supported Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
vi6Using the GNU Compiler Collection (GCC)Extensions to the C Language Family . . . . . . 5096.1 Statements and Declarations in Expressions . . . . . . . . . . . . . . . . . .6.2 Locally Declared Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3 Labels as Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4 Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.5 Nonlocal Gotos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.6 Constructing Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.7 Referring to a Type with typeof . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.8 Conditionals with Omitted Operands . . . . . . . . . . . . . . . . . . . . . . . . .6.9 128-bit Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.10 Double-Word Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.11 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.12 Additional Floating Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.13 Half-Precision Floating Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.14 Decimal Floating Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.15 Hex Floats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.16 Fixed-Point Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.17 Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.17.1 AVR Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . .6.17.2 M32C Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . .6.17.3 RL78 Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . .6.17.4 x86 Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.18 Arrays of Length Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.19 Structures with No Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.20 Arrays of Variable Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.21 Macros with a Variable Number of Arguments. . . . . . . . . . . . . . .6.22 Slightly Looser Rules for Escaped Newlines . . . . . . . . . . . . . . . . . .6.23 Non-Lvalue Arrays May Have Subscripts . . . . . . . . . . . . . . . . . . . .6.24 Arithmetic on void- and Function-Pointers . . . . . . . . . . . . . . . . . .6.25 Pointer Arguments in Variadic Functions . . . . . . . . . . . . . . . . . . . .6.26 Pointers to Arrays with Qualifiers Work as Expected . . . . . . . .6.27 Non-Constant Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.28 Compound Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.29 Designated Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.30 Case Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.31 Cast to a Union Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.32 Mixed Declarations, Labels and Code . . . . . . . . . . . . . . . . . . . . . . .6.33 Declaring Attributes of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.1 Common Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.2 AArch64 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.2.1 Inlining rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.3 AMD GCN Function Attributes . . . . . . . . . . . . . . . . . . . . . . . .6.33.4 ARC Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.5 ARM Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.6 AVR Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.7 Blackfin Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.8 BPF Function Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.9 CR16 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534534535535536561563564565566568569570570
vii6.33.10 C-SKY Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.11 Epiphany Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . .6.33.12 H8/300 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.13 IA-64 Function Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.14 M32C Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.15 M32R/D Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . .6.33.16 m68k Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.17 MCORE Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . .6.33.18 MeP Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.19 MicroBlaze Function Attributes . . . . . . . . . . . . . . . . . . . . . . .6.33.20 Microsoft Windows Function Attributes . . . . . . . . . . . . . . .6.33.21 MIPS Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.22 MSP430 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.23 NDS32 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.24 Nios II Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.25 Nvidia PTX Function Attributes . . . . . . . . . . . . . . . . . . . . . .6.33.26 PowerPC Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . .6.33.27 RISC-V Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.28 RL78 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.29 RX Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.30 S/390 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.31 SH Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.32 Symbian OS Function Attributes . . . . . . . . . . . . . . . . . . . . . .6.33.33 V850 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.34 Visium Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.35 x86 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.33.36 Xstormy16 Function Attributes . . . . . . . . . . . . . . . . . . . . . . .6.34 Specifying Attributes of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.1 Common Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.2 ARC Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.3 AVR Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.4 Blackfin Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.5 H8/300 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.6 IA-64 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.7 M32R/D Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.8 MeP Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.9 Microsoft Windows Variable Attributes . . . . . . . . . . . . . . . . .6.34.10 MSP430 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.11 Nvidia PTX Variable Attributes . . . . . . . . . . . . . . . . . . . . . .6.34.12 PowerPC Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . .6.34.13 RL78 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.14 V850 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.15 x86 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.34.16 Xstormy16 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . .6.35 Specifying Attributes of Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.35.1 Common Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.35.2 ARC Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.35.3 ARM Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611611611612613613613614614614614614615623623
viiiUsing the GNU Compiler Collection (GCC)6.35.4 MeP Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6236.35.5 PowerPC Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6236.35.6 x86 Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6236.36 Label Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6246.37 Enumerator Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6256.38 Statement Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6256.39 Attribute Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6266.40 Prototypes and Old-Style Function Definitions . . . . . . . . . . . . . . 6296.41 C Style Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6306.42 Dollar Signs in Identifier Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6306.43 The Character ESC in Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6306.44 Determining the Alignment of Functions, Types or Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6306.45 An Inline Function is As Fast As a Macro . . . . . . . . . . . . . . . . . . . 6316.46 When is a Volatile Object Accessed? . . . . . . . . . . . . . . . . . . . . . . . . 6326.47 How to Use Inline Assembly Language in C Code . . . . . . . . . . . 6336.47.1 Basic Asm — Assembler Instructions Without Operands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6346.47.2 Extended Asm - Assembler Instructions with C ExpressionOperands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6356.47.2.1 Volatile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6376.47.2.2 Assembler Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6396.47.2.3 Output Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6416.47.2.4 Flag Output Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6436.47.2.5 Input Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6456.47.2.6 Clobbers and Scratch Registers . . . . . . . . . . . . . . . . . . . . 6466.47.2.7 Goto Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6496.47.2.8 x86 Operand Modifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6516.47.2.9 x86 Floating-Point asm Operands . . . . . . . . . . . . . . . . . . 6536.47.2.10 MSP430 Operand Modifiers . . . . . . . . . . . . . . . . . . . . . . 6546.47.3 Constraints for asm Operands . . . . . . . . . . . . . . . . . . . . . . . . . . 6556.47.3.1 Simple Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6556.47.3.2 Multiple Alternative Constraints . . . . . . . . . . . . . . . . . . 6576.47.3.3 Constraint Modifier Characters . . . . . . . . . . . . . . . . . . . . 6586.47.3.4 Constraints for Particular Machines . . . . . . . . . . . . . . . 6596.47.4 Controlling Names Used in Assembler Code . . . . . . . . . . . . 6866.47.5 Variables in Specified Registers . . . . . . . . . . . . . . . . . . . . . . . . . 6876.47.5.1 Defining Global Register Variables . . . . . . . . . . . . . . . . . 6876.47.5.2 Specifying Registers for Local Variables. . . . . . . . . . . . 6886.47.6 Size of an asm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6896.48 Alternate Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6906.49 Incomplete enum Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6906.50 Function Names as Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6906.51 Getting the Return or Frame Address of a Function . . . . . . . . . 6916.52 Using Vector Instructions through Built-in Functions . . . . . . . . 6936.53 Support for offsetof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6966.54 Legacy sync Built-in Functions for Atomic Memory Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
ix6.55Built-in Functions for Memory Model Aware Atomic Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6996.56 Built-in Functions to Perform Arithmetic with Overflow Checking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7036.57 x86-Specific Memory Model Extensions for Transactional Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7056.58 Object Size Checking Built-in Functions . . . . . . . . . . . . . . . . . . . . . 7066.59
Using the GNU Compiler Collection For gcc version 12.0.0 (pre-release) (GCC) Richard M. Stallman and the GCC Developer Community