Richard m stallman - using the GNU compiler collection GCC 4 8 1

792 974 0
Richard m  stallman  -  using the GNU compiler collection GCC 4 8 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Đây là quyển sách tiếng anh về lĩnh vực công nghệ thông tin cho sinh viên và những ai có đam mê. Quyển sách này trình về lý thuyết ,phương pháp lập trình cho ngôn ngữ C và C++.

Using the GNU Compiler Collection For gcc version 4.8.1 (GCC) Richard M. Stallman and the GCC Developer Community Published by: GNU Press Website: www.gnupress.org a division of the General: press@gnu.org Free Software Foundation Orders: sales@gnu.org 51 Franklin Street, Fifth Floor Tel 617-542-5942 Boston, MA 02110-1301 USA Fax 617-542-2652 Last printed October 2003 for GCC 3.3.1. Printed copies are available for $45 each. Copyright c  1988-2013 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being “Funding Free Software”, the Front-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled “GNU Free Documentation License”. (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. Copies published by the Free Software Foundation raise funds for GNU development. i Short Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 Programming Languages Supported by GCC . . . . . . . . . . . . . . . 3 2 Language Standards Supported by GCC . . . . . . . . . . . . . . . . . . 5 3 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4 C Implementation-defined behavior . . . . . . . . . . . . . . . . . . . . . 313 5 C++ Implementation-defined behavior . . . . . . . . . . . . . . . . . . 321 6 Extensions to the C Language Family . . . . . . . . . . . . . . . . . . . 323 7 Extensions to the C++ Language . . . . . . . . . . . . . . . . . . . . . . 643 8 GNU Objective-C features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657 9 Binary Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673 10 gcov—a Test Coverage Program . . . . . . . . . . . . . . . . . . . . . . . 677 11 Known Causes of Trouble with GCC . . . . . . . . . . . . . . . . . . . . 685 12 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 13 How To Get Help with GCC . . . . . . . . . . . . . . . . . . . . . . . . . . 703 14 Contributing to GCC Development . . . . . . . . . . . . . . . . . . . . . 705 Funding Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 The GNU Project and GNU/Linux. . . . . . . . . . . . . . . . . . . . . . . . . 709 GNU General Public License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . 723 Contributors to GCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731 Option Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747 Keyword Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765 iii Table of Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 Programming Languages Supported by GCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Language Standards Supported by GCC . . . . . 5 2.1 C language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 C++ language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Objective-C and Objective-C++ languages . . . . . . . . . . . . . . . . . . . . . 7 2.4 Go language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.5 References for other languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . . 9 3.1 Option Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2 Options Controlling the Kind of Output . . . . . . . . . . . . . . . . . . . . . . . 24 3.3 Compiling C++ Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.4 Options Controlling C Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.5 Options Controlling C++ Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.6 Options Controlling Objective-C and Objective-C++ Dialects. . 46 3.7 Options to Control Diagnostic Messages Formatting . . . . . . . . . . . 49 3.8 Options to Request or Suppress Warnings . . . . . . . . . . . . . . . . . . . . . 50 3.9 Options for Debugging Your Program or GCC . . . . . . . . . . . . . . . . . 74 3.10 Options That Control Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . 97 3.11 Options Controlling the Preprocessor. . . . . . . . . . . . . . . . . . . . . . . . 148 3.12 Passing Options to the Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 3.13 Options for Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 3.14 Options for Directory Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 3.15 Specifying subprocesses and the switches to pass to them . . . . 165 3.16 Specifying Target Machine and Compiler Version . . . . . . . . . . . . 173 3.17 Hardware Models and Configurations . . . . . . . . . . . . . . . . . . . . . . . 173 3.17.1 AArch64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 3.17.1.1 ‘-march’ and ‘-mcpu’ feature modifiers. . . . . . . . . . . . . 174 3.17.2 Adapteva Epiphany Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 3.17.3 ARM Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 3.17.4 AVR Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 3.17.4.1 EIND and Devices with more than 128 Ki Bytes of Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 3.17.4.2 Handling of the RAMPD, RAMPX, RAMPY and RAMPZ Special Function Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 3.17.4.3 AVR Built-in Macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 3.17.5 Blackfin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 3.17.6 C6X Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 iv Using the GNU Compiler Collection (GCC) 3.17.7 CRIS Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 3.17.8 CR16 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 3.17.9 Darwin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 3.17.10 DEC Alpha Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 3.17.11 FR30 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 3.17.12 FRV Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 3.17.13 GNU/Linux Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 3.17.14 H8/300 Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 3.17.15 HPPA Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 3.17.16 Intel 386 and AMD x86-64 Options . . . . . . . . . . . . . . . . . . . 211 3.17.17 i386 and x86-64 Windows Options . . . . . . . . . . . . . . . . . . . . 226 3.17.18 IA-64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 3.17.19 LM32 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 3.17.20 M32C Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 3.17.21 M32R/D Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 3.17.22 M680x0 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 3.17.23 MCore Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 3.17.24 MeP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 3.17.25 MicroBlaze Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 3.17.26 MIPS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 3.17.27 MMIX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 3.17.28 MN10300 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 3.17.29 Moxie Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 3.17.30 PDP-11 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 3.17.31 picoChip Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 3.17.32 PowerPC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 3.17.33 RL78 Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 3.17.34 IBM RS/6000 and PowerPC Options . . . . . . . . . . . . . . . . . . 258 3.17.35 RX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 3.17.36 S/390 and zSeries Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 3.17.37 Score Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 3.17.38 SH Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 3.17.39 Solaris 2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 3.17.40 SPARC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 3.17.41 SPU Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 3.17.42 Options for System V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 3.17.43 TILE-Gx Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 3.17.44 TILEPro Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 3.17.45 V850 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 3.17.46 VAX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 3.17.47 VMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 3.17.48 VxWorks Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 3.17.49 x86-64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 3.17.50 Xstormy16 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 3.17.51 Xtensa Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 3.17.52 zSeries Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 3.18 Options for Code Generation Conventions . . . . . . . . . . . . . . . . . . . 298 3.19 Environment Variables Affecting GCC . . . . . . . . . . . . . . . . . . . . . . 308 v 3.20 Using Precompiled Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 4 C Implementation-defined behavior . . . . . . . . 313 4.1 Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 4.2 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 4.3 Identifiers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 4.4 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 4.5 Integers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 4.6 Floating point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 4.7 Arrays and pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 4.8 Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 4.9 Structures, unions, enumerations, and bit-fields . . . . . . . . . . . . . . . 317 4.10 Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 4.11 Declarators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 4.12 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 4.13 Preprocessing directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 4.14 Library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 4.15 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 4.16 Locale-specific behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 5 C++ Implementation-defined behavior . . . . 321 5.1 Conditionally-supported behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 5.2 Exception handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 6 Extensions to the C Language Family . . . . . . 323 6.1 Statements and Declarations in Expressions . . . . . . . . . . . . . . . . . . 323 6.2 Locally Declared Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 6.3 Labels as Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 6.4 Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 6.5 Constructing Function Calls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 6.6 Referring to a Type with typeof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 6.7 Conditionals with Omitted Operands. . . . . . . . . . . . . . . . . . . . . . . . . 331 6.8 128-bit integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 6.9 Double-Word Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 6.10 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 6.11 Additional Floating Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 6.12 Half-Precision Floating Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 6.13 Decimal Floating Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 6.14 Hex Floats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 6.15 Fixed-Point Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 6.16 Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 6.16.1 AVR Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 6.16.2 M32C Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . 338 6.16.3 RL78 Named Address Spaces. . . . . . . . . . . . . . . . . . . . . . . . . . . 338 6.16.4 SPU Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 6.17 Arrays of Length Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 6.18 Structures With No Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 vi Using the GNU Compiler Collection (GCC) 6.19 Arrays of Variable Length. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 6.20 Macros with a Variable Number of Arguments. . . . . . . . . . . . . . . 341 6.21 Slightly Looser Rules for Escaped Newlines . . . . . . . . . . . . . . . . . . 341 6.22 Non-Lvalue Arrays May Have Subscripts . . . . . . . . . . . . . . . . . . . . 342 6.23 Arithmetic on void- and Function-Pointers. . . . . . . . . . . . . . . . . . 342 6.24 Non-Constant Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 6.25 Compound Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 6.26 Designated Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 6.27 Case Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 6.28 Cast to a Union Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 6.29 Mixed Declarations and Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 6.30 Declaring Attributes of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 6.31 Attribute Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 6.32 Prototypes and Old-Style Function Definitions . . . . . . . . . . . . . . 379 6.33 C++ Style Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 6.34 Dollar Signs in Identifier Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 6.35 The Character ESC in Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 6.36 Specifying Attributes of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 6.36.1 AVR Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 6.36.2 Blackfin Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 6.36.3 M32R/D Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 6.36.4 MeP Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 6.36.5 i386 Variable Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 6.36.6 PowerPC Variable Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . 388 6.36.7 SPU Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 6.36.8 Xstormy16 Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 388 6.37 Specifying Attributes of Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 6.37.1 ARM Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 6.37.2 MeP Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 6.37.3 i386 Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 6.37.4 PowerPC Type Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 6.37.5 SPU Type Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 6.38 Inquiring on Alignment of Types or Variables . . . . . . . . . . . . . . . 394 6.39 An Inline Function is As Fast As a Macro . . . . . . . . . . . . . . . . . . . 395 6.40 When is a Volatile Object Accessed? . . . . . . . . . . . . . . . . . . . . . . . . 396 6.41 Assembler Instructions with C Expression Operands. . . . . . . . . 397 6.41.1 Size of an asm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 6.41.2 i386 floating-point asm operands . . . . . . . . . . . . . . . . . . . . . . . 403 6.42 Constraints for asm Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 6.42.1 Simple Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 6.42.2 Multiple Alternative Constraints . . . . . . . . . . . . . . . . . . . . . . . 407 6.42.3 Constraint Modifier Characters. . . . . . . . . . . . . . . . . . . . . . . . . 408 6.42.4 Constraints for Particular Machines . . . . . . . . . . . . . . . . . . . . 409 6.43 Controlling Names Used in Assembler Code . . . . . . . . . . . . . . . . . 433 6.44 Variables in Specified Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 6.44.1 Defining Global Register Variables . . . . . . . . . . . . . . . . . . . . . 434 6.44.2 Specifying Registers for Local Variables . . . . . . . . . . . . . . . . 435 6.45 Alternate Keywords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 vii 6.46 Incomplete enum Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 6.47 Function Names as Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 6.48 Getting the Return or Frame Address of a Function . . . . . . . . . 437 6.49 Using Vector Instructions through Built-in Functions . . . . . . . . 438 6.50 Offsetof. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440 6.51 Legacy sync Built-in Functions for Atomic Memory Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 6.52 Built-in functions for memory model aware atomic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 6.53 x86 specific memory model extensions for transactional memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 6.54 Object Size Checking Built-in Functions. . . . . . . . . . . . . . . . . . . . . 447 6.55 Other Built-in Functions Provided by GCC . . . . . . . . . . . . . . . . . 449 6.56 Built-in Functions Specific to Particular Target Machines . . . . 458 6.56.1 Alpha Built-in Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 6.56.2 ARM iWMMXt Built-in Functions . . . . . . . . . . . . . . . . . . . . . 459 6.56.3 ARM NEON Intrinsics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 6.56.3.1 Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 6.56.3.2 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466 6.56.3.3 Multiply-accumulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 6.56.3.4 Multiply-subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 6.56.3.5 Fused-multiply-accumulate . . . . . . . . . . . . . . . . . . . . . . . . 470 6.56.3.6 Fused-multiply-subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 6.56.3.7 Round to integral (to nearest, ties to even) . . . . . . . . 470 6.56.3.8 Round to integral (to nearest, ties away from zero) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 6.56.3.9 Round to integral (towards +Inf). . . . . . . . . . . . . . . . . . 470 6.56.3.10 Round to integral (towards -Inf) . . . . . . . . . . . . . . . . . 470 6.56.3.11 Round to integral (towards 0) . . . . . . . . . . . . . . . . . . . . 470 6.56.3.12 Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 6.56.3.13 Comparison (equal-to) . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 6.56.3.14 Comparison (greater-than-or-equal-to). . . . . . . . . . . . 475 6.56.3.15 Comparison (less-than-or-equal-to) . . . . . . . . . . . . . . . 475 6.56.3.16 Comparison (greater-than) . . . . . . . . . . . . . . . . . . . . . . . 476 6.56.3.17 Comparison (less-than). . . . . . . . . . . . . . . . . . . . . . . . . . . 477 6.56.3.18 Comparison (absolute greater-than-or-equal-to) . . . 477 6.56.3.19 Comparison (absolute less-than-or-equal-to) . . . . . . 478 6.56.3.20 Comparison (absolute greater-than) . . . . . . . . . . . . . . 478 6.56.3.21 Comparison (absolute less-than) . . . . . . . . . . . . . . . . . . 478 6.56.3.22 Test bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478 6.56.3.23 Absolute difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479 6.56.3.24 Absolute difference and accumulate. . . . . . . . . . . . . . . 480 6.56.3.25 Maximum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 6.56.3.26 Minimum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 6.56.3.27 Pairwise add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 6.56.3.28 Pairwise add, single opcode widen and accumulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 6.56.3.29 Folding maximum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 viii Using the GNU Compiler Collection (GCC) 6.56.3.30 Folding minimum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 6.56.3.31 Reciprocal step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 6.56.3.32 Vector shift left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 6.56.3.33 Vector shift left by constant . . . . . . . . . . . . . . . . . . . . . . 488 6.56.3.34 Vector shift right by constant . . . . . . . . . . . . . . . . . . . . 490 6.56.3.35 Vector shift right by constant and accumulate . . . . 493 6.56.3.36 Vector shift right and insert . . . . . . . . . . . . . . . . . . . . . . 494 6.56.3.37 Vector shift left and insert . . . . . . . . . . . . . . . . . . . . . . . 495 6.56.3.38 Absolute value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 6.56.3.39 Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 6.56.3.40 Bitwise not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498 6.56.3.41 Count leading sign bits. . . . . . . . . . . . . . . . . . . . . . . . . . . 498 6.56.3.42 Count leading zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 6.56.3.43 Count number of set bits . . . . . . . . . . . . . . . . . . . . . . . . . 499 6.56.3.44 Reciprocal estimate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 6.56.3.45 Reciprocal square-root estimate . . . . . . . . . . . . . . . . . . 500 6.56.3.46 Get lanes from a vector . . . . . . . . . . . . . . . . . . . . . . . . . . 500 6.56.3.47 Set lanes in a vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501 6.56.3.48 Create vector from literal bit pattern . . . . . . . . . . . . . 502 6.56.3.49 Set all lanes to the same value. . . . . . . . . . . . . . . . . . . . 503 6.56.3.50 Combining vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 6.56.3.51 Splitting vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 6.56.3.52 Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 6.56.3.53 Move, single opcode narrowing . . . . . . . . . . . . . . . . . . . 507 6.56.3.54 Move, single opcode long . . . . . . . . . . . . . . . . . . . . . . . . . 508 6.56.3.55 Table lookup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 6.56.3.56 Extended table lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 6.56.3.57 Multiply, lane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510 6.56.3.58 Long multiply, lane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510 6.56.3.59 Saturating doubling long multiply, lane . . . . . . . . . . . 510 6.56.3.60 Saturating doubling multiply high, lane . . . . . . . . . . 511 6.56.3.61 Multiply-accumulate, lane . . . . . . . . . . . . . . . . . . . . . . . . 511 6.56.3.62 Multiply-subtract, lane . . . . . . . . . . . . . . . . . . . . . . . . . . . 512 6.56.3.63 Vector multiply by scalar. . . . . . . . . . . . . . . . . . . . . . . . . 513 6.56.3.64 Vector long multiply by scalar . . . . . . . . . . . . . . . . . . . . 513 6.56.3.65 Vector saturating doubling long multiply by scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513 6.56.3.66 Vector saturating doubling multiply high by scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 6.56.3.67 Vector multiply-accumulate by scalar . . . . . . . . . . . . . 514 6.56.3.68 Vector multiply-subtract by scalar . . . . . . . . . . . . . . . . 515 6.56.3.69 Vector extract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516 6.56.3.70 Reverse elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 6.56.3.71 Bit selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 6.56.3.72 Transpose elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 6.56.3.73 Zip elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 6.56.3.74 Unzip elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 6.56.3.75 Element/structure loads, VLD1 variants. . . . . . . . . . 523 [...]... 22 Using the GNU Compiler Collection (GCC) -meb -mel -mnhwloop -muls -mmac -mscore5 -mscore5u -mscore7 -mscore7d SH Options -m1 -m2 -m2 e -m2 a-nofpu -m2 a-single-only -m2 a-single -m2 a -m3 -m3 e -m4 -nofpu -m4 -single-only -m4 -single -m4 -m4 a-nofpu -m4 a-single-only -m4 a-single -m4 a -m4 al -m5 -6 4media -m5 -6 4media-nofpu -m5 -3 2media -m5 -3 2media-nofpu -m5 -compact -m5 -compact-nofpu -mb -ml -mdalign -mrelax -mbigtable... -mno-dsp -mdspr2 -mno-dspr2 -mmcu -mmno-mcu -mfpu=fpu-type -msmartmips -mno-smartmips -mpaired-single -mno-paired-single -mdmx -mno-mdmx -mips3d -mno-mips3d -mmt -mno-mt -mllsc -mno-llsc -mlong 64 -mlong32 -msym32 -mno-sym32 -Gnum -mlocal-sdata -mno-local-sdata -mextern-sdata -mno-extern-sdata -mgpopt -mno-gopt -membedded-data -mno-embedded-data -muninit-const-in-rodata -mno-uninit-const-in-rodata -mcode-readable=setting... -mhard-float -msoft-float -malloc-cc -mfixed-cc -mdword -mno-dword -mdouble -mno-double -mmedia -mno-media -mmuladd -mno-muladd -mfdpic -minline-plt -mgprel-ro -multilib-library-pic -mlinked-fp -mlong-calls -malign-labels -mlibrary-pic -macc -4 -macc -8 -mpack -mno-pack -mno-eflags -mcond-move -mno-cond-move -moptimize-membar -mno-optimize-membar -mscc -mno-scc -mcond-exec -mno-cond-exec -mvliw-branch -mno-vliw-branch... Options -mcpu=cpu-type -mtune=cpu-type -mcmodel=code-model -mpowerpc 64 -maltivec -mno-altivec -mpowerpc-gpopt -mno-powerpc-gpopt -mpowerpc-gfxopt -mno-powerpc-gfxopt -mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb -mpopcntd -mno-popcntd -mfprnd -mno-fprnd -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp -mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc -m6 4 -m3 2 -mxl-compat -mno-xl-compat -mpe... -m6 80 2 0 -4 0 -m6 80 2 0-6 0 m6 80 30 -m6 8 040 -m6 80 60 -mcpu32 -m5 200 -m5 206e -m5 28x -m5 307 -m5 40 7 -mcfv4e -mbitfield -mno-bitfield -mc 680 00 -mc 680 20 -mnobitfield -mrtd -mno-rtd -mdiv -mno-div -mshort -mno-short -mhard-float -m6 88 81 -msoft-float -mpcrel -malign-int -mstrict-align -msep-data -mno-sep-data -mshared-library-id=n -mid-shared-library -mno-id-shared-library -mxgot -mno-xgot MCore Options -mhardlit -mno-hardlit... -meb -mel -mio-volatile -ml -mleadz -mm -mminmax -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf -mtiny=n MicroBlaze Options -msoft-float -mhard-float -msmall-divides -mcpu=cpu -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt -mbig-endian -mlittle-endian -mxl-reorder... -mxl-reorder -mxl-mode-app-model MIPS Options -EL -EB -march=arch -mtune=arch -mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 -mips 64 -mips64r2 -mips16 -mno-mips16 -mflip-mips16 -minterlink-mips16 -mno-interlink-mips16 -mabi=abi -mabicalls -mno-abicalls -mshared -mno-shared -mplt -mno-plt -mxgot -mno-xgot -mgp32 -mgp 64 -mfp32 -mfp 64 -mhard-float -msoft-float -mno-float -msingle-float -mdouble-float -mdsp... -mno-fix-r 440 0 -mfix-r10000 -mno-fix-r10000 -mfix-vr 412 0 -mno-fix-vr 412 0 -mfix-vr 413 0 -mno-fix-vr 413 0 -mfix-sb1 -mno-fix-sb1 -mflush-func=func -mno-flush-func -mbranch-cost=num -mbranch-likely -mno-branch-likely -mfp-exceptions -mno-fp-exceptions -mvr 413 0-align -mno-vr 413 0-align -msynci -mno-synci -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address MMIX Options -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon... -msse4.2 -msse4 -mavx -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -msse4a -m3 dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt 17 18 Using the GNU Compiler Collection (GCC) -mbmi2 -mrtm -mlwp -mthreads -mno-align-stringops -minline-all-stringops -minline-stringops-dynamically -mstringop-strategy=alg -mpush-args -maccumulate-outgoing-args -m1 28bit-long-double -m9 6bit-long-double -mlong-double- 64. .. -mhard-quad-float -msoft-quad-float -mstack-bias -mno-stack-bias -munaligned-doubles -mno-unaligned-doubles -mv8plus -mno-v8plus -mvis -mno-vis -mvis2 -mno-vis2 -mvis3 -mno-vis3 -mcbcond -mno-cbcond -mfmaf -mno-fmaf -mpopc -mno-popc -mfix-at697f SPU Options -mwarn-reloc -merror-reloc -msafe-dma -munsafe-dma -mbranch-hints -msmall-mem -mlarge-mem -mstdmain -mfixed-range=register-range -mea32 -mea 64 -maddress-space-conversion . Using the GNU Compiler Collection For gcc version 4. 8. 1 (GCC) Richard M. Stallman and the GCC Developer Community Published by: GNU Press Website:. 61 7-5 4 2-5 942 Boston, MA 0 211 0 -1 3 01 USA Fax 61 7-5 4 2-2 652 Last printed October 2003 for GCC 3.3 .1. Printed copies are available for $45 each. Copyright c  1 98 8-2 013 Free

Ngày đăng: 19/03/2014, 14:12

Từ khóa liên quan

Mục lục

  • Introduction

  • Programming Languages Supported by GCC

  • Language Standards Supported by GCC

    • C language

    • C++ language

    • Objective-C and Objective-C++ languages

    • Go language

    • References for other languages

    • GCC Command Options

      • Option Summary

      • Options Controlling the Kind of Output

      • Compiling C++ Programs

      • Options Controlling C Dialect

      • Options Controlling C++ Dialect

      • Options Controlling Objective-C and Objective-C++ Dialects

      • Options to Control Diagnostic Messages Formatting

      • Options to Request or Suppress Warnings

      • Options for Debugging Your Program or GCC

      • Options That Control Optimization

      • Options Controlling the Preprocessor

      • Passing Options to the Assembler

      • Options for Linking

Tài liệu cùng người dùng

Tài liệu liên quan