ebook img

also in PDF - GCC, the GNU Compiler Collection PDF

796 Pages·2013·3.1 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview also in PDF - GCC, the GNU Compiler Collection

Using the GNU Compiler Collection For gcc version 4.8.2 (GCC) Richard M. Stallman and the GCC Developer Community Published by: GNU Press Website: www.gnupress.org a division of the General: [email protected] Free Software Foundation Orders: [email protected] 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 (cid:13)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..................... 315 5 C++ Implementation-defined behavior.................. 323 6 Extensions to the C Language Family................... 325 7 Extensions to the C++ Language...................... 647 8 GNU Objective-C features............................ 661 9 Binary Compatibility ................................ 677 10 gcov—a Test Coverage Program ....................... 681 11 Known Causes of Trouble with GCC.................... 689 12 Reporting Bugs..................................... 705 13 How To Get Help with GCC .......................... 707 14 Contributing to GCC Development..................... 709 Funding Free Software................................... 711 The GNU Project and GNU/Linux......................... 713 GNU General Public License.............................. 715 GNU Free Documentation License ......................... 727 Contributors to GCC.................................... 735 Option Index .......................................... 751 Keyword Index......................................... 769 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 .......................................... 272 3.17.36 S/390 and zSeries Options............................ 274 3.17.37 Score Options......................................... 277 3.17.38 SH Options........................................... 278 3.17.39 Solaris 2 Options ..................................... 285 3.17.40 SPARC Options...................................... 285 3.17.41 SPU Options......................................... 290 3.17.42 Options for System V................................. 292 3.17.43 TILE-Gx Options..................................... 292 3.17.44 TILEPro Options..................................... 293 3.17.45 V850 Options......................................... 293 3.17.46 VAX Options......................................... 296 3.17.47 VMS Options......................................... 296 3.17.48 VxWorks Options..................................... 296 3.17.49 x86-64 Options ....................................... 297 3.17.50 Xstormy16 Options................................... 297 3.17.51 Xtensa Options....................................... 297 3.17.52 zSeries Options....................................... 298 3.18 Options for Code Generation Conventions................... 298 3.19 Environment Variables Affecting GCC ...................... 309 v 3.20 Using Precompiled Headers................................. 311 4 C Implementation-defined behavior ........ 315 4.1 Translation.................................................. 315 4.2 Environment................................................. 315 4.3 Identifiers.................................................... 315 4.4 Characters................................................... 316 4.5 Integers...................................................... 316 4.6 Floating point............................................... 317 4.7 Arrays and pointers.......................................... 318 4.8 Hints........................................................ 319 4.9 Structures, unions, enumerations, and bit-fields............... 319 4.10 Qualifiers................................................... 320 4.11 Declarators................................................. 320 4.12 Statements................................................. 320 4.13 Preprocessing directives..................................... 320 4.14 Library functions........................................... 321 4.15 Architecture................................................ 321 4.16 Locale-specific behavior..................................... 321 5 C++ Implementation-defined behavior .... 323 5.1 Conditionally-supported behavior............................ 323 5.2 Exception handling.......................................... 323 6 Extensions to the C Language Family...... 325 6.1 Statements and Declarations in Expressions.................. 325 6.2 Locally Declared Labels...................................... 326 6.3 Labels as Values............................................. 327 6.4 Nested Functions ............................................ 328 6.5 Constructing Function Calls.................................. 330 6.6 Referring to a Type with typeof............................. 332 6.7 Conditionals with Omitted Operands......................... 333 6.8 128-bit integers.............................................. 334 6.9 Double-Word Integers........................................ 334 6.10 Complex Numbers.......................................... 334 6.11 Additional Floating Types.................................. 335 6.12 Half-Precision Floating Point ............................... 335 6.13 Decimal Floating Types..................................... 336 6.14 Hex Floats.................................................. 336 6.15 Fixed-Point Types.......................................... 337 6.16 Named Address Spaces ..................................... 338 6.16.1 AVR Named Address Spaces........................... 338 6.16.2 M32C Named Address Spaces.......................... 340 6.16.3 RL78 Named Address Spaces........................... 340 6.16.4 SPU Named Address Spaces ........................... 340 6.17 Arrays of Length Zero...................................... 340 6.18 Structures With No Members............................... 341 vi Using the GNU Compiler Collection (GCC) 6.19 Arrays of Variable Length................................... 342 6.20 Macros with a Variable Number of Arguments............... 343 6.21 Slightly Looser Rules for Escaped Newlines.................. 343 6.22 Non-Lvalue Arrays May Have Subscripts.................... 344 6.23 Arithmetic on void- and Function-Pointers.................. 344 6.24 Non-Constant Initializers ................................... 344 6.25 Compound Literals......................................... 344 6.26 Designated Initializers...................................... 345 6.27 Case Ranges................................................ 347 6.28 Cast to a Union Type....................................... 347 6.29 Mixed Declarations and Code............................... 348 6.30 Declaring Attributes of Functions........................... 348 6.31 Attribute Syntax ........................................... 378 6.32 Prototypes and Old-Style Function Definitions .............. 381 6.33 C++ Style Comments...................................... 382 6.34 Dollar Signs in Identifier Names............................. 382 6.35 The Character ESC in Constants ............................ 382 6.36 Specifying Attributes of Variables........................... 382 6.36.1 AVR Variable Attributes............................... 387 6.36.2 Blackfin Variable Attributes............................ 387 6.36.3 M32R/D Variable Attributes........................... 387 6.36.4 MeP Variable Attributes............................... 388 6.36.5 i386 Variable Attributes................................ 388 6.36.6 PowerPC Variable Attributes........................... 390 6.36.7 SPU Variable Attributes............................... 390 6.36.8 Xstormy16 Variable Attributes......................... 390 6.37 Specifying Attributes of Types.............................. 391 6.37.1 ARM Type Attributes................................. 395 6.37.2 MeP Type Attributes.................................. 395 6.37.3 i386 Type Attributes................................... 395 6.37.4 PowerPC Type Attributes.............................. 396 6.37.5 SPU Type Attributes.................................. 396 6.38 Inquiring on Alignment of Types or Variables ............... 396 6.39 An Inline Function is As Fast As a Macro................... 397 6.40 When is a Volatile Object Accessed?........................ 398 6.41 Assembler Instructions with C Expression Operands......... 399 6.41.1 Size of an asm.......................................... 405 6.41.2 i386 floating-point asm operands....................... 405 6.42 Constraints for asm Operands............................... 407 6.42.1 Simple Constraints..................................... 407 6.42.2 Multiple Alternative Constraints....................... 409 6.42.3 Constraint Modifier Characters......................... 410 6.42.4 Constraints for Particular Machines.................... 411 6.43 Controlling Names Used in Assembler Code................. 435 6.44 Variables in Specified Registers.............................. 435 6.44.1 Defining Global Register Variables ..................... 436 6.44.2 Specifying Registers for Local Variables ................ 437 6.45 Alternate Keywords......................................... 438 vii 6.46 Incomplete enum Types..................................... 438 6.47 Function Names as Strings.................................. 438 6.48 Getting the Return or Frame Address of a Function......... 439 6.49 Using Vector Instructions through Built-in Functions........ 440 6.50 Offsetof..................................................... 442 6.51 Legacy sync Built-in Functions for Atomic Memory Access .............................................................. 443 6.52 Built-in functions for memory model aware atomic operations .............................................................. 445 6.53 x86 specific memory model extensions for transactional memory .............................................................. 449 6.54 Object Size Checking Built-in Functions..................... 449 6.55 Other Built-in Functions Provided by GCC ................. 451 6.56 Built-in Functions Specific to Particular Target Machines.... 460 6.56.1 Alpha Built-in Functions............................... 460 6.56.2 ARM iWMMXt Built-in Functions..................... 461 6.56.3 ARM NEON Intrinsics................................. 464 6.56.3.1 Addition.......................................... 464 6.56.3.2 Multiplication..................................... 468 6.56.3.3 Multiply-accumulate.............................. 469 6.56.3.4 Multiply-subtract................................. 470 6.56.3.5 Fused-multiply-accumulate........................ 472 6.56.3.6 Fused-multiply-subtract........................... 472 6.56.3.7 Round to integral (to nearest, ties to even)........ 472 6.56.3.8 Round to integral (to nearest, ties away from zero) ........................................................ 472 6.56.3.9 Round to integral (towards +Inf).................. 472 6.56.3.10 Round to integral (towards -Inf) ................. 472 6.56.3.11 Round to integral (towards 0).................... 472 6.56.3.12 Subtraction...................................... 472 6.56.3.13 Comparison (equal-to)........................... 476 6.56.3.14 Comparison (greater-than-or-equal-to)............ 477 6.56.3.15 Comparison (less-than-or-equal-to)............... 477 6.56.3.16 Comparison (greater-than)....................... 478 6.56.3.17 Comparison (less-than)........................... 479 6.56.3.18 Comparison (absolute greater-than-or-equal-to)... 479 6.56.3.19 Comparison (absolute less-than-or-equal-to)...... 480 6.56.3.20 Comparison (absolute greater-than).............. 480 6.56.3.21 Comparison (absolute less-than).................. 480 6.56.3.22 Test bits......................................... 480 6.56.3.23 Absolute difference............................... 481 6.56.3.24 Absolute difference and accumulate............... 482 6.56.3.25 Maximum........................................ 483 6.56.3.26 Minimum........................................ 483 6.56.3.27 Pairwise add..................................... 484 6.56.3.28 Pairwise add, single opcode widen and accumulate ........................................................ 485 6.56.3.29 Folding maximum................................ 485 viii Using the GNU Compiler Collection (GCC) 6.56.3.30 Folding minimum................................ 486 6.56.3.31 Reciprocal step .................................. 486 6.56.3.32 Vector shift left.................................. 486 6.56.3.33 Vector shift left by constant...................... 490 6.56.3.34 Vector shift right by constant .................... 492 6.56.3.35 Vector shift right by constant and accumulate.... 495 6.56.3.36 Vector shift right and insert...................... 496 6.56.3.37 Vector shift left and insert ....................... 497 6.56.3.38 Absolute value................................... 498 6.56.3.39 Negation......................................... 499 6.56.3.40 Bitwise not...................................... 500 6.56.3.41 Count leading sign bits........................... 500 6.56.3.42 Count leading zeros.............................. 501 6.56.3.43 Count number of set bits......................... 501 6.56.3.44 Reciprocal estimate.............................. 502 6.56.3.45 Reciprocal square-root estimate.................. 502 6.56.3.46 Get lanes from a vector.......................... 502 6.56.3.47 Set lanes in a vector ............................. 503 6.56.3.48 Create vector from literal bit pattern............. 504 6.56.3.49 Set all lanes to the same value.................... 505 6.56.3.50 Combining vectors............................... 508 6.56.3.51 Splitting vectors................................. 508 6.56.3.52 Conversions...................................... 509 6.56.3.53 Move, single opcode narrowing................... 509 6.56.3.54 Move, single opcode long......................... 510 6.56.3.55 Table lookup..................................... 511 6.56.3.56 Extended table lookup........................... 511 6.56.3.57 Multiply, lane.................................... 512 6.56.3.58 Long multiply, lane .............................. 512 6.56.3.59 Saturating doubling long multiply, lane........... 512 6.56.3.60 Saturating doubling multiply high, lane .......... 513 6.56.3.61 Multiply-accumulate, lane........................ 513 6.56.3.62 Multiply-subtract, lane........................... 514 6.56.3.63 Vector multiply by scalar......................... 515 6.56.3.64 Vector long multiply by scalar.................... 515 6.56.3.65 Vector saturating doubling long multiply by scalar ........................................................ 515 6.56.3.66 Vector saturating doubling multiply high by scalar ........................................................ 516 6.56.3.67 Vector multiply-accumulate by scalar............. 516 6.56.3.68 Vector multiply-subtract by scalar................ 517 6.56.3.69 Vector extract ................................... 518 6.56.3.70 Reverse elements................................. 519 6.56.3.71 Bit selection..................................... 520 6.56.3.72 Transpose elements .............................. 522 6.56.3.73 Zip elements..................................... 523 6.56.3.74 Unzip elements .................................. 524 6.56.3.75 Element/structure loads, VLD1 variants.......... 525

Description:
8.1.1 Modern GNU Objective-C runtime API .. 661. 8.1.2 Traditional GNU Objective-C runtime API .. 662. 8.2 +load: Executing code before main .
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.