1This is doc/gcc.info, produced by makeinfo version 4.8 from 2/scratch/mitchell/gcc-releases/gcc-4.2.1/gcc-4.2.1/gcc/doc/gcc.texi. 3 4 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 51999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 6 7 Permission is granted to copy, distribute and/or modify this document 8under the terms of the GNU Free Documentation License, Version 1.2 or 9any later version published by the Free Software Foundation; with the 10Invariant Sections being "GNU General Public License" and "Funding Free 11Software", the Front-Cover texts being (a) (see below), and with the 12Back-Cover Texts being (b) (see below). A copy of the license is 13included in the section entitled "GNU Free Documentation License". 14 15 (a) The FSF's Front-Cover Text is: 16 17 A GNU Manual 18 19 (b) The FSF's Back-Cover Text is: 20 21 You have freedom to copy and modify this GNU Manual, like GNU 22software. Copies published by the Free Software Foundation raise 23funds for GNU development. 24 25INFO-DIR-SECTION Software development 26START-INFO-DIR-ENTRY 27* gcc: (gcc). The GNU Compiler Collection. 28END-INFO-DIR-ENTRY 29 This file documents the use of the GNU compilers. 30 31 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 321999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 33 34 Permission is granted to copy, distribute and/or modify this document 35under the terms of the GNU Free Documentation License, Version 1.2 or 36any later version published by the Free Software Foundation; with the 37Invariant Sections being "GNU General Public License" and "Funding Free 38Software", the Front-Cover texts being (a) (see below), and with the 39Back-Cover Texts being (b) (see below). A copy of the license is 40included in the section entitled "GNU Free Documentation License". 41 42 (a) The FSF's Front-Cover Text is: 43 44 A GNU Manual 45 46 (b) The FSF's Back-Cover Text is: 47 48 You have freedom to copy and modify this GNU Manual, like GNU 49software. Copies published by the Free Software Foundation raise 50funds for GNU development. 51 52 53 54File: gcc.info, Node: Top, Next: G++ and GCC, Up: (DIR) 55 56Introduction 57************ 58 59This manual documents how to use the GNU compilers, as well as their 60features and incompatibilities, and how to report bugs. It corresponds 61to GCC version 4.2.1. The internals of the GNU compilers, including 62how to port them to new targets and some information about how to write 63front ends for new languages, are documented in a separate manual. 64*Note Introduction: (gccint)Top. 65 66* Menu: 67 68* G++ and GCC:: You can compile C or C++ programs. 69* Standards:: Language standards supported by GCC. 70* Invoking GCC:: Command options supported by `gcc'. 71* C Implementation:: How GCC implements the ISO C specification. 72* C Extensions:: GNU extensions to the C language family. 73* C++ Extensions:: GNU extensions to the C++ language. 74* Objective-C:: GNU Objective-C runtime features. 75* Compatibility:: Binary Compatibility 76* Gcov:: `gcov'---a test coverage program. 77* Trouble:: If you have trouble using GCC. 78* Bugs:: How, why and where to report bugs. 79* Service:: How to find suppliers of support for GCC. 80* Contributing:: How to contribute to testing and developing GCC. 81 82* Funding:: How to help assure funding for free software. 83* GNU Project:: The GNU Project and GNU/Linux. 84 85* Copying:: GNU General Public License says 86 how you can copy and share GCC. 87* GNU Free Documentation License:: How you can copy and share this manual. 88* Contributors:: People who have contributed to GCC. 89 90* Option Index:: Index to command line options. 91* Keyword Index:: Index of concepts and symbol names. 92 93 94File: gcc.info, Node: G++ and GCC, Next: Standards, Prev: Top, Up: Top 95 961 Programming Languages Supported by GCC 97**************************************** 98 99GCC stands for "GNU Compiler Collection". GCC is an integrated 100distribution of compilers for several major programming languages. 101These languages currently include C, C++, Objective-C, Objective-C++, 102Java, Fortran, and Ada. 103 104 The abbreviation "GCC" has multiple meanings in common use. The 105current official meaning is "GNU Compiler Collection", which refers 106generically to the complete suite of tools. The name historically stood 107for "GNU C Compiler", and this usage is still common when the emphasis 108is on compiling C programs. Finally, the name is also used when 109speaking of the "language-independent" component of GCC: code shared 110among the compilers for all supported languages. 111 112 The language-independent component of GCC includes the majority of the 113optimizers, as well as the "back ends" that generate machine code for 114various processors. 115 116 The part of a compiler that is specific to a particular language is 117called the "front end". In addition to the front ends that are 118integrated components of GCC, there are several other front ends that 119are maintained separately. These support languages such as Pascal, 120Mercury, and COBOL. To use these, they must be built together with GCC 121proper. 122 123 Most of the compilers for languages other than C have their own names. 124The C++ compiler is G++, the Ada compiler is GNAT, and so on. When we 125talk about compiling one of those languages, we might refer to that 126compiler by its own name, or as GCC. Either is correct. 127 128 Historically, compilers for many languages, including C++ and Fortran, 129have been implemented as "preprocessors" which emit another high level 130language such as C. None of the compilers included in GCC are 131implemented this way; they all generate machine code directly. This 132sort of preprocessor should not be confused with the "C preprocessor", 133which is an integral feature of the C, C++, Objective-C and 134Objective-C++ languages. 135 136 137File: gcc.info, Node: Standards, Next: Invoking GCC, Prev: G++ and GCC, Up: Top 138 1392 Language Standards Supported by GCC 140************************************* 141 142For each language compiled by GCC for which there is a standard, GCC 143attempts to follow one or more versions of that standard, possibly with 144some exceptions, and possibly with some extensions. 145 146 GCC supports three versions of the C standard, although support for 147the most recent version is not yet complete. 148 149 The original ANSI C standard (X3.159-1989) was ratified in 1989 and 150published in 1990. This standard was ratified as an ISO standard 151(ISO/IEC 9899:1990) later in 1990. There were no technical differences 152between these publications, although the sections of the ANSI standard 153were renumbered and became clauses in the ISO standard. This standard, 154in both its forms, is commonly known as "C89", or occasionally as 155"C90", from the dates of ratification. The ANSI standard, but not the 156ISO standard, also came with a Rationale document. To select this 157standard in GCC, use one of the options `-ansi', `-std=c89' or 158`-std=iso9899:1990'; to obtain all the diagnostics required by the 159standard, you should also specify `-pedantic' (or `-pedantic-errors' if 160you want them to be errors rather than warnings). *Note Options 161Controlling C Dialect: C Dialect Options. 162 163 Errors in the 1990 ISO C standard were corrected in two Technical 164Corrigenda published in 1994 and 1996. GCC does not support the 165uncorrected version. 166 167 An amendment to the 1990 standard was published in 1995. This 168amendment added digraphs and `__STDC_VERSION__' to the language, but 169otherwise concerned the library. This amendment is commonly known as 170"AMD1"; the amended standard is sometimes known as "C94" or "C95". To 171select this standard in GCC, use the option `-std=iso9899:199409' 172(with, as for other standard versions, `-pedantic' to receive all 173required diagnostics). 174 175 A new edition of the ISO C standard was published in 1999 as ISO/IEC 1769899:1999, and is commonly known as "C99". GCC has incomplete support 177for this standard version; see 178`http://gcc.gnu.org/gcc-4.2/c99status.html' for details. To select this 179standard, use `-std=c99' or `-std=iso9899:1999'. (While in 180development, drafts of this standard version were referred to as "C9X".) 181 182 Errors in the 1999 ISO C standard were corrected in two Technical 183Corrigenda published in 2001 and 2004. GCC does not support the 184uncorrected version. 185 186 By default, GCC provides some extensions to the C language that on 187rare occasions conflict with the C standard. *Note Extensions to the C 188Language Family: C Extensions. Use of the `-std' options listed above 189will disable these extensions where they conflict with the C standard 190version selected. You may also select an extended version of the C 191language explicitly with `-std=gnu89' (for C89 with GNU extensions) or 192`-std=gnu99' (for C99 with GNU extensions). The default, if no C 193language dialect options are given, is `-std=gnu89'; this will change to 194`-std=gnu99' in some future release when the C99 support is complete. 195Some features that are part of the C99 standard are accepted as 196extensions in C89 mode. 197 198 The ISO C standard defines (in clause 4) two classes of conforming 199implementation. A "conforming hosted implementation" supports the 200whole standard including all the library facilities; a "conforming 201freestanding implementation" is only required to provide certain 202library facilities: those in `<float.h>', `<limits.h>', `<stdarg.h>', 203and `<stddef.h>'; since AMD1, also those in `<iso646.h>'; and in C99, 204also those in `<stdbool.h>' and `<stdint.h>'. In addition, complex 205types, added in C99, are not required for freestanding implementations. 206The standard also defines two environments for programs, a 207"freestanding environment", required of all implementations and which 208may not have library facilities beyond those required of freestanding 209implementations, where the handling of program startup and termination 210are implementation-defined, and a "hosted environment", which is not 211required, in which all the library facilities are provided and startup 212is through a function `int main (void)' or `int main (int, char *[])'. 213An OS kernel would be a freestanding environment; a program using the 214facilities of an operating system would normally be in a hosted 215implementation. 216 217 GCC aims towards being usable as a conforming freestanding 218implementation, or as the compiler for a conforming hosted 219implementation. By default, it will act as the compiler for a hosted 220implementation, defining `__STDC_HOSTED__' as `1' and presuming that 221when the names of ISO C functions are used, they have the semantics 222defined in the standard. To make it act as a conforming freestanding 223implementation for a freestanding environment, use the option 224`-ffreestanding'; it will then define `__STDC_HOSTED__' to `0' and not 225make assumptions about the meanings of function names from the standard 226library, with exceptions noted below. To build an OS kernel, you may 227well still need to make your own arrangements for linking and startup. 228*Note Options Controlling C Dialect: C Dialect Options. 229 230 GCC does not provide the library facilities required only of hosted 231implementations, nor yet all the facilities required by C99 of 232freestanding implementations; to use the facilities of a hosted 233environment, you will need to find them elsewhere (for example, in the 234GNU C library). *Note Standard Libraries: Standard Libraries. 235 236 Most of the compiler support routines used by GCC are present in 237`libgcc', but there are a few exceptions. GCC requires the 238freestanding environment provide `memcpy', `memmove', `memset' and 239`memcmp'. Finally, if `__builtin_trap' is used, and the target does 240not implement the `trap' pattern, then GCC will emit a call to `abort'. 241 242 For references to Technical Corrigenda, Rationale documents and 243information concerning the history of C that is available online, see 244`http://gcc.gnu.org/readings.html' 245 246 There is no formal written standard for Objective-C or Objective-C++. 247The most authoritative manual is "Object-Oriented Programming and the 248Objective-C Language", available at a number of web sites: 249 250 * 251 `http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/' 252 is a recent (and periodically updated) version; 253 254 * `http://www.toodarkpark.org/computers/objc/' is an older example; 255 256 * `http://www.gnustep.org' and `http://gcc.gnu.org/readings.html' 257 have additional useful information. 258 259 There is no standard for treelang, which is a sample language front end 260for GCC. Its only purpose is as a sample for people wishing to write a 261new language for GCC. The language is documented in 262`gcc/treelang/treelang.texi' which can be turned into info or HTML 263format. 264 265 *Note GNAT Reference Manual: (gnat_rm)Top, for information on standard 266conformance and compatibility of the Ada compiler. 267 268 *Note Standards: (gfortran)Standards, for details of standards 269supported by GNU Fortran. 270 271 *Note Compatibility with the Java Platform: (gcj)Compatibility, for 272details of compatibility between `gcj' and the Java Platform. 273 274 275File: gcc.info, Node: Invoking GCC, Next: C Implementation, Prev: Standards, Up: Top 276 2773 GCC Command Options 278********************* 279 280When you invoke GCC, it normally does preprocessing, compilation, 281assembly and linking. The "overall options" allow you to stop this 282process at an intermediate stage. For example, the `-c' option says 283not to run the linker. Then the output consists of object files output 284by the assembler. 285 286 Other options are passed on to one stage of processing. Some options 287control the preprocessor and others the compiler itself. Yet other 288options control the assembler and linker; most of these are not 289documented here, since you rarely need to use any of them. 290 291 Most of the command line options that you can use with GCC are useful 292for C programs; when an option is only useful with another language 293(usually C++), the explanation says so explicitly. If the description 294for a particular option does not mention a source language, you can use 295that option with all supported languages. 296 297 *Note Compiling C++ Programs: Invoking G++, for a summary of special 298options for compiling C++ programs. 299 300 The `gcc' program accepts options and file names as operands. Many 301options have multi-letter names; therefore multiple single-letter 302options may _not_ be grouped: `-dr' is very different from `-d -r'. 303 304 You can mix options and other arguments. For the most part, the order 305you use doesn't matter. Order does matter when you use several options 306of the same kind; for example, if you specify `-L' more than once, the 307directories are searched in the order specified. 308 309 Many options have long names starting with `-f' or with `-W'--for 310example, `-fmove-loop-invariants', `-Wformat' and so on. Most of these 311have both positive and negative forms; the negative form of `-ffoo' 312would be `-fno-foo'. This manual documents only one of these two 313forms, whichever one is not the default. 314 315 *Note Option Index::, for an index to GCC's options. 316 317* Menu: 318 319* Option Summary:: Brief list of all options, without explanations. 320* Overall Options:: Controlling the kind of output: 321 an executable, object files, assembler files, 322 or preprocessed source. 323* Invoking G++:: Compiling C++ programs. 324* C Dialect Options:: Controlling the variant of C language compiled. 325* C++ Dialect Options:: Variations on C++. 326* Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C 327 and Objective-C++. 328* Language Independent Options:: Controlling how diagnostics should be 329 formatted. 330* Warning Options:: How picky should the compiler be? 331* Debugging Options:: Symbol tables, measurements, and debugging dumps. 332* Optimize Options:: How much optimization? 333* Preprocessor Options:: Controlling header files and macro definitions. 334 Also, getting dependency information for Make. 335* Assembler Options:: Passing options to the assembler. 336* Link Options:: Specifying libraries and so on. 337* Directory Options:: Where to find header files and libraries. 338 Where to find the compiler executable files. 339* Spec Files:: How to pass switches to sub-processes. 340* Target Options:: Running a cross-compiler, or an old version of GCC. 341* Submodel Options:: Specifying minor hardware or convention variations, 342 such as 68010 vs 68020. 343* Code Gen Options:: Specifying conventions for function calls, data layout 344 and register usage. 345* Environment Variables:: Env vars that affect GCC. 346* Precompiled Headers:: Compiling a header once, and using it many times. 347* Running Protoize:: Automatically adding or removing function prototypes. 348 349 350File: gcc.info, Node: Option Summary, Next: Overall Options, Up: Invoking GCC 351 3523.1 Option Summary 353================== 354 355Here is a summary of all the options, grouped by type. Explanations are 356in the following sections. 357 358_Overall Options_ 359 *Note Options Controlling the Kind of Output: Overall Options. 360 -c -S -E -o FILE -combine -pipe -pass-exit-codes 361 -x LANGUAGE -v -### --help --target-help --version @FILE 362 363_C Language Options_ 364 *Note Options Controlling C Dialect: C Dialect Options. 365 -ansi -std=STANDARD -fgnu89-inline 366 -aux-info FILENAME 367 -fno-asm -fno-builtin -fno-builtin-FUNCTION 368 -fhosted -ffreestanding -fopenmp -fms-extensions 369 -trigraphs -no-integrated-cpp -traditional -traditional-cpp 370 -fallow-single-precision -fcond-mismatch 371 -fsigned-bitfields -fsigned-char 372 -funsigned-bitfields -funsigned-char 373 374_C++ Language Options_ 375 *Note Options Controlling C++ Dialect: C++ Dialect Options. 376 -fabi-version=N -fno-access-control -fcheck-new 377 -fconserve-space -ffriend-injection 378 -fno-elide-constructors 379 -fno-enforce-eh-specs 380 -ffor-scope -fno-for-scope -fno-gnu-keywords 381 -fno-implicit-templates 382 -fno-implicit-inline-templates 383 -fno-implement-inlines -fms-extensions 384 -fno-nonansi-builtins -fno-operator-names 385 -fno-optional-diags -fpermissive 386 -frepo -fno-rtti -fstats -ftemplate-depth-N 387 -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ 388 -fno-default-inline -fvisibility-inlines-hidden 389 -Wabi -Wctor-dtor-privacy 390 -Wnon-virtual-dtor -Wreorder 391 -Weffc++ -Wno-deprecated -Wstrict-null-sentinel 392 -Wno-non-template-friend -Wold-style-cast 393 -Woverloaded-virtual -Wno-pmf-conversions 394 -Wsign-promo 395 396_Objective-C and Objective-C++ Language Options_ 397 *Note Options Controlling Objective-C and Objective-C++ Dialects: 398 Objective-C and Objective-C++ Dialect Options. 399 -fconstant-string-class=CLASS-NAME 400 -fgnu-runtime -fnext-runtime 401 -fno-nil-receivers 402 -fobjc-call-cxx-cdtors 403 -fobjc-direct-dispatch 404 -fobjc-exceptions 405 -fobjc-gc 406 -freplace-objc-classes 407 -fzero-link 408 -gen-decls 409 -Wassign-intercept 410 -Wno-protocol -Wselector 411 -Wstrict-selector-match 412 -Wundeclared-selector 413 414_Language Independent Options_ 415 *Note Options to Control Diagnostic Messages Formatting: Language 416 Independent Options. 417 -fmessage-length=N 418 -fdiagnostics-show-location=[once|every-line] 419 -fdiagnostics-show-option 420 421_Warning Options_ 422 *Note Options to Request or Suppress Warnings: Warning Options. 423 -fsyntax-only -pedantic -pedantic-errors 424 -w -Wextra -Wall -Waddress -Waggregate-return -Wno-attributes 425 -Wbounded -Wc++-compat -Wcast-align -Wcast-qual -Wchar-subscripts 426 -Wcomment-Wconversion -Wno-deprecated-declarations 427 -Wdisabled-optimization -Wno-div-by-zero -Wno-endif-labels 428 -Werror -Werror=* -Werror-implicit-function-declaration 429 -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 430 -Wno-format-extra-args -Wformat-nonliteral 431 -Wformat-security -Wformat-y2k 432 -Wimplicit -Wimplicit-function-declaration -Wimplicit-int 433 -Wimport -Wno-import -Winit-self -Winline 434 -Wno-int-to-pointer-cast 435 -Wno-invalid-offsetof -Winvalid-pch 436 -Wlarger-than-LEN -Wunsafe-loop-optimizations -Wlong-long 437 -Wmain -Wmissing-braces -Wmissing-field-initializers 438 -Wmissing-format-attribute -Wmissing-include-dirs 439 -Wmissing-noreturn 440 -Wno-multichar -Wnonnull -Wno-overflow 441 -Woverlength-strings -Wpacked -Wpadded 442 -Wparentheses -Wpointer-arith -Wno-pointer-to-int-cast 443 -Wredundant-decls 444 -Wreturn-type -Wsequence-point -Wshadow 445 -Wsign-compare -Wstack-protector 446 -Wstrict-aliasing -Wstrict-aliasing=2 447 -Wstrict-overflow -Wstrict-overflow=N 448 -Wswitch -Wswitch-default -Wswitch-enum 449 -Wsystem-headers -Wtrigraphs -Wundef -Wuninitialized 450 -Wunknown-pragmas -Wno-pragmas -Wunreachable-code 451 -Wunused -Wunused-function -Wunused-label -Wunused-parameter 452 -Wunused-value -Wunused-variable -Wvariadic-macros 453 -Wvolatile-register-var -Wwrite-strings 454 455_C-only Warning Options_ 456 -Wbad-function-cast -Wmissing-declarations 457 -Wmissing-prototypes -Wnested-externs -Wold-style-definition 458 -Wstrict-prototypes -Wtraditional 459 -Wdeclaration-after-statement -Wpointer-sign 460 461_Debugging Options_ 462 *Note Options for Debugging Your Program or GCC: Debugging Options. 463 -dLETTERS -dumpspecs -dumpmachine -dumpversion 464 -fdump-noaddr -fdump-unnumbered -fdump-translation-unit[-N] 465 -fdump-class-hierarchy[-N] 466 -fdump-ipa-all -fdump-ipa-cgraph 467 -fdump-tree-all 468 -fdump-tree-original[-N] 469 -fdump-tree-optimized[-N] 470 -fdump-tree-inlined[-N] 471 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias 472 -fdump-tree-ch 473 -fdump-tree-ssa[-N] -fdump-tree-pre[-N] 474 -fdump-tree-ccp[-N] -fdump-tree-dce[-N] 475 -fdump-tree-gimple[-raw] -fdump-tree-mudflap[-N] 476 -fdump-tree-dom[-N] 477 -fdump-tree-dse[-N] 478 -fdump-tree-phiopt[-N] 479 -fdump-tree-forwprop[-N] 480 -fdump-tree-copyrename[-N] 481 -fdump-tree-nrv -fdump-tree-vect 482 -fdump-tree-sink 483 -fdump-tree-sra[-N] 484 -fdump-tree-salias 485 -fdump-tree-fre[-N] 486 -fdump-tree-vrp[-N] 487 -ftree-vectorizer-verbose=N 488 -fdump-tree-storeccp[-N] 489 -feliminate-dwarf2-dups -feliminate-unused-debug-types 490 -feliminate-unused-debug-symbols -femit-class-debug-always 491 -fmem-report -fprofile-arcs 492 -frandom-seed=STRING -fsched-verbose=N 493 -ftest-coverage -ftime-report -fvar-tracking 494 -g -gLEVEL -gcoff -gdwarf-2 495 -ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ 496 -p -pg -print-file-name=LIBRARY -print-libgcc-file-name 497 -print-multi-directory -print-multi-lib 498 -print-prog-name=PROGRAM -print-search-dirs -Q 499 -save-temps -time 500 501_Optimization Options_ 502 *Note Options that Control Optimization: Optimize Options. 503 -falign-functions=N -falign-jumps=N 504 -falign-labels=N -falign-loops=N 505 -fbounds-check -fmudflap -fmudflapth -fmudflapir 506 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize 507 -fbranch-target-load-optimize2 -fbtr-bb-exclusive 508 -fcaller-saves -fcprop-registers -fcse-follow-jumps 509 -fcse-skip-blocks -fcx-limited-range -fdata-sections 510 -fdelayed-branch -fdelete-null-pointer-checks -fearly-inlining 511 -fexpensive-optimizations -ffast-math -ffloat-store 512 -fforce-addr -ffunction-sections 513 -fgcse -fgcse-lm -fgcse-sm -fgcse-las -fgcse-after-reload 514 -fcrossjumping -fif-conversion -fif-conversion2 515 -finline-functions -finline-functions-called-once 516 -finline-limit=N -fkeep-inline-functions 517 -fkeep-static-consts -fmerge-constants -fmerge-all-constants 518 -fmodulo-sched -fno-branch-count-reg 519 -fno-default-inline -fno-defer-pop -fmove-loop-invariants 520 -fno-function-cse -fno-guess-branch-probability 521 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 522 -funsafe-math-optimizations -funsafe-loop-optimizations -ffinite-math-only 523 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss 524 -fomit-frame-pointer -foptimize-register-move 525 -foptimize-sibling-calls -fprefetch-loop-arrays 526 -fprofile-generate -fprofile-use 527 -fregmove -frename-registers 528 -freorder-blocks -freorder-blocks-and-partition -freorder-functions 529 -frerun-cse-after-loop 530 -frounding-math -frtl-abstract-sequences 531 -fschedule-insns -fschedule-insns2 532 -fno-sched-interblock -fno-sched-spec -fsched-spec-load 533 -fsched-spec-load-dangerous 534 -fsched-stalled-insns=N -fsched-stalled-insns-dep=N 535 -fsched2-use-superblocks 536 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops 537 -fsection-anchors -fsignaling-nans -fsingle-precision-constant 538 -fstack-protector -fstack-protector-all 539 -fstrict-aliasing -fstrict-overflow -ftracer -fthread-jumps 540 -funroll-all-loops -funroll-loops -fpeel-loops 541 -fsplit-ivs-in-unroller -funswitch-loops 542 -fvariable-expansion-in-unroller 543 -ftree-pre -ftree-ccp -ftree-dce -ftree-loop-optimize 544 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts 545 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink 546 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize 547 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb 548 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program 549 --param NAME=VALUE 550 -O -O0 -O1 -O2 -O3 -Os 551 552_Preprocessor Options_ 553 *Note Options Controlling the Preprocessor: Preprocessor Options. 554 -AQUESTION=ANSWER 555 -A-QUESTION[=ANSWER] 556 -C -dD -dI -dM -dN 557 -DMACRO[=DEFN] -E -H 558 -idirafter DIR 559 -include FILE -imacros FILE 560 -iprefix FILE -iwithprefix DIR 561 -iwithprefixbefore DIR -isystem DIR 562 -imultilib DIR -isysroot DIR 563 -M -MM -MF -MG -MP -MQ -MT -nostdinc 564 -P -fworking-directory -remap 565 -trigraphs -undef -UMACRO -Wp,OPTION 566 -Xpreprocessor OPTION 567 568_Assembler Option_ 569 *Note Passing Options to the Assembler: Assembler Options. 570 -Wa,OPTION -Xassembler OPTION 571 572_Linker Options_ 573 *Note Options for Linking: Link Options. 574 OBJECT-FILE-NAME -lLIBRARY 575 -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic 576 -s -static -static-libgcc -shared -shared-libgcc -symbolic 577 -Wl,OPTION -Xlinker OPTION 578 -u SYMBOL 579 580_Directory Options_ 581 *Note Options for Directory Search: Directory Options. 582 -BPREFIX -IDIR -iquoteDIR -LDIR 583 -specs=FILE -I- --sysroot=DIR 584 585_Target Options_ 586 *Note Target Options::. 587 -V VERSION -b MACHINE 588 589_Machine Dependent Options_ 590 *Note Hardware Models and Configurations: Submodel Options. 591 592 _ARC Options_ 593 -EB -EL 594 -mmangle-cpu -mcpu=CPU -mtext=TEXT-SECTION 595 -mdata=DATA-SECTION -mrodata=READONLY-DATA-SECTION 596 597 _ARM Options_ 598 -mapcs-frame -mno-apcs-frame 599 -mabi=NAME 600 -mapcs-stack-check -mno-apcs-stack-check 601 -mapcs-float -mno-apcs-float 602 -mapcs-reentrant -mno-apcs-reentrant 603 -msched-prolog -mno-sched-prolog 604 -mlittle-endian -mbig-endian -mwords-little-endian 605 -mfloat-abi=NAME -msoft-float -mhard-float -mfpe 606 -mthumb-interwork -mno-thumb-interwork 607 -mcpu=NAME -march=NAME -mfpu=NAME 608 -mstructure-size-boundary=N 609 -mabort-on-noreturn 610 -mlong-calls -mno-long-calls 611 -msingle-pic-base -mno-single-pic-base 612 -mpic-register=REG 613 -mnop-fun-dllimport 614 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns 615 -mpoke-function-name 616 -mthumb -marm 617 -mtpcs-frame -mtpcs-leaf-frame 618 -mcaller-super-interworking -mcallee-super-interworking 619 -mtp=NAME 620 621 _AVR Options_ 622 -mmcu=MCU -msize -minit-stack=N -mno-interrupts 623 -mcall-prologues -mno-tablejump -mtiny-stack -mint8 624 625 _Blackfin Options_ 626 -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer 627 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly 628 -mlow-64k -mno-low64k -mid-shared-library 629 -mno-id-shared-library -mshared-library-id=N 630 -mlong-calls -mno-long-calls 631 632 _CRIS Options_ 633 -mcpu=CPU -march=CPU -mtune=CPU 634 -mmax-stack-frame=N -melinux-stacksize=N 635 -metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects 636 -mstack-align -mdata-align -mconst-align 637 -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt 638 -melf -maout -melinux -mlinux -sim -sim2 639 -mmul-bug-workaround -mno-mul-bug-workaround 640 641 _CRX Options_ 642 -mmac -mpush-args 643 644 _Darwin Options_ 645 -all_load -allowable_client -arch -arch_errors_fatal 646 -arch_only -bind_at_load -bundle -bundle_loader 647 -client_name -compatibility_version -current_version 648 -dead_strip 649 -dependency-file -dylib_file -dylinker_install_name 650 -dynamic -dynamiclib -exported_symbols_list 651 -filelist -flat_namespace -force_cpusubtype_ALL 652 -force_flat_namespace -headerpad_max_install_names 653 -image_base -init -install_name -keep_private_externs 654 -multi_module -multiply_defined -multiply_defined_unused 655 -noall_load -no_dead_strip_inits_and_terms 656 -nofixprebinding -nomultidefs -noprebind -noseglinkedit 657 -pagezero_size -prebind -prebind_all_twolevel_modules 658 -private_bundle -read_only_relocs -sectalign 659 -sectobjectsymbols -whyload -seg1addr 660 -sectcreate -sectobjectsymbols -sectorder 661 -segaddr -segs_read_only_addr -segs_read_write_addr 662 -seg_addr_table -seg_addr_table_filename -seglinkedit 663 -segprot -segs_read_only_addr -segs_read_write_addr 664 -single_module -static -sub_library -sub_umbrella 665 -twolevel_namespace -umbrella -undefined 666 -unexported_symbols_list -weak_reference_mismatches 667 -whatsloaded -F -gused -gfull -mmacosx-version-min=VERSION 668 -mkernel -mone-byte-bool 669 670 _DEC Alpha Options_ 671 -mno-fp-regs -msoft-float -malpha-as -mgas 672 -mieee -mieee-with-inexact -mieee-conformant 673 -mfp-trap-mode=MODE -mfp-rounding-mode=MODE 674 -mtrap-precision=MODE -mbuild-constants 675 -mcpu=CPU-TYPE -mtune=CPU-TYPE 676 -mbwx -mmax -mfix -mcix 677 -mfloat-vax -mfloat-ieee 678 -mexplicit-relocs -msmall-data -mlarge-data 679 -msmall-text -mlarge-text 680 -mmemory-latency=TIME 681 682 _DEC Alpha/VMS Options_ 683 -mvms-return-codes 684 685 _FRV Options_ 686 -mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 687 -mhard-float -msoft-float 688 -malloc-cc -mfixed-cc -mdword -mno-dword 689 -mdouble -mno-double 690 -mmedia -mno-media -mmuladd -mno-muladd 691 -mfdpic -minline-plt -mgprel-ro -multilib-library-pic 692 -mlinked-fp -mlong-calls -malign-labels 693 -mlibrary-pic -macc-4 -macc-8 694 -mpack -mno-pack -mno-eflags -mcond-move -mno-cond-move 695 -moptimize-membar -mno-optimize-membar 696 -mscc -mno-scc -mcond-exec -mno-cond-exec 697 -mvliw-branch -mno-vliw-branch 698 -mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec 699 -mno-nested-cond-exec -mtomcat-stats 700 -mTLS -mtls 701 -mcpu=CPU 702 703 _GNU/Linux Options_ 704 -muclibc 705 706 _H8/300 Options_ 707 -mrelax -mh -ms -mn -mint32 -malign-300 708 709 _HPPA Options_ 710 -march=ARCHITECTURE-TYPE 711 -mbig-switch -mdisable-fpregs -mdisable-indexing 712 -mfast-indirect-calls -mgas -mgnu-ld -mhp-ld 713 -mfixed-range=REGISTER-RANGE 714 -mjump-in-delay -mlinker-opt -mlong-calls 715 -mlong-load-store -mno-big-switch -mno-disable-fpregs 716 -mno-disable-indexing -mno-fast-indirect-calls -mno-gas 717 -mno-jump-in-delay -mno-long-load-store 718 -mno-portable-runtime -mno-soft-float 719 -mno-space-regs -msoft-float -mpa-risc-1-0 720 -mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime 721 -mschedule=CPU-TYPE -mspace-regs -msio -mwsio 722 -munix=UNIX-STD -nolibdld -static -threads 723 724 _i386 and x86-64 Options_ 725 -mtune=CPU-TYPE -march=CPU-TYPE 726 -mfpmath=UNIT 727 -masm=DIALECT -mno-fancy-math-387 728 -mno-fp-ret-in-387 -msoft-float -msvr3-shlib 729 -mno-wide-multiply -mrtd -malign-double 730 -mpreferred-stack-boundary=NUM 731 -mmmx -msse -msse2 -msse3 -m3dnow 732 -mthreads -mno-align-stringops -minline-all-stringops 733 -mpush-args -maccumulate-outgoing-args -m128bit-long-double 734 -m96bit-long-double -mregparm=NUM -msseregparm 735 -mstackrealign 736 -momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs 737 -mcmodel=CODE-MODEL 738 -m32 -m64 -mlarge-data-threshold=NUM 739 740 _IA-64 Options_ 741 -mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic 742 -mvolatile-asm-stop -mregister-names -mno-sdata 743 -mconstant-gp -mauto-pic -minline-float-divide-min-latency 744 -minline-float-divide-max-throughput 745 -minline-int-divide-min-latency 746 -minline-int-divide-max-throughput 747 -minline-sqrt-min-latency -minline-sqrt-max-throughput 748 -mno-dwarf2-asm -mearly-stop-bits 749 -mfixed-range=REGISTER-RANGE -mtls-size=TLS-SIZE 750 -mtune=CPU-TYPE -mt -pthread -milp32 -mlp64 751 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec 752 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec 753 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose 754 -mno-sched-prefer-non-data-spec-insns 755 -mno-sched-prefer-non-control-spec-insns 756 -mno-sched-count-spec-in-critical-path 757 758 _M32R/D Options_ 759 -m32r2 -m32rx -m32r 760 -mdebug 761 -malign-loops -mno-align-loops 762 -missue-rate=NUMBER 763 -mbranch-cost=NUMBER 764 -mmodel=CODE-SIZE-MODEL-TYPE 765 -msdata=SDATA-TYPE 766 -mno-flush-func -mflush-func=NAME 767 -mno-flush-trap -mflush-trap=NUMBER 768 -G NUM 769 770 _M32C Options_ 771 -mcpu=CPU -msim -memregs=NUMBER 772 773 _M680x0 Options_ 774 -m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040 775 -m68060 -mcpu32 -m5200 -mcfv4e -m68881 -mbitfield 776 -mc68000 -mc68020 777 -mnobitfield -mrtd -mshort -msoft-float -mpcrel 778 -malign-int -mstrict-align -msep-data -mno-sep-data 779 -mshared-library-id=n -mid-shared-library -mno-id-shared-library 780 781 _M68hc1x Options_ 782 -m6811 -m6812 -m68hc11 -m68hc12 -m68hcs12 783 -mauto-incdec -minmax -mlong-calls -mshort 784 -msoft-reg-count=COUNT 785 786 _MCore Options_ 787 -mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates 788 -mno-relax-immediates -mwide-bitfields -mno-wide-bitfields 789 -m4byte-functions -mno-4byte-functions -mcallgraph-data 790 -mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim 791 -mlittle-endian -mbig-endian -m210 -m340 -mstack-increment 792 793 _MIPS Options_ 794 -EL -EB -march=ARCH -mtune=ARCH 795 -mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 -mips64 796 -mips16 -mno-mips16 -mabi=ABI -mabicalls -mno-abicalls 797 -mshared -mno-shared -mxgot -mno-xgot -mgp32 -mgp64 798 -mfp32 -mfp64 -mhard-float -msoft-float 799 -msingle-float -mdouble-float -mdsp -mpaired-single -mips3d 800 -mlong64 -mlong32 -msym32 -mno-sym32 801 -GNUM -membedded-data -mno-embedded-data 802 -muninit-const-in-rodata -mno-uninit-const-in-rodata 803 -msplit-addresses -mno-split-addresses 804 -mexplicit-relocs -mno-explicit-relocs 805 -mcheck-zero-division -mno-check-zero-division 806 -mdivide-traps -mdivide-breaks 807 -mmemcpy -mno-memcpy -mlong-calls -mno-long-calls 808 -mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp 809 -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 810 -mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 811 -mfix-sb1 -mno-fix-sb1 812 -mflush-func=FUNC -mno-flush-func 813 -mbranch-likely -mno-branch-likely 814 -mfp-exceptions -mno-fp-exceptions 815 -mvr4130-align -mno-vr4130-align 816 817 _MMIX Options_ 818 -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu 819 -mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols 820 -melf -mbranch-predict -mno-branch-predict -mbase-addresses 821 -mno-base-addresses -msingle-exit -mno-single-exit 822 823 _MN10300 Options_ 824 -mmult-bug -mno-mult-bug 825 -mam33 -mno-am33 826 -mam33-2 -mno-am33-2 827 -mreturn-pointer-on-d0 828 -mno-crt0 -mrelax 829 830 _MT Options_ 831 -mno-crt0 -mbacc -msim 832 -march=CPU-TYPE 833 834 _PDP-11 Options_ 835 -mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 836 -mbcopy -mbcopy-builtin -mint32 -mno-int16 837 -mint16 -mno-int32 -mfloat32 -mno-float64 838 -mfloat64 -mno-float32 -mabshi -mno-abshi 839 -mbranch-expensive -mbranch-cheap 840 -msplit -mno-split -munix-asm -mdec-asm 841 842 _PowerPC Options_ See RS/6000 and PowerPC Options. 843 844 _RS/6000 and PowerPC Options_ 845 -mcpu=CPU-TYPE 846 -mtune=CPU-TYPE 847 -mpower -mno-power -mpower2 -mno-power2 848 -mpowerpc -mpowerpc64 -mno-powerpc 849 -maltivec -mno-altivec 850 -mpowerpc-gpopt -mno-powerpc-gpopt 851 -mpowerpc-gfxopt -mno-powerpc-gfxopt 852 -mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb -mfprnd -mno-fprnd 853 -mnew-mnemonics -mold-mnemonics 854 -mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc 855 -m64 -m32 -mxl-compat -mno-xl-compat -mpe 856 -malign-power -malign-natural 857 -msoft-float -mhard-float -mmultiple -mno-multiple 858 -mstring -mno-string -mupdate -mno-update 859 -mfused-madd -mno-fused-madd -mbit-align -mno-bit-align 860 -mstrict-align -mno-strict-align -mrelocatable 861 -mno-relocatable -mrelocatable-lib -mno-relocatable-lib 862 -mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian 863 -mdynamic-no-pic -maltivec -mswdiv 864 -mprioritize-restricted-insns=PRIORITY 865 -msched-costly-dep=DEPENDENCE_TYPE 866 -minsert-sched-nops=SCHEME 867 -mcall-sysv -mcall-netbsd 868 -maix-struct-return -msvr4-struct-return 869 -mabi=ABI-TYPE -msecure-plt -mbss-plt 870 -misel -mno-isel 871 -misel=yes -misel=no 872 -mspe -mno-spe 873 -mspe=yes -mspe=no 874 -mvrsave -mno-vrsave 875 -mmulhw -mno-mulhw 876 -mdlmzb -mno-dlmzb 877 -mfloat-gprs=yes -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double 878 -mprototype -mno-prototype 879 -msim -mmvme -mads -myellowknife -memb -msdata 880 -msdata=OPT -mvxworks -mwindiss -G NUM -pthread 881 882 _S/390 and zSeries Options_ 883 -mtune=CPU-TYPE -march=CPU-TYPE 884 -mhard-float -msoft-float -mlong-double-64 -mlong-double-128 885 -mbackchain -mno-backchain -mpacked-stack -mno-packed-stack 886 -msmall-exec -mno-small-exec -mmvcle -mno-mvcle 887 -m64 -m31 -mdebug -mno-debug -mesa -mzarch 888 -mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd 889 -mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard 890 891 _Score Options_ 892 -meb -mel 893 -mnhwloop 894 -muls 895 -mmac 896 -mscore5 -mscore5u -mscore7 -mscore7d 897 898 _SH Options_ 899 -m1 -m2 -m2e -m3 -m3e 900 -m4-nofpu -m4-single-only -m4-single -m4 901 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al 902 -m5-64media -m5-64media-nofpu 903 -m5-32media -m5-32media-nofpu 904 -m5-compact -m5-compact-nofpu 905 -mb -ml -mdalign -mrelax 906 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave 907 -mieee -misize -mpadstruct -mspace 908 -mprefergot -musermode -multcost=NUMBER -mdiv=STRATEGY 909 -mdivsi3_libfunc=NAME 910 -madjust-unroll -mindexed-addressing -mgettrcost=NUMBER -mpt-fixed 911 -minvalid-symbols 912 913 _SPARC Options_ 914 -mcpu=CPU-TYPE 915 -mtune=CPU-TYPE 916 -mcmodel=CODE-MODEL 917 -m32 -m64 -mapp-regs -mno-app-regs 918 -mfaster-structs -mno-faster-structs 919 -mfpu -mno-fpu -mhard-float -msoft-float 920 -mhard-quad-float -msoft-quad-float 921 -mimpure-text -mno-impure-text -mlittle-endian 922 -mstack-bias -mno-stack-bias 923 -munaligned-doubles -mno-unaligned-doubles 924 -mv8plus -mno-v8plus -mvis -mno-vis 925 -threads -pthreads -pthread 926 927 _System V Options_ 928 -Qy -Qn -YP,PATHS -Ym,DIR 929 930 _TMS320C3x/C4x Options_ 931 -mcpu=CPU -mbig -msmall -mregparm -mmemparm 932 -mfast-fix -mmpyi -mbk -mti -mdp-isr-reload 933 -mrpts=COUNT -mrptb -mdb -mloop-unsigned 934 -mparallel-insns -mparallel-mpy -mpreserve-float 935 936 _V850 Options_ 937 -mlong-calls -mno-long-calls -mep -mno-ep 938 -mprolog-function -mno-prolog-function -mspace 939 -mtda=N -msda=N -mzda=N 940 -mapp-regs -mno-app-regs 941 -mdisable-callt -mno-disable-callt 942 -mv850e1 943 -mv850e 944 -mv850 -mbig-switch 945 946 _VAX Options_ 947 -mg -mgnu -munix 948 949 _x86-64 Options_ See i386 and x86-64 Options. 950 951 _Xstormy16 Options_ 952 -msim 953 954 _Xtensa Options_ 955 -mconst16 -mno-const16 956 -mfused-madd -mno-fused-madd 957 -mtext-section-literals -mno-text-section-literals 958 -mtarget-align -mno-target-align 959 -mlongcalls -mno-longcalls 960 961 _zSeries Options_ See S/390 and zSeries Options. 962 963_Code Generation Options_ 964 *Note Options for Code Generation Conventions: Code Gen Options. 965 -fcall-saved-REG -fcall-used-REG 966 -ffixed-REG -fexceptions 967 -fnon-call-exceptions -funwind-tables 968 -fasynchronous-unwind-tables 969 -finhibit-size-directive -finstrument-functions 970 -fno-common -fno-ident 971 -fpcc-struct-return -fpic -fPIC -fpie -fPIE 972 -fno-jump-tables 973 -freg-struct-return -fshort-enums 974 -fshort-double -fshort-wchar 975 -fverbose-asm -fpack-struct[=N] -fstack-check 976 -fstack-limit-register=REG -fstack-limit-symbol=SYM 977 -fargument-alias -fargument-noalias 978 -fargument-noalias-global -fargument-noalias-anything 979 -fleading-underscore -ftls-model=MODEL 980 -ftrapv -fwrapv -fbounds-check 981 -fvisibility 982 983 984* Menu: 985 986* Overall Options:: Controlling the kind of output: 987 an executable, object files, assembler files, 988 or preprocessed source. 989* C Dialect Options:: Controlling the variant of C language compiled. 990* C++ Dialect Options:: Variations on C++. 991* Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C 992 and Objective-C++. 993* Language Independent Options:: Controlling how diagnostics should be 994 formatted. 995* Warning Options:: How picky should the compiler be? 996* Debugging Options:: Symbol tables, measurements, and debugging dumps. 997* Optimize Options:: How much optimization? 998* Preprocessor Options:: Controlling header files and macro definitions. 999 Also, getting dependency information for Make. 1000* Assembler Options:: Passing options to the assembler. 1001* Link Options:: Specifying libraries and so on. 1002* Directory Options:: Where to find header files and libraries. 1003 Where to find the compiler executable files. 1004* Spec Files:: How to pass switches to sub-processes. 1005* Target Options:: Running a cross-compiler, or an old version of GCC. 1006 1007 1008File: gcc.info, Node: Overall Options, Next: Invoking G++, Prev: Option Summary, Up: Invoking GCC 1009 10103.2 Options Controlling the Kind of Output 1011========================================== 1012 1013Compilation can involve up to four stages: preprocessing, compilation 1014proper, assembly and linking, always in that order. GCC is capable of 1015preprocessing and compiling several files either into several assembler 1016input files, or into one assembler input file; then each assembler 1017input file produces an object file, and linking combines all the object 1018files (those newly compiled, and those specified as input) into an 1019executable file. 1020 1021 For any given input file, the file name suffix determines what kind of 1022compilation is done: 1023 1024`FILE.c' 1025 C source code which must be preprocessed. 1026 1027`FILE.i' 1028 C source code which should not be preprocessed. 1029 1030`FILE.ii' 1031 C++ source code which should not be preprocessed. 1032 1033`FILE.m' 1034 Objective-C source code. Note that you must link with the 1035 `libobjc' library to make an Objective-C program work. 1036 1037`FILE.mi' 1038 Objective-C source code which should not be preprocessed. 1039 1040`FILE.mm' 1041`FILE.M' 1042 Objective-C++ source code. Note that you must link with the 1043 `libobjc' library to make an Objective-C++ program work. Note 1044 that `.M' refers to a literal capital M. 1045 1046`FILE.mii' 1047 Objective-C++ source code which should not be preprocessed. 1048 1049`FILE.h' 1050 C, C++, Objective-C or Objective-C++ header file to be turned into 1051 a precompiled header. 1052 1053`FILE.cc' 1054`FILE.cp' 1055`FILE.cxx' 1056`FILE.cpp' 1057`FILE.CPP' 1058`FILE.c++' 1059`FILE.C' 1060 C++ source code which must be preprocessed. Note that in `.cxx', 1061 the last two letters must both be literally `x'. Likewise, `.C' 1062 refers to a literal capital C. 1063 1064`FILE.mm' 1065`FILE.M' 1066 Objective-C++ source code which must be preprocessed. 1067 1068`FILE.mii' 1069 Objective-C++ source code which should not be preprocessed. 1070 1071`FILE.hh' 1072`FILE.H' 1073 C++ header file to be turned into a precompiled header. 1074 1075`FILE.f' 1076`FILE.for' 1077`FILE.FOR' 1078 Fixed form Fortran source code which should not be preprocessed. 1079 1080`FILE.F' 1081`FILE.fpp' 1082`FILE.FPP' 1083 Fixed form Fortran source code which must be preprocessed (with 1084 the traditional preprocessor). 1085 1086`FILE.f90' 1087`FILE.f95' 1088 Free form Fortran source code which should not be preprocessed. 1089 1090`FILE.F90' 1091`FILE.F95' 1092 Free form Fortran source code which must be preprocessed (with the 1093 traditional preprocessor). 1094 1095`FILE.ads' 1096 Ada source code file which contains a library unit declaration (a 1097 declaration of a package, subprogram, or generic, or a generic 1098 instantiation), or a library unit renaming declaration (a package, 1099 generic, or subprogram renaming declaration). Such files are also 1100 called "specs". 1101 1102`FILE.adb' 1103 Ada source code file containing a library unit body (a subprogram 1104 or package body). Such files are also called "bodies". 1105 1106`FILE.s' 1107 Assembler code. 1108 1109`FILE.S' 1110 Assembler code which must be preprocessed. 1111 1112`OTHER' 1113 An object file to be fed straight into linking. Any file name 1114 with no recognized suffix is treated this way. 1115 1116 You can specify the input language explicitly with the `-x' option: 1117 1118`-x LANGUAGE' 1119 Specify explicitly the LANGUAGE for the following input files 1120 (rather than letting the compiler choose a default based on the 1121 file name suffix). This option applies to all following input 1122 files until the next `-x' option. Possible values for LANGUAGE 1123 are: 1124 c c-header c-cpp-output 1125 c++ c++-header c++-cpp-output 1126 objective-c objective-c-header objective-c-cpp-output 1127 objective-c++ objective-c++-header objective-c++-cpp-output 1128 assembler assembler-with-cpp 1129 ada 1130 f95 f95-cpp-input 1131 java 1132 treelang 1133 1134`-x none' 1135 Turn off any specification of a language, so that subsequent files 1136 are handled according to their file name suffixes (as they are if 1137 `-x' has not been used at all). 1138 1139`-pass-exit-codes' 1140 Normally the `gcc' program will exit with the code of 1 if any 1141 phase of the compiler returns a non-success return code. If you 1142 specify `-pass-exit-codes', the `gcc' program will instead return 1143 with numerically highest error produced by any phase that returned 1144 an error indication. The C, C++, and Fortran frontends return 4, 1145 if an internal compiler error is encountered. 1146 1147 If you only want some of the stages of compilation, you can use `-x' 1148(or filename suffixes) to tell `gcc' where to start, and one of the 1149options `-c', `-S', or `-E' to say where `gcc' is to stop. Note that 1150some combinations (for example, `-x cpp-output -E') instruct `gcc' to 1151do nothing at all. 1152 1153`-c' 1154 Compile or assemble the source files, but do not link. The linking 1155 stage simply is not done. The ultimate output is in the form of an 1156 object file for each source file. 1157 1158 By default, the object file name for a source file is made by 1159 replacing the suffix `.c', `.i', `.s', etc., with `.o'. 1160 1161 Unrecognized input files, not requiring compilation or assembly, 1162 are ignored. 1163 1164`-S' 1165 Stop after the stage of compilation proper; do not assemble. The 1166 output is in the form of an assembler code file for each 1167 non-assembler input file specified. 1168 1169 By default, the assembler file name for a source file is made by 1170 replacing the suffix `.c', `.i', etc., with `.s'. 1171 1172 Input files that don't require compilation are ignored. 1173 1174`-E' 1175 Stop after the preprocessing stage; do not run the compiler 1176 proper. The output is in the form of preprocessed source code, 1177 which is sent to the standard output. 1178 1179 Input files which don't require preprocessing are ignored. 1180 1181`-o FILE' 1182 Place output in file FILE. This applies regardless to whatever 1183 sort of output is being produced, whether it be an executable file, 1184 an object file, an assembler file or preprocessed C code. 1185 1186 If `-o' is not specified, the default is to put an executable file 1187 in `a.out', the object file for `SOURCE.SUFFIX' in `SOURCE.o', its 1188 assembler file in `SOURCE.s', a precompiled header file in 1189 `SOURCE.SUFFIX.gch', and all preprocessed C source on standard 1190 output. 1191 1192`-v' 1193 Print (on standard error output) the commands executed to run the 1194 stages of compilation. Also print the version number of the 1195 compiler driver program and of the preprocessor and the compiler 1196 proper. 1197 1198`-###' 1199 Like `-v' except the commands are not executed and all command 1200 arguments are quoted. This is useful for shell scripts to capture 1201 the driver-generated command lines. 1202 1203`-pipe' 1204 Use pipes rather than temporary files for communication between the 1205 various stages of compilation. This fails to work on some systems 1206 where the assembler is unable to read from a pipe; but the GNU 1207 assembler has no trouble. 1208 1209`-combine' 1210 If you are compiling multiple source files, this option tells the 1211 driver to pass all the source files to the compiler at once (for 1212 those languages for which the compiler can handle this). This 1213 will allow intermodule analysis (IMA) to be performed by the 1214 compiler. Currently the only language for which this is supported 1215 is C. If you pass source files for multiple languages to the 1216 driver, using this option, the driver will invoke the compiler(s) 1217 that support IMA once each, passing each compiler all the source 1218 files appropriate for it. For those languages that do not support 1219 IMA this option will be ignored, and the compiler will be invoked 1220 once for each source file in that language. If you use this 1221 option in conjunction with `-save-temps', the compiler will 1222 generate multiple pre-processed files (one for each source file), 1223 but only one (combined) `.o' or `.s' file. 1224 1225`--help' 1226 Print (on the standard output) a description of the command line 1227 options understood by `gcc'. If the `-v' option is also specified 1228 then `--help' will also be passed on to the various processes 1229 invoked by `gcc', so that they can display the command line options 1230 they accept. If the `-Wextra' option is also specified then 1231 command line options which have no documentation associated with 1232 them will also be displayed. 1233 1234`--target-help' 1235 Print (on the standard output) a description of target specific 1236 command line options for each tool. 1237 1238`--version' 1239 Display the version number and copyrights of the invoked GCC. 1240 1241`@FILE' 1242 Read command-line options from FILE. The options read are 1243 inserted in place of the original @FILE option. If FILE does not 1244 exist, or cannot be read, then the option will be treated 1245 literally, and not removed. 1246 1247 Options in FILE are separated by whitespace. A whitespace 1248 character may be included in an option by surrounding the entire 1249 option in either single or double quotes. Any character 1250 (including a backslash) may be included by prefixing the character 1251 to be included with a backslash. The FILE may itself contain 1252 additional @FILE options; any such options will be processed 1253 recursively. 1254 1255 1256File: gcc.info, Node: Invoking G++, Next: C Dialect Options, Prev: Overall Options, Up: Invoking GCC 1257 12583.3 Compiling C++ Programs 1259========================== 1260 1261C++ source files conventionally use one of the suffixes `.C', `.cc', 1262`.cpp', `.CPP', `.c++', `.cp', or `.cxx'; C++ header files often use 1263`.hh' or `.H'; and preprocessed C++ files use the suffix `.ii'. GCC 1264recognizes files with these names and compiles them as C++ programs 1265even if you call the compiler the same way as for compiling C programs 1266(usually with the name `gcc'). 1267 1268 However, the use of `gcc' does not add the C++ library. `g++' is a 1269program that calls GCC and treats `.c', `.h' and `.i' files as C++ 1270source files instead of C source files unless `-x' is used, and 1271automatically specifies linking against the C++ library. This program 1272is also useful when precompiling a C header file with a `.h' extension 1273for use in C++ compilations. On many systems, `g++' is also installed 1274with the name `c++'. 1275 1276 When you compile C++ programs, you may specify many of the same 1277command-line options that you use for compiling programs in any 1278language; or command-line options meaningful for C and related 1279languages; or options that are meaningful only for C++ programs. *Note 1280Options Controlling C Dialect: C Dialect Options, for explanations of 1281options for languages related to C. *Note Options Controlling C++ 1282Dialect: C++ Dialect Options, for explanations of options that are 1283meaningful only for C++ programs. 1284 1285 1286File: gcc.info, Node: C Dialect Options, Next: C++ Dialect Options, Prev: Invoking G++, Up: Invoking GCC 1287 12883.4 Options Controlling C Dialect 1289================================= 1290 1291The following options control the dialect of C (or languages derived 1292from C, such as C++, Objective-C and Objective-C++) that the compiler 1293accepts: 1294 1295`-ansi' 1296 In C mode, support all ISO C90 programs. In C++ mode, remove GNU 1297 extensions that conflict with ISO C++. 1298 1299 This turns off certain features of GCC that are incompatible with 1300 ISO C90 (when compiling C code), or of standard C++ (when 1301 compiling C++ code), such as the `asm' and `typeof' keywords, and 1302 predefined macros such as `unix' and `vax' that identify the type 1303 of system you are using. It also enables the undesirable and 1304 rarely used ISO trigraph feature. For the C compiler, it disables 1305 recognition of C++ style `//' comments as well as the `inline' 1306 keyword. 1307 1308 The alternate keywords `__asm__', `__extension__', `__inline__' 1309 and `__typeof__' continue to work despite `-ansi'. You would not 1310 want to use them in an ISO C program, of course, but it is useful 1311 to put them in header files that might be included in compilations 1312 done with `-ansi'. Alternate predefined macros such as `__unix__' 1313 and `__vax__' are also available, with or without `-ansi'. 1314 1315 The `-ansi' option does not cause non-ISO programs to be rejected 1316 gratuitously. For that, `-pedantic' is required in addition to 1317 `-ansi'. *Note Warning Options::. 1318 1319 The macro `__STRICT_ANSI__' is predefined when the `-ansi' option 1320 is used. Some header files may notice this macro and refrain from 1321 declaring certain functions or defining certain macros that the 1322 ISO standard doesn't call for; this is to avoid interfering with 1323 any programs that might use these names for other things. 1324 1325 Functions which would normally be built in but do not have 1326 semantics defined by ISO C (such as `alloca' and `ffs') are not 1327 built-in functions with `-ansi' is used. *Note Other built-in 1328 functions provided by GCC: Other Builtins, for details of the 1329 functions affected. 1330 1331`-std=' 1332 Determine the language standard. This option is currently only 1333 supported when compiling C or C++. A value for this option must be 1334 provided; possible values are 1335 1336 `c89' 1337 `iso9899:1990' 1338 ISO C90 (same as `-ansi'). 1339 1340 `iso9899:199409' 1341 ISO C90 as modified in amendment 1. 1342 1343 `c99' 1344 `c9x' 1345 `iso9899:1999' 1346 `iso9899:199x' 1347 ISO C99. Note that this standard is not yet fully supported; 1348 see `http://gcc.gnu.org/gcc-4.2/c99status.html' for more 1349 information. The names `c9x' and `iso9899:199x' are 1350 deprecated. 1351 1352 `gnu89' 1353 ISO C90 plus GNU extensions (including some C99 1354 features). 1355 1356 `gnu99' 1357 `gnu9x' 1358 Default, ISO C99 plus GNU extensions. 1359 The name `gnu9x' is deprecated. 1360 1361 `c++98' 1362 The 1998 ISO C++ standard plus amendments. 1363 1364 `gnu++98' 1365 The same as `-std=c++98' plus GNU extensions. This is the 1366 default for C++ code. 1367 1368 Even when this option is not specified, you can still use some of 1369 the features of newer standards in so far as they do not conflict 1370 with previous C standards. For example, you may use 1371 `__restrict__' even when `-std=c99' is not specified. 1372 1373 The `-std' options specifying some version of ISO C have the same 1374 effects as `-ansi', except that features that were not in ISO C90 1375 but are in the specified version (for example, `//' comments and 1376 the `inline' keyword in ISO C99) are not disabled. 1377 1378 *Note Language Standards Supported by GCC: Standards, for details 1379 of these standard versions. 1380 1381`-fgnu89-inline' 1382 The option `-fgnu89-inline' tells GCC to use the traditional GNU 1383 semantics for `inline' functions when in C99 mode. *Note An 1384 Inline Function is As Fast As a Macro: Inline. Using this option 1385 is roughly equivalent to adding the `gnu_inline' function 1386 attribute to all inline functions (*note Function Attributes::). 1387 1388 This option is accepted by GCC versions 4.1.3 and up. In GCC 1389 versions prior to 4.3, C99 inline semantics are not supported, and 1390 thus this option is effectively assumed to be present regardless 1391 of whether or not it is specified; the only effect of specifying 1392 it explicitly is to disable warnings about using inline functions 1393 in C99 mode. Likewise, the option `-fno-gnu89-inline' is not 1394 supported in versions of GCC before 4.3. It will be supported 1395 only in C99 or gnu99 mode, not in C89 or gnu89 mode. 1396 1397 The preprocesor macros `__GNUC_GNU_INLINE__' and 1398 `__GNUC_STDC_INLINE__' may be used to check which semantics are in 1399 effect for `inline' functions. *Note Common Predefined Macros: 1400 (cpp)Common Predefined Macros. 1401 1402`-aux-info FILENAME' 1403 Output to the given filename prototyped declarations for all 1404 functions declared and/or defined in a translation unit, including 1405 those in header files. This option is silently ignored in any 1406 language other than C. 1407 1408 Besides declarations, the file indicates, in comments, the origin 1409 of each declaration (source file and line), whether the 1410 declaration was implicit, prototyped or unprototyped (`I', `N' for 1411 new or `O' for old, respectively, in the first character after the 1412 line number and the colon), and whether it came from a declaration 1413 or a definition (`C' or `F', respectively, in the following 1414 character). In the case of function definitions, a K&R-style list 1415 of arguments followed by their declarations is also provided, 1416 inside comments, after the declaration. 1417 1418`-fno-asm' 1419 Do not recognize `asm', `inline' or `typeof' as a keyword, so that 1420 code can use these words as identifiers. You can use the keywords 1421 `__asm__', `__inline__' and `__typeof__' instead. `-ansi' implies 1422 `-fno-asm'. 1423 1424 In C++, this switch only affects the `typeof' keyword, since `asm' 1425 and `inline' are standard keywords. You may want to use the 1426 `-fno-gnu-keywords' flag instead, which has the same effect. In 1427 C99 mode (`-std=c99' or `-std=gnu99'), this switch only affects 1428 the `asm' and `typeof' keywords, since `inline' is a standard 1429 keyword in ISO C99. 1430 1431`-fno-builtin' 1432`-fno-builtin-FUNCTION' 1433 Don't recognize built-in functions that do not begin with 1434 `__builtin_' as prefix. *Note Other built-in functions provided 1435 by GCC: Other Builtins, for details of the functions affected, 1436 including those which are not built-in functions when `-ansi' or 1437 `-std' options for strict ISO C conformance are used because they 1438 do not have an ISO standard meaning. 1439 1440 GCC normally generates special code to handle certain built-in 1441 functions more efficiently; for instance, calls to `alloca' may 1442 become single instructions that adjust the stack directly, and 1443 calls to `memcpy' may become inline copy loops. The resulting 1444 code is often both smaller and faster, but since the function 1445 calls no longer appear as such, you cannot set a breakpoint on 1446 those calls, nor can you change the behavior of the functions by 1447 linking with a different library. In addition, when a function is 1448 recognized as a built-in function, GCC may use information about 1449 that function to warn about problems with calls to that function, 1450 or to generate more efficient code, even if the resulting code 1451 still contains calls to that function. For example, warnings are 1452 given with `-Wformat' for bad calls to `printf', when `printf' is 1453 built in, and `strlen' is known not to modify global memory. 1454 1455 With the `-fno-builtin-FUNCTION' option only the built-in function 1456 FUNCTION is disabled. FUNCTION must not begin with `__builtin_'. 1457 If a function is named this is not built-in in this version of 1458 GCC, this option is ignored. There is no corresponding 1459 `-fbuiltin-FUNCTION' option; if you wish to enable built-in 1460 functions selectively when using `-fno-builtin' or 1461 `-ffreestanding', you may define macros such as: 1462 1463 #define abs(n) __builtin_abs ((n)) 1464 #define strcpy(d, s) __builtin_strcpy ((d), (s)) 1465 1466`-fhosted' 1467 Assert that compilation takes place in a hosted environment. This 1468 implies `-fbuiltin'. A hosted environment is one in which the 1469 entire standard library is available, and in which `main' has a 1470 return type of `int'. Examples are nearly everything except a 1471 kernel. This is equivalent to `-fno-freestanding'. 1472 1473`-ffreestanding' 1474 Assert that compilation takes place in a freestanding environment. 1475 This implies `-fno-builtin'. A freestanding environment is one 1476 in which the standard library may not exist, and program startup 1477 may not necessarily be at `main'. The most obvious example is an 1478 OS kernel. This is equivalent to `-fno-hosted'. 1479 1480 *Note Language Standards Supported by GCC: Standards, for details 1481 of freestanding and hosted environments. 1482 1483`-fopenmp' 1484 Enable handling of OpenMP directives `#pragma omp' in C/C++ and 1485 `!$omp' in Fortran. When `-fopenmp' is specified, the compiler 1486 generates parallel code according to the OpenMP Application 1487 Program Interface v2.5 `http://www.openmp.org/'. 1488 1489`-fms-extensions' 1490 Accept some non-standard constructs used in Microsoft header files. 1491 1492 Some cases of unnamed fields in structures and unions are only 1493 accepted with this option. *Note Unnamed struct/union fields 1494 within structs/unions: Unnamed Fields, for details. 1495 1496`-trigraphs' 1497 Support ISO C trigraphs. The `-ansi' option (and `-std' options 1498 for strict ISO C conformance) implies `-trigraphs'. 1499 1500`-no-integrated-cpp' 1501 Performs a compilation in two passes: preprocessing and compiling. 1502 This option allows a user supplied "cc1", "cc1plus", or "cc1obj" 1503 via the `-B' option. The user supplied compilation step can then 1504 add in an additional preprocessing step after normal preprocessing 1505 but before compiling. The default is to use the integrated cpp 1506 (internal cpp) 1507 1508 The semantics of this option will change if "cc1", "cc1plus", and 1509 "cc1obj" are merged. 1510 1511`-traditional' 1512`-traditional-cpp' 1513 Formerly, these options caused GCC to attempt to emulate a 1514 pre-standard C compiler. They are now only supported with the 1515 `-E' switch. The preprocessor continues to support a pre-standard 1516 mode. See the GNU CPP manual for details. 1517 1518`-fcond-mismatch' 1519 Allow conditional expressions with mismatched types in the second 1520 and third arguments. The value of such an expression is void. 1521 This option is not supported for C++. 1522 1523`-funsigned-char' 1524 Let the type `char' be unsigned, like `unsigned char'. 1525 1526 Each kind of machine has a default for what `char' should be. It 1527 is either like `unsigned char' by default or like `signed char' by 1528 default. 1529 1530 Ideally, a portable program should always use `signed char' or 1531 `unsigned char' when it depends on the signedness of an object. 1532 But many programs have been written to use plain `char' and expect 1533 it to be signed, or expect it to be unsigned, depending on the 1534 machines they were written for. This option, and its inverse, let 1535 you make such a program work with the opposite default. 1536 1537 The type `char' is always a distinct type from each of `signed 1538 char' or `unsigned char', even though its behavior is always just 1539 like one of those two. 1540 1541`-fsigned-char' 1542 Let the type `char' be signed, like `signed char'. 1543 1544 Note that this is equivalent to `-fno-unsigned-char', which is the 1545 negative form of `-funsigned-char'. Likewise, the option 1546 `-fno-signed-char' is equivalent to `-funsigned-char'. 1547 1548`-fsigned-bitfields' 1549`-funsigned-bitfields' 1550`-fno-signed-bitfields' 1551`-fno-unsigned-bitfields' 1552 These options control whether a bit-field is signed or unsigned, 1553 when the declaration does not use either `signed' or `unsigned'. 1554 By default, such a bit-field is signed, because this is 1555 consistent: the basic integer types such as `int' are signed types. 1556 1557 1558File: gcc.info, Node: C++ Dialect Options, Next: Objective-C and Objective-C++ Dialect Options, Prev: C Dialect Options, Up: Invoking GCC 1559 15603.5 Options Controlling C++ Dialect 1561=================================== 1562 1563This section describes the command-line options that are only meaningful 1564for C++ programs; but you can also use most of the GNU compiler options 1565regardless of what language your program is in. For example, you might 1566compile a file `firstClass.C' like this: 1567 1568 g++ -g -frepo -O -c firstClass.C 1569 1570In this example, only `-frepo' is an option meant only for C++ 1571programs; you can use the other options with any language supported by 1572GCC. 1573 1574 Here is a list of options that are _only_ for compiling C++ programs: 1575 1576`-fabi-version=N' 1577 Use version N of the C++ ABI. Version 2 is the version of the C++ 1578 ABI that first appeared in G++ 3.4. Version 1 is the version of 1579 the C++ ABI that first appeared in G++ 3.2. Version 0 will always 1580 be the version that conforms most closely to the C++ ABI 1581 specification. Therefore, the ABI obtained using version 0 will 1582 change as ABI bugs are fixed. 1583 1584 The default is version 2. 1585 1586`-fno-access-control' 1587 Turn off all access checking. This switch is mainly useful for 1588 working around bugs in the access control code. 1589 1590`-fcheck-new' 1591 Check that the pointer returned by `operator new' is non-null 1592 before attempting to modify the storage allocated. This check is 1593 normally unnecessary because the C++ standard specifies that 1594 `operator new' will only return `0' if it is declared `throw()', 1595 in which case the compiler will always check the return value even 1596 without this option. In all other cases, when `operator new' has 1597 a non-empty exception specification, memory exhaustion is 1598 signalled by throwing `std::bad_alloc'. See also `new (nothrow)'. 1599 1600`-fconserve-space' 1601 Put uninitialized or runtime-initialized global variables into the 1602 common segment, as C does. This saves space in the executable at 1603 the cost of not diagnosing duplicate definitions. If you compile 1604 with this flag and your program mysteriously crashes after 1605 `main()' has completed, you may have an object that is being 1606 destroyed twice because two definitions were merged. 1607 1608 This option is no longer useful on most targets, now that support 1609 has been added for putting variables into BSS without making them 1610 common. 1611 1612`-ffriend-injection' 1613 Inject friend functions into the enclosing namespace, so that they 1614 are visible outside the scope of the class in which they are 1615 declared. Friend functions were documented to work this way in 1616 the old Annotated C++ Reference Manual, and versions of G++ before 1617 4.1 always worked that way. However, in ISO C++ a friend function 1618 which is not declared in an enclosing scope can only be found 1619 using argument dependent lookup. This option causes friends to be 1620 injected as they were in earlier releases. 1621 1622 This option is for compatibility, and may be removed in a future 1623 release of G++. 1624 1625`-fno-elide-constructors' 1626 The C++ standard allows an implementation to omit creating a 1627 temporary which is only used to initialize another object of the 1628 same type. Specifying this option disables that optimization, and 1629 forces G++ to call the copy constructor in all cases. 1630 1631`-fno-enforce-eh-specs' 1632 Don't generate code to check for violation of exception 1633 specifications at runtime. This option violates the C++ standard, 1634 but may be useful for reducing code size in production builds, 1635 much like defining `NDEBUG'. This does not give user code 1636 permission to throw exceptions in violation of the exception 1637 specifications; the compiler will still optimize based on the 1638 specifications, so throwing an unexpected exception will result in 1639 undefined behavior. 1640 1641`-ffor-scope' 1642`-fno-for-scope' 1643 If `-ffor-scope' is specified, the scope of variables declared in 1644 a for-init-statement is limited to the `for' loop itself, as 1645 specified by the C++ standard. If `-fno-for-scope' is specified, 1646 the scope of variables declared in a for-init-statement extends to 1647 the end of the enclosing scope, as was the case in old versions of 1648 G++, and other (traditional) implementations of C++. 1649 1650 The default if neither flag is given to follow the standard, but 1651 to allow and give a warning for old-style code that would 1652 otherwise be invalid, or have different behavior. 1653 1654`-fno-gnu-keywords' 1655 Do not recognize `typeof' as a keyword, so that code can use this 1656 word as an identifier. You can use the keyword `__typeof__' 1657 instead. `-ansi' implies `-fno-gnu-keywords'. 1658 1659`-fno-implicit-templates' 1660 Never emit code for non-inline templates which are instantiated 1661 implicitly (i.e. by use); only emit code for explicit 1662 instantiations. *Note Template Instantiation::, for more 1663 information. 1664 1665`-fno-implicit-inline-templates' 1666 Don't emit code for implicit instantiations of inline templates, 1667 either. The default is to handle inlines differently so that 1668 compiles with and without optimization will need the same set of 1669 explicit instantiations. 1670 1671`-fno-implement-inlines' 1672 To save space, do not emit out-of-line copies of inline functions 1673 controlled by `#pragma implementation'. This will cause linker 1674 errors if these functions are not inlined everywhere they are 1675 called. 1676 1677`-fms-extensions' 1678 Disable pedantic warnings about constructs used in MFC, such as 1679 implicit int and getting a pointer to member function via 1680 non-standard syntax. 1681 1682`-fno-nonansi-builtins' 1683 Disable built-in declarations of functions that are not mandated by 1684 ANSI/ISO C. These include `ffs', `alloca', `_exit', `index', 1685 `bzero', `conjf', and other related functions. 1686 1687`-fno-operator-names' 1688 Do not treat the operator name keywords `and', `bitand', `bitor', 1689 `compl', `not', `or' and `xor' as synonyms as keywords. 1690 1691`-fno-optional-diags' 1692 Disable diagnostics that the standard says a compiler does not 1693 need to issue. Currently, the only such diagnostic issued by G++ 1694 is the one for a name having multiple meanings within a class. 1695 1696`-fpermissive' 1697 Downgrade some diagnostics about nonconformant code from errors to 1698 warnings. Thus, using `-fpermissive' will allow some 1699 nonconforming code to compile. 1700 1701`-frepo' 1702 Enable automatic template instantiation at link time. This option 1703 also implies `-fno-implicit-templates'. *Note Template 1704 Instantiation::, for more information. 1705 1706`-fno-rtti' 1707 Disable generation of information about every class with virtual 1708 functions for use by the C++ runtime type identification features 1709 (`dynamic_cast' and `typeid'). If you don't use those parts of 1710 the language, you can save some space by using this flag. Note 1711 that exception handling uses the same information, but it will 1712 generate it as needed. The `dynamic_cast' operator can still be 1713 used for casts that do not require runtime type information, i.e. 1714 casts to `void *' or to unambiguous base classes. 1715 1716`-fstats' 1717 Emit statistics about front-end processing at the end of the 1718 compilation. This information is generally only useful to the G++ 1719 development team. 1720 1721`-ftemplate-depth-N' 1722 Set the maximum instantiation depth for template classes to N. A 1723 limit on the template instantiation depth is needed to detect 1724 endless recursions during template class instantiation. ANSI/ISO 1725 C++ conforming programs must not rely on a maximum depth greater 1726 than 17. 1727 1728`-fno-threadsafe-statics' 1729 Do not emit the extra code to use the routines specified in the C++ 1730 ABI for thread-safe initialization of local statics. You can use 1731 this option to reduce code size slightly in code that doesn't need 1732 to be thread-safe. 1733 1734`-fuse-cxa-atexit' 1735 Register destructors for objects with static storage duration with 1736 the `__cxa_atexit' function rather than the `atexit' function. 1737 This option is required for fully standards-compliant handling of 1738 static destructors, but will only work if your C library supports 1739 `__cxa_atexit'. 1740 1741`-fno-use-cxa-get-exception-ptr' 1742 Don't use the `__cxa_get_exception_ptr' runtime routine. This 1743 will cause `std::uncaught_exception' to be incorrect, but is 1744 necessary if the runtime routine is not available. 1745 1746`-fvisibility-inlines-hidden' 1747 This switch declares that the user does not attempt to compare 1748 pointers to inline methods where the addresses of the two functions 1749 were taken in different shared objects. 1750 1751 The effect of this is that GCC may, effectively, mark inline 1752 methods with `__attribute__ ((visibility ("hidden")))' so that 1753 they do not appear in the export table of a DSO and do not require 1754 a PLT indirection when used within the DSO. Enabling this option 1755 can have a dramatic effect on load and link times of a DSO as it 1756 massively reduces the size of the dynamic export table when the 1757 library makes heavy use of templates. 1758 1759 The behaviour of this switch is not quite the same as marking the 1760 methods as hidden directly, because it does not affect static 1761 variables local to the function or cause the compiler to deduce 1762 that the function is defined in only one shared object. 1763 1764 You may mark a method as having a visibility explicitly to negate 1765 the effect of the switch for that method. For example, if you do 1766 want to compare pointers to a particular inline method, you might 1767 mark it as having default visibility. Marking the enclosing class 1768 with explicit visibility will have no effect. 1769 1770 Explicitly instantiated inline methods are unaffected by this 1771 option as their linkage might otherwise cross a shared library 1772 boundary. *Note Template Instantiation::. 1773 1774`-fno-weak' 1775 Do not use weak symbol support, even if it is provided by the 1776 linker. By default, G++ will use weak symbols if they are 1777 available. This option exists only for testing, and should not be 1778 used by end-users; it will result in inferior code and has no 1779 benefits. This option may be removed in a future release of G++. 1780 1781`-nostdinc++' 1782 Do not search for header files in the standard directories 1783 specific to C++, but do still search the other standard 1784 directories. (This option is used when building the C++ library.) 1785 1786 In addition, these optimization, warning, and code generation options 1787have meanings only for C++ programs: 1788 1789`-fno-default-inline' 1790 Do not assume `inline' for functions defined inside a class scope. 1791 *Note Options That Control Optimization: Optimize Options. Note 1792 that these functions will have linkage like inline functions; they 1793 just won't be inlined by default. 1794 1795`-Wabi (C++ only)' 1796 Warn when G++ generates code that is probably not compatible with 1797 the vendor-neutral C++ ABI. Although an effort has been made to 1798 warn about all such cases, there are probably some cases that are 1799 not warned about, even though G++ is generating incompatible code. 1800 There may also be cases where warnings are emitted even though 1801 the code that is generated will be compatible. 1802 1803 You should rewrite your code to avoid these warnings if you are 1804 concerned about the fact that code generated by G++ may not be 1805 binary compatible with code generated by other compilers. 1806 1807 The known incompatibilities at this point include: 1808 1809 * Incorrect handling of tail-padding for bit-fields. G++ may 1810 attempt to pack data into the same byte as a base class. For 1811 example: 1812 1813 struct A { virtual void f(); int f1 : 1; }; 1814 struct B : public A { int f2 : 1; }; 1815 1816 In this case, G++ will place `B::f2' into the same byte 1817 as`A::f1'; other compilers will not. You can avoid this 1818 problem by explicitly padding `A' so that its size is a 1819 multiple of the byte size on your platform; that will cause 1820 G++ and other compilers to layout `B' identically. 1821 1822 * Incorrect handling of tail-padding for virtual bases. G++ 1823 does not use tail padding when laying out virtual bases. For 1824 example: 1825 1826 struct A { virtual void f(); char c1; }; 1827 struct B { B(); char c2; }; 1828 struct C : public A, public virtual B {}; 1829 1830 In this case, G++ will not place `B' into the tail-padding for 1831 `A'; other compilers will. You can avoid this problem by 1832 explicitly padding `A' so that its size is a multiple of its 1833 alignment (ignoring virtual base classes); that will cause 1834 G++ and other compilers to layout `C' identically. 1835 1836 * Incorrect handling of bit-fields with declared widths greater 1837 than that of their underlying types, when the bit-fields 1838 appear in a union. For example: 1839 1840 union U { int i : 4096; }; 1841 1842 Assuming that an `int' does not have 4096 bits, G++ will make 1843 the union too small by the number of bits in an `int'. 1844 1845 * Empty classes can be placed at incorrect offsets. For 1846 example: 1847 1848 struct A {}; 1849 1850 struct B { 1851 A a; 1852 virtual void f (); 1853 }; 1854 1855 struct C : public B, public A {}; 1856 1857 G++ will place the `A' base class of `C' at a nonzero offset; 1858 it should be placed at offset zero. G++ mistakenly believes 1859 that the `A' data member of `B' is already at offset zero. 1860 1861 * Names of template functions whose types involve `typename' or 1862 template template parameters can be mangled incorrectly. 1863 1864 template <typename Q> 1865 void f(typename Q::X) {} 1866 1867 template <template <typename> class Q> 1868 void f(typename Q<int>::X) {} 1869 1870 Instantiations of these templates may be mangled incorrectly. 1871 1872 1873`-Wctor-dtor-privacy (C++ only)' 1874 Warn when a class seems unusable because all the constructors or 1875 destructors in that class are private, and it has neither friends 1876 nor public static member functions. 1877 1878`-Wnon-virtual-dtor (C++ only)' 1879 Warn when a class appears to be polymorphic, thereby requiring a 1880 virtual destructor, yet it declares a non-virtual one. This 1881 warning is also enabled if -Weffc++ is specified. 1882 1883`-Wreorder (C++ only)' 1884 Warn when the order of member initializers given in the code does 1885 not match the order in which they must be executed. For instance: 1886 1887 struct A { 1888 int i; 1889 int j; 1890 A(): j (0), i (1) { } 1891 }; 1892 1893 The compiler will rearrange the member initializers for `i' and 1894 `j' to match the declaration order of the members, emitting a 1895 warning to that effect. This warning is enabled by `-Wall'. 1896 1897 The following `-W...' options are not affected by `-Wall'. 1898 1899`-Weffc++ (C++ only)' 1900 Warn about violations of the following style guidelines from Scott 1901 Meyers' `Effective C++' book: 1902 1903 * Item 11: Define a copy constructor and an assignment 1904 operator for classes with dynamically allocated memory. 1905 1906 * Item 12: Prefer initialization to assignment in constructors. 1907 1908 * Item 14: Make destructors virtual in base classes. 1909 1910 * Item 15: Have `operator=' return a reference to `*this'. 1911 1912 * Item 23: Don't try to return a reference when you must 1913 return an object. 1914 1915 1916 Also warn about violations of the following style guidelines from 1917 Scott Meyers' `More Effective C++' book: 1918 1919 * Item 6: Distinguish between prefix and postfix forms of 1920 increment and decrement operators. 1921 1922 * Item 7: Never overload `&&', `||', or `,'. 1923 1924 1925 When selecting this option, be aware that the standard library 1926 headers do not obey all of these guidelines; use `grep -v' to 1927 filter out those warnings. 1928 1929`-Wno-deprecated (C++ only)' 1930 Do not warn about usage of deprecated features. *Note Deprecated 1931 Features::. 1932 1933`-Wstrict-null-sentinel (C++ only)' 1934 Warn also about the use of an uncasted `NULL' as sentinel. When 1935 compiling only with GCC this is a valid sentinel, as `NULL' is 1936 defined to `__null'. Although it is a null pointer constant not a 1937 null pointer, it is guaranteed to of the same size as a pointer. 1938 But this use is not portable across different compilers. 1939 1940`-Wno-non-template-friend (C++ only)' 1941 Disable warnings when non-templatized friend functions are declared 1942 within a template. Since the advent of explicit template 1943 specification support in G++, if the name of the friend is an 1944 unqualified-id (i.e., `friend foo(int)'), the C++ language 1945 specification demands that the friend declare or define an 1946 ordinary, nontemplate function. (Section 14.5.3). Before G++ 1947 implemented explicit specification, unqualified-ids could be 1948 interpreted as a particular specialization of a templatized 1949 function. Because this non-conforming behavior is no longer the 1950 default behavior for G++, `-Wnon-template-friend' allows the 1951 compiler to check existing code for potential trouble spots and is 1952 on by default. This new compiler behavior can be turned off with 1953 `-Wno-non-template-friend' which keeps the conformant compiler code 1954 but disables the helpful warning. 1955 1956`-Wold-style-cast (C++ only)' 1957 Warn if an old-style (C-style) cast to a non-void type is used 1958 within a C++ program. The new-style casts (`dynamic_cast', 1959 `static_cast', `reinterpret_cast', and `const_cast') are less 1960 vulnerable to unintended effects and much easier to search for. 1961 1962`-Woverloaded-virtual (C++ only)' 1963 Warn when a function declaration hides virtual functions from a 1964 base class. For example, in: 1965 1966 struct A { 1967 virtual void f(); 1968 }; 1969 1970 struct B: public A { 1971 void f(int); 1972 }; 1973 1974 the `A' class version of `f' is hidden in `B', and code like: 1975 1976 B* b; 1977 b->f(); 1978 1979 will fail to compile. 1980 1981`-Wno-pmf-conversions (C++ only)' 1982 Disable the diagnostic for converting a bound pointer to member 1983 function to a plain pointer. 1984 1985`-Wsign-promo (C++ only)' 1986 Warn when overload resolution chooses a promotion from unsigned or 1987 enumerated type to a signed type, over a conversion to an unsigned 1988 type of the same size. Previous versions of G++ would try to 1989 preserve unsignedness, but the standard mandates the current 1990 behavior. 1991 1992 struct A { 1993 operator int (); 1994 A& operator = (int); 1995 }; 1996 1997 main () 1998 { 1999 A a,b; 2000 a = b; 2001 } 2002 2003 In this example, G++ will synthesize a default `A& operator = 2004 (const A&);', while cfront will use the user-defined `operator ='. 2005 2006 2007File: gcc.info, Node: Objective-C and Objective-C++ Dialect Options, Next: Language Independent Options, Prev: C++ Dialect Options, Up: Invoking GCC 2008 20093.6 Options Controlling Objective-C and Objective-C++ Dialects 2010============================================================== 2011 2012(NOTE: This manual does not describe the Objective-C and Objective-C++ 2013languages themselves. See *Note Language Standards Supported by GCC: 2014Standards, for references.) 2015 2016 This section describes the command-line options that are only 2017meaningful for Objective-C and Objective-C++ programs, but you can also 2018use most of the language-independent GNU compiler options. For 2019example, you might compile a file `some_class.m' like this: 2020 2021 gcc -g -fgnu-runtime -O -c some_class.m 2022 2023In this example, `-fgnu-runtime' is an option meant only for 2024Objective-C and Objective-C++ programs; you can use the other options 2025with any language supported by GCC. 2026 2027 Note that since Objective-C is an extension of the C language, 2028Objective-C compilations may also use options specific to the C 2029front-end (e.g., `-Wtraditional'). Similarly, Objective-C++ 2030compilations may use C++-specific options (e.g., `-Wabi'). 2031 2032 Here is a list of options that are _only_ for compiling Objective-C 2033and Objective-C++ programs: 2034 2035`-fconstant-string-class=CLASS-NAME' 2036 Use CLASS-NAME as the name of the class to instantiate for each 2037 literal string specified with the syntax `@"..."'. The default 2038 class name is `NXConstantString' if the GNU runtime is being used, 2039 and `NSConstantString' if the NeXT runtime is being used (see 2040 below). The `-fconstant-cfstrings' option, if also present, will 2041 override the `-fconstant-string-class' setting and cause `@"..."' 2042 literals to be laid out as constant CoreFoundation strings. 2043 2044`-fgnu-runtime' 2045 Generate object code compatible with the standard GNU Objective-C 2046 runtime. This is the default for most types of systems. 2047 2048`-fnext-runtime' 2049 Generate output compatible with the NeXT runtime. This is the 2050 default for NeXT-based systems, including Darwin and Mac OS X. 2051 The macro `__NEXT_RUNTIME__' is predefined if (and only if) this 2052 option is used. 2053 2054`-fno-nil-receivers' 2055 Assume that all Objective-C message dispatches (e.g., `[receiver 2056 message:arg]') in this translation unit ensure that the receiver 2057 is not `nil'. This allows for more efficient entry points in the 2058 runtime to be used. Currently, this option is only available in 2059 conjunction with the NeXT runtime on Mac OS X 10.3 and later. 2060 2061`-fobjc-call-cxx-cdtors' 2062 For each Objective-C class, check if any of its instance variables 2063 is a C++ object with a non-trivial default constructor. If so, 2064 synthesize a special `- (id) .cxx_construct' instance method that 2065 will run non-trivial default constructors on any such instance 2066 variables, in order, and then return `self'. Similarly, check if 2067 any instance variable is a C++ object with a non-trivial 2068 destructor, and if so, synthesize a special `- (void) 2069 .cxx_destruct' method that will run all such default destructors, 2070 in reverse order. 2071 2072 The `- (id) .cxx_construct' and/or `- (void) .cxx_destruct' methods 2073 thusly generated will only operate on instance variables declared 2074 in the current Objective-C class, and not those inherited from 2075 superclasses. It is the responsibility of the Objective-C runtime 2076 to invoke all such methods in an object's inheritance hierarchy. 2077 The `- (id) .cxx_construct' methods will be invoked by the runtime 2078 immediately after a new object instance is allocated; the `- 2079 (void) .cxx_destruct' methods will be invoked immediately before 2080 the runtime deallocates an object instance. 2081 2082 As of this writing, only the NeXT runtime on Mac OS X 10.4 and 2083 later has support for invoking the `- (id) .cxx_construct' and `- 2084 (void) .cxx_destruct' methods. 2085 2086`-fobjc-direct-dispatch' 2087 Allow fast jumps to the message dispatcher. On Darwin this is 2088 accomplished via the comm page. 2089 2090`-fobjc-exceptions' 2091 Enable syntactic support for structured exception handling in 2092 Objective-C, similar to what is offered by C++ and Java. This 2093 option is unavailable in conjunction with the NeXT runtime on Mac 2094 OS X 10.2 and earlier. 2095 2096 @try { 2097 ... 2098 @throw expr; 2099 ... 2100 } 2101 @catch (AnObjCClass *exc) { 2102 ... 2103 @throw expr; 2104 ... 2105 @throw; 2106 ... 2107 } 2108 @catch (AnotherClass *exc) { 2109 ... 2110 } 2111 @catch (id allOthers) { 2112 ... 2113 } 2114 @finally { 2115 ... 2116 @throw expr; 2117 ... 2118 } 2119 2120 The `@throw' statement may appear anywhere in an Objective-C or 2121 Objective-C++ program; when used inside of a `@catch' block, the 2122 `@throw' may appear without an argument (as shown above), in which 2123 case the object caught by the `@catch' will be rethrown. 2124 2125 Note that only (pointers to) Objective-C objects may be thrown and 2126 caught using this scheme. When an object is thrown, it will be 2127 caught by the nearest `@catch' clause capable of handling objects 2128 of that type, analogously to how `catch' blocks work in C++ and 2129 Java. A `@catch(id ...)' clause (as shown above) may also be 2130 provided to catch any and all Objective-C exceptions not caught by 2131 previous `@catch' clauses (if any). 2132 2133 The `@finally' clause, if present, will be executed upon exit from 2134 the immediately preceding `@try ... @catch' section. This will 2135 happen regardless of whether any exceptions are thrown, caught or 2136 rethrown inside the `@try ... @catch' section, analogously to the 2137 behavior of the `finally' clause in Java. 2138 2139 There are several caveats to using the new exception mechanism: 2140 2141 * Although currently designed to be binary compatible with 2142 `NS_HANDLER'-style idioms provided by the `NSException' 2143 class, the new exceptions can only be used on Mac OS X 10.3 2144 (Panther) and later systems, due to additional functionality 2145 needed in the (NeXT) Objective-C runtime. 2146 2147 * As mentioned above, the new exceptions do not support handling 2148 types other than Objective-C objects. Furthermore, when 2149 used from Objective-C++, the Objective-C exception model does 2150 not interoperate with C++ exceptions at this time. This 2151 means you cannot `@throw' an exception from Objective-C and 2152 `catch' it in C++, or vice versa (i.e., `throw ... @catch'). 2153 2154 The `-fobjc-exceptions' switch also enables the use of 2155 synchronization blocks for thread-safe execution: 2156 2157 @synchronized (ObjCClass *guard) { 2158 ... 2159 } 2160 2161 Upon entering the `@synchronized' block, a thread of execution 2162 shall first check whether a lock has been placed on the 2163 corresponding `guard' object by another thread. If it has, the 2164 current thread shall wait until the other thread relinquishes its 2165 lock. Once `guard' becomes available, the current thread will 2166 place its own lock on it, execute the code contained in the 2167 `@synchronized' block, and finally relinquish the lock (thereby 2168 making `guard' available to other threads). 2169 2170 Unlike Java, Objective-C does not allow for entire methods to be 2171 marked `@synchronized'. Note that throwing exceptions out of 2172 `@synchronized' blocks is allowed, and will cause the guarding 2173 object to be unlocked properly. 2174 2175`-fobjc-gc' 2176 Enable garbage collection (GC) in Objective-C and Objective-C++ 2177 programs. 2178 2179`-freplace-objc-classes' 2180 Emit a special marker instructing `ld(1)' not to statically link in 2181 the resulting object file, and allow `dyld(1)' to load it in at 2182 run time instead. This is used in conjunction with the 2183 Fix-and-Continue debugging mode, where the object file in question 2184 may be recompiled and dynamically reloaded in the course of 2185 program execution, without the need to restart the program itself. 2186 Currently, Fix-and-Continue functionality is only available in 2187 conjunction with the NeXT runtime on Mac OS X 10.3 and later. 2188 2189`-fzero-link' 2190 When compiling for the NeXT runtime, the compiler ordinarily 2191 replaces calls to `objc_getClass("...")' (when the name of the 2192 class is known at compile time) with static class references that 2193 get initialized at load time, which improves run-time performance. 2194 Specifying the `-fzero-link' flag suppresses this behavior and 2195 causes calls to `objc_getClass("...")' to be retained. This is 2196 useful in Zero-Link debugging mode, since it allows for individual 2197 class implementations to be modified during program execution. 2198 2199`-gen-decls' 2200 Dump interface declarations for all classes seen in the source 2201 file to a file named `SOURCENAME.decl'. 2202 2203`-Wassign-intercept' 2204 Warn whenever an Objective-C assignment is being intercepted by the 2205 garbage collector. 2206 2207`-Wno-protocol' 2208 If a class is declared to implement a protocol, a warning is 2209 issued for every method in the protocol that is not implemented by 2210 the class. The default behavior is to issue a warning for every 2211 method not explicitly implemented in the class, even if a method 2212 implementation is inherited from the superclass. If you use the 2213 `-Wno-protocol' option, then methods inherited from the superclass 2214 are considered to be implemented, and no warning is issued for 2215 them. 2216 2217`-Wselector' 2218 Warn if multiple methods of different types for the same selector 2219 are found during compilation. The check is performed on the list 2220 of methods in the final stage of compilation. Additionally, a 2221 check is performed for each selector appearing in a 2222 `@selector(...)' expression, and a corresponding method for that 2223 selector has been found during compilation. Because these checks 2224 scan the method table only at the end of compilation, these 2225 warnings are not produced if the final stage of compilation is not 2226 reached, for example because an error is found during compilation, 2227 or because the `-fsyntax-only' option is being used. 2228 2229`-Wstrict-selector-match' 2230 Warn if multiple methods with differing argument and/or return 2231 types are found for a given selector when attempting to send a 2232 message using this selector to a receiver of type `id' or `Class'. 2233 When this flag is off (which is the default behavior), the 2234 compiler will omit such warnings if any differences found are 2235 confined to types which share the same size and alignment. 2236 2237`-Wundeclared-selector' 2238 Warn if a `@selector(...)' expression referring to an undeclared 2239 selector is found. A selector is considered undeclared if no 2240 method with that name has been declared before the 2241 `@selector(...)' expression, either explicitly in an `@interface' 2242 or `@protocol' declaration, or implicitly in an `@implementation' 2243 section. This option always performs its checks as soon as a 2244 `@selector(...)' expression is found, while `-Wselector' only 2245 performs its checks in the final stage of compilation. This also 2246 enforces the coding style convention that methods and selectors 2247 must be declared before being used. 2248 2249`-print-objc-runtime-info' 2250 Generate C header describing the largest structure that is passed 2251 by value, if any. 2252 2253 2254 2255File: gcc.info, Node: Language Independent Options, Next: Warning Options, Prev: Objective-C and Objective-C++ Dialect Options, Up: Invoking GCC 2256 22573.7 Options to Control Diagnostic Messages Formatting 2258===================================================== 2259 2260Traditionally, diagnostic messages have been formatted irrespective of 2261the output device's aspect (e.g. its width, ...). The options described 2262below can be used to control the diagnostic messages formatting 2263algorithm, e.g. how many characters per line, how often source location 2264information should be reported. Right now, only the C++ front end can 2265honor these options. However it is expected, in the near future, that 2266the remaining front ends would be able to digest them correctly. 2267 2268`-fmessage-length=N' 2269 Try to format error messages so that they fit on lines of about N 2270 characters. The default is 72 characters for `g++' and 0 for the 2271 rest of the front ends supported by GCC. If N is zero, then no 2272 line-wrapping will be done; each error message will appear on a 2273 single line. 2274 2275`-fdiagnostics-show-location=once' 2276 Only meaningful in line-wrapping mode. Instructs the diagnostic 2277 messages reporter to emit _once_ source location information; that 2278 is, in case the message is too long to fit on a single physical 2279 line and has to be wrapped, the source location won't be emitted 2280 (as prefix) again, over and over, in subsequent continuation 2281 lines. This is the default behavior. 2282 2283`-fdiagnostics-show-location=every-line' 2284 Only meaningful in line-wrapping mode. Instructs the diagnostic 2285 messages reporter to emit the same source location information (as 2286 prefix) for physical lines that result from the process of breaking 2287 a message which is too long to fit on a single line. 2288 2289`-fdiagnostics-show-option' 2290 This option instructs the diagnostic machinery to add text to each 2291 diagnostic emitted, which indicates which command line option 2292 directly controls that diagnostic, when such an option is known to 2293 the diagnostic machinery. 2294 2295 2296 2297File: gcc.info, Node: Warning Options, Next: Debugging Options, Prev: Language Independent Options, Up: Invoking GCC 2298 22993.8 Options to Request or Suppress Warnings 2300=========================================== 2301 2302Warnings are diagnostic messages that report constructions which are 2303not inherently erroneous but which are risky or suggest there may have 2304been an error. 2305 2306 You can request many specific warnings with options beginning `-W', 2307for example `-Wimplicit' to request warnings on implicit declarations. 2308Each of these specific warning options also has a negative form 2309beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'. 2310This manual lists only one of the two forms, whichever is not the 2311default. 2312 2313 The following options control the amount and kinds of warnings produced 2314by GCC; for further, language-specific options also refer to *Note C++ 2315Dialect Options:: and *Note Objective-C and Objective-C++ Dialect 2316Options::. 2317 2318`-fsyntax-only' 2319 Check the code for syntax errors, but don't do anything beyond 2320 that. 2321 2322`-pedantic' 2323 Issue all the warnings demanded by strict ISO C and ISO C++; 2324 reject all programs that use forbidden extensions, and some other 2325 programs that do not follow ISO C and ISO C++. For ISO C, follows 2326 the version of the ISO C standard specified by any `-std' option 2327 used. 2328 2329 Valid ISO C and ISO C++ programs should compile properly with or 2330 without this option (though a rare few will require `-ansi' or a 2331 `-std' option specifying the required version of ISO C). However, 2332 without this option, certain GNU extensions and traditional C and 2333 C++ features are supported as well. With this option, they are 2334 rejected. 2335 2336 `-pedantic' does not cause warning messages for use of the 2337 alternate keywords whose names begin and end with `__'. Pedantic 2338 warnings are also disabled in the expression that follows 2339 `__extension__'. However, only system header files should use 2340 these escape routes; application programs should avoid them. 2341 *Note Alternate Keywords::. 2342 2343 Some users try to use `-pedantic' to check programs for strict ISO 2344 C conformance. They soon find that it does not do quite what they 2345 want: it finds some non-ISO practices, but not all--only those for 2346 which ISO C _requires_ a diagnostic, and some others for which 2347 diagnostics have been added. 2348 2349 A feature to report any failure to conform to ISO C might be 2350 useful in some instances, but would require considerable 2351 additional work and would be quite different from `-pedantic'. We 2352 don't have plans to support such a feature in the near future. 2353 2354 Where the standard specified with `-std' represents a GNU extended 2355 dialect of C, such as `gnu89' or `gnu99', there is a corresponding 2356 "base standard", the version of ISO C on which the GNU extended 2357 dialect is based. Warnings from `-pedantic' are given where they 2358 are required by the base standard. (It would not make sense for 2359 such warnings to be given only for features not in the specified 2360 GNU C dialect, since by definition the GNU dialects of C include 2361 all features the compiler supports with the given option, and 2362 there would be nothing to warn about.) 2363 2364`-pedantic-errors' 2365 Like `-pedantic', except that errors are produced rather than 2366 warnings. 2367 2368`-w' 2369 Inhibit all warning messages. 2370 2371`-Wno-import' 2372 Inhibit warning messages about the use of `#import'. 2373 2374`-Wchar-subscripts' 2375 Warn if an array subscript has type `char'. This is a common cause 2376 of error, as programmers often forget that this type is signed on 2377 some machines. This warning is enabled by `-Wall'. 2378 2379`-Wcomment' 2380 Warn whenever a comment-start sequence `/*' appears in a `/*' 2381 comment, or whenever a Backslash-Newline appears in a `//' comment. 2382 This warning is enabled by `-Wall'. 2383 2384`-Wfatal-errors' 2385 This option causes the compiler to abort compilation on the first 2386 error occurred rather than trying to keep going and printing 2387 further error messages. 2388 2389`-Wbounded' 2390 Check calls to functions with the `bounded' attribute (*note Function 2391 Attributes::). 2392 2393`-Wformat' 2394 Check calls to `printf' and `scanf', etc., to make sure that the 2395 arguments supplied have types appropriate to the format string 2396 specified, and that the conversions specified in the format string 2397 make sense. This includes standard functions, and others 2398 specified by format attributes (*note Function Attributes::), in 2399 the `printf', `scanf', `strftime' and `strfmon' (an X/Open 2400 extension, not in the C standard) families (or other 2401 target-specific families). Which functions are checked without 2402 format attributes having been specified depends on the standard 2403 version selected, and such checks of functions without the 2404 attribute specified are disabled by `-ffreestanding' or 2405 `-fno-builtin'. 2406 2407 The formats are checked against the format features supported by 2408 GNU libc version 2.2. These include all ISO C90 and C99 features, 2409 as well as features from the Single Unix Specification and some 2410 BSD and GNU extensions. Other library implementations may not 2411 support all these features; GCC does not support warning about 2412 features that go beyond a particular library's limitations. 2413 However, if `-pedantic' is used with `-Wformat', warnings will be 2414 given about format features not in the selected standard version 2415 (but not for `strfmon' formats, since those are not in any version 2416 of the C standard). *Note Options Controlling C Dialect: C 2417 Dialect Options. 2418 2419 Since `-Wformat' also checks for null format arguments for several 2420 functions, `-Wformat' also implies `-Wnonnull'. 2421 2422 `-Wformat' is included in `-Wall'. For more control over some 2423 aspects of format checking, the options `-Wformat-y2k', 2424 `-Wno-format-extra-args', `-Wno-format-zero-length', 2425 `-Wformat-nonliteral', `-Wformat-security', and `-Wformat=2' are 2426 available, but are not included in `-Wall'. 2427 2428`-Wformat-y2k' 2429 If `-Wformat' is specified, also warn about `strftime' formats 2430 which may yield only a two-digit year. 2431 2432`-Wno-format-extra-args' 2433 If `-Wformat' is specified, do not warn about excess arguments to a 2434 `printf' or `scanf' format function. The C standard specifies 2435 that such arguments are ignored. 2436 2437 Where the unused arguments lie between used arguments that are 2438 specified with `$' operand number specifications, normally 2439 warnings are still given, since the implementation could not know 2440 what type to pass to `va_arg' to skip the unused arguments. 2441 However, in the case of `scanf' formats, this option will suppress 2442 the warning if the unused arguments are all pointers, since the 2443 Single Unix Specification says that such unused arguments are 2444 allowed. 2445 2446`-Wno-format-zero-length' 2447 If `-Wformat' is specified, do not warn about zero-length formats. 2448 The C standard specifies that zero-length formats are allowed. 2449 2450`-Wformat-nonliteral' 2451 If `-Wformat' is specified, also warn if the format string is not a 2452 string literal and so cannot be checked, unless the format function 2453 takes its format arguments as a `va_list'. 2454 2455`-Wformat-security' 2456 If `-Wformat' is specified, also warn about uses of format 2457 functions that represent possible security problems. At present, 2458 this warns about calls to `printf' and `scanf' functions where the 2459 format string is not a string literal and there are no format 2460 arguments, as in `printf (foo);'. This may be a security hole if 2461 the format string came from untrusted input and contains `%n'. 2462 (This is currently a subset of what `-Wformat-nonliteral' warns 2463 about, but in future warnings may be added to `-Wformat-security' 2464 that are not included in `-Wformat-nonliteral'.) 2465 2466`-Wformat=2' 2467 Enable `-Wformat' plus format checks not included in `-Wformat'. 2468 Currently equivalent to `-Wformat -Wformat-nonliteral 2469 -Wformat-security -Wformat-y2k'. 2470 2471`-Wnonnull' 2472 Warn about passing a null pointer for arguments marked as 2473 requiring a non-null value by the `nonnull' function attribute. 2474 2475 `-Wnonnull' is included in `-Wall' and `-Wformat'. It can be 2476 disabled with the `-Wno-nonnull' option. 2477 2478`-Winit-self (C, C++, Objective-C and Objective-C++ only)' 2479 Warn about uninitialized variables which are initialized with 2480 themselves. Note this option can only be used with the 2481 `-Wuninitialized' option, which in turn only works with `-O1' and 2482 above. 2483 2484 For example, GCC will warn about `i' being uninitialized in the 2485 following snippet only when `-Winit-self' has been specified: 2486 int f() 2487 { 2488 int i = i; 2489 return i; 2490 } 2491 2492`-Wimplicit-int' 2493 Warn when a declaration does not specify a type. This warning is 2494 enabled by `-Wall'. 2495 2496`-Wimplicit-function-declaration' 2497`-Werror-implicit-function-declaration' 2498 Give a warning (or error) whenever a function is used before being 2499 declared. The form `-Wno-error-implicit-function-declaration' is 2500 not supported. This warning is enabled by `-Wall' (as a warning, 2501 not an error). 2502 2503`-Wimplicit' 2504 Same as `-Wimplicit-int' and `-Wimplicit-function-declaration'. 2505 This warning is enabled by `-Wall'. 2506 2507`-Wmain' 2508 Warn if the type of `main' is suspicious. `main' should be a 2509 function with external linkage, returning int, taking either zero 2510 arguments, two, or three arguments of appropriate types. This 2511 warning is enabled by `-Wall'. 2512 2513`-Wmissing-braces' 2514 Warn if an aggregate or union initializer is not fully bracketed. 2515 In the following example, the initializer for `a' is not fully 2516 bracketed, but that for `b' is fully bracketed. 2517 2518 int a[2][2] = { 0, 1, 2, 3 }; 2519 int b[2][2] = { { 0, 1 }, { 2, 3 } }; 2520 2521 This warning is enabled by `-Wall'. 2522 2523`-Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)' 2524 Warn if a user-supplied include directory does not exist. 2525 2526`-Wparentheses' 2527 Warn if parentheses are omitted in certain contexts, such as when 2528 there is an assignment in a context where a truth value is 2529 expected, or when operators are nested whose precedence people 2530 often get confused about. Only the warning for an assignment used 2531 as a truth value is supported when compiling C++; the other 2532 warnings are only supported when compiling C. 2533 2534 Also warn if a comparison like `x<=y<=z' appears; this is 2535 equivalent to `(x<=y ? 1 : 0) <= z', which is a different 2536 interpretation from that of ordinary mathematical notation. 2537 2538 Also warn about constructions where there may be confusion to which 2539 `if' statement an `else' branch belongs. Here is an example of 2540 such a case: 2541 2542 { 2543 if (a) 2544 if (b) 2545 foo (); 2546 else 2547 bar (); 2548 } 2549 2550 In C, every `else' branch belongs to the innermost possible `if' 2551 statement, which in this example is `if (b)'. This is often not 2552 what the programmer expected, as illustrated in the above example 2553 by indentation the programmer chose. When there is the potential 2554 for this confusion, GCC will issue a warning when this flag is 2555 specified. To eliminate the warning, add explicit braces around 2556 the innermost `if' statement so there is no way the `else' could 2557 belong to the enclosing `if'. The resulting code would look like 2558 this: 2559 2560 { 2561 if (a) 2562 { 2563 if (b) 2564 foo (); 2565 else 2566 bar (); 2567 } 2568 } 2569 2570 This warning is enabled by `-Wall'. 2571 2572`-Wsequence-point' 2573 Warn about code that may have undefined semantics because of 2574 violations of sequence point rules in the C and C++ standards. 2575 2576 The C and C++ standards defines the order in which expressions in 2577 a C/C++ program are evaluated in terms of "sequence points", which 2578 represent a partial ordering between the execution of parts of the 2579 program: those executed before the sequence point, and those 2580 executed after it. These occur after the evaluation of a full 2581 expression (one which is not part of a larger expression), after 2582 the evaluation of the first operand of a `&&', `||', `? :' or `,' 2583 (comma) operator, before a function is called (but after the 2584 evaluation of its arguments and the expression denoting the called 2585 function), and in certain other places. Other than as expressed 2586 by the sequence point rules, the order of evaluation of 2587 subexpressions of an expression is not specified. All these rules 2588 describe only a partial order rather than a total order, since, 2589 for example, if two functions are called within one expression 2590 with no sequence point between them, the order in which the 2591 functions are called is not specified. However, the standards 2592 committee have ruled that function calls do not overlap. 2593 2594 It is not specified when between sequence points modifications to 2595 the values of objects take effect. Programs whose behavior 2596 depends on this have undefined behavior; the C and C++ standards 2597 specify that "Between the previous and next sequence point an 2598 object shall have its stored value modified at most once by the 2599 evaluation of an expression. Furthermore, the prior value shall 2600 be read only to determine the value to be stored.". If a program 2601 breaks these rules, the results on any particular implementation 2602 are entirely unpredictable. 2603 2604 Examples of code with undefined behavior are `a = a++;', `a[n] = 2605 b[n++]' and `a[i++] = i;'. Some more complicated cases are not 2606 diagnosed by this option, and it may give an occasional false 2607 positive result, but in general it has been found fairly effective 2608 at detecting this sort of problem in programs. 2609 2610 The standard is worded confusingly, therefore there is some debate 2611 over the precise meaning of the sequence point rules in subtle 2612 cases. Links to discussions of the problem, including proposed 2613 formal definitions, may be found on the GCC readings page, at 2614 `http://gcc.gnu.org/readings.html'. 2615 2616 This warning is enabled by `-Wall' for C and C++. 2617 2618`-Wreturn-type' 2619 Warn whenever a function is defined with a return-type that 2620 defaults to `int'. Also warn about any `return' statement with no 2621 return-value in a function whose return-type is not `void'. 2622 2623 For C, also warn if the return type of a function has a type 2624 qualifier such as `const'. Such a type qualifier has no effect, 2625 since the value returned by a function is not an lvalue. ISO C 2626 prohibits qualified `void' return types on function definitions, 2627 so such return types always receive a warning even without this 2628 option. 2629 2630 For C++, a function without return type always produces a 2631 diagnostic message, even when `-Wno-return-type' is specified. 2632 The only exceptions are `main' and functions defined in system 2633 headers. 2634 2635 This warning is enabled by `-Wall'. 2636 2637`-Wswitch' 2638 Warn whenever a `switch' statement has an index of enumerated type 2639 and lacks a `case' for one or more of the named codes of that 2640 enumeration. (The presence of a `default' label prevents this 2641 warning.) `case' labels outside the enumeration range also 2642 provoke warnings when this option is used. This warning is 2643 enabled by `-Wall'. 2644 2645`-Wswitch-default' 2646 Warn whenever a `switch' statement does not have a `default' case. 2647 2648`-Wswitch-enum' 2649 Warn whenever a `switch' statement has an index of enumerated type 2650 and lacks a `case' for one or more of the named codes of that 2651 enumeration. `case' labels outside the enumeration range also 2652 provoke warnings when this option is used. 2653 2654`-Wtrigraphs' 2655 Warn if any trigraphs are encountered that might change the 2656 meaning of the program (trigraphs within comments are not warned 2657 about). This warning is enabled by `-Wall'. 2658 2659`-Wunused-function' 2660 Warn whenever a static function is declared but not defined or a 2661 non-inline static function is unused. This warning is enabled by 2662 `-Wall'. 2663 2664`-Wunused-label' 2665 Warn whenever a label is declared but not used. This warning is 2666 enabled by `-Wall'. 2667 2668 To suppress this warning use the `unused' attribute (*note 2669 Variable Attributes::). 2670 2671`-Wunused-parameter' 2672 Warn whenever a function parameter is unused aside from its 2673 declaration. 2674 2675 To suppress this warning use the `unused' attribute (*note 2676 Variable Attributes::). 2677 2678`-Wunused-variable' 2679 Warn whenever a local variable or non-constant static variable is 2680 unused aside from its declaration. This warning is enabled by 2681 `-Wall'. 2682 2683 To suppress this warning use the `unused' attribute (*note 2684 Variable Attributes::). 2685 2686`-Wunused-value' 2687 Warn whenever a statement computes a result that is explicitly not 2688 used. This warning is enabled by `-Wall'. 2689 2690 To suppress this warning cast the expression to `void'. 2691 2692`-Wunused' 2693 All the above `-Wunused' options combined. 2694 2695 In order to get a warning about an unused function parameter, you 2696 must either specify `-Wextra -Wunused' (note that `-Wall' implies 2697 `-Wunused'), or separately specify `-Wunused-parameter'. 2698 2699`-Wuninitialized' 2700 Warn if an automatic variable is used without first being 2701 initialized or if a variable may be clobbered by a `setjmp' call. 2702 2703 These warnings are possible only in optimizing compilation, 2704 because they require data flow information that is computed only 2705 when optimizing. If you do not specify `-O', you will not get 2706 these warnings. Instead, GCC will issue a warning about 2707 `-Wuninitialized' requiring `-O'. 2708 2709 If you want to warn about code which uses the uninitialized value 2710 of the variable in its own initializer, use the `-Winit-self' 2711 option. 2712 2713 These warnings occur for individual uninitialized or clobbered 2714 elements of structure, union or array variables as well as for 2715 variables which are uninitialized or clobbered as a whole. They do 2716 not occur for variables or elements declared `volatile'. Because 2717 these warnings depend on optimization, the exact variables or 2718 elements for which there are warnings will depend on the precise 2719 optimization options and version of GCC used. 2720 2721 Note that there may be no warning about a variable that is used 2722 only to compute a value that itself is never used, because such 2723 computations may be deleted by data flow analysis before the 2724 warnings are printed. 2725 2726 These warnings are made optional because GCC is not smart enough 2727 to see all the reasons why the code might be correct despite 2728 appearing to have an error. Here is one example of how this can 2729 happen: 2730 2731 { 2732 int x; 2733 switch (y) 2734 { 2735 case 1: x = 1; 2736 break; 2737 case 2: x = 4; 2738 break; 2739 case 3: x = 5; 2740 } 2741 foo (x); 2742 } 2743 2744 If the value of `y' is always 1, 2 or 3, then `x' is always 2745 initialized, but GCC doesn't know this. Here is another common 2746 case: 2747 2748 { 2749 int save_y; 2750 if (change_y) save_y = y, y = new_y; 2751 ... 2752 if (change_y) y = save_y; 2753 } 2754 2755 This has no bug because `save_y' is used only if it is set. 2756 2757 This option also warns when a non-volatile automatic variable 2758 might be changed by a call to `longjmp'. These warnings as well 2759 are possible only in optimizing compilation. 2760 2761 The compiler sees only the calls to `setjmp'. It cannot know 2762 where `longjmp' will be called; in fact, a signal handler could 2763 call it at any point in the code. As a result, you may get a 2764 warning even when there is in fact no problem because `longjmp' 2765 cannot in fact be called at the place which would cause a problem. 2766 2767 Some spurious warnings can be avoided if you declare all the 2768 functions you use that never return as `noreturn'. *Note Function 2769 Attributes::. 2770 2771 This warning is enabled by `-Wall'. 2772 2773`-Wunknown-pragmas' 2774 Warn when a #pragma directive is encountered which is not 2775 understood by GCC. If this command line option is used, warnings 2776 will even be issued for unknown pragmas in system header files. 2777 This is not the case if the warnings were only enabled by the 2778 `-Wall' command line option. 2779 2780`-Wno-pragmas' 2781 Do not warn about misuses of pragmas, such as incorrect parameters, 2782 invalid syntax, or conflicts between pragmas. See also 2783 `-Wunknown-pragmas'. 2784 2785`-Wstrict-aliasing' 2786 This option is only active when `-fstrict-aliasing' is active. It 2787 warns about code which might break the strict aliasing rules that 2788 the compiler is using for optimization. The warning does not 2789 catch all cases, but does attempt to catch the more common 2790 pitfalls. It is included in `-Wall'. 2791 2792`-Wstrict-aliasing=2' 2793 This option is only active when `-fstrict-aliasing' is active. It 2794 warns about code which might break the strict aliasing rules that 2795 the compiler is using for optimization. This warning catches more 2796 cases than `-Wstrict-aliasing', but it will also give a warning 2797 for some ambiguous cases that are safe. 2798 2799`-Wstrict-overflow' 2800 2801`-Wstrict-overflow=N' 2802 This option is only active when `-fstrict-overflow' is active. It 2803 warns about cases where the compiler optimizes based on the 2804 assumption that signed overflow does not occur. Note that it does 2805 not warn about all cases where the code might overflow: it only 2806 warns about cases where the compiler implements some optimization. 2807 Thus this warning depends on the optimization level. 2808 2809 An optimization which assumes that signed overflow does not occur 2810 is perfectly safe if the values of the variables involved are such 2811 that overflow never does, in fact, occur. Therefore this warning 2812 can easily give a false positive: a warning about code which is not 2813 actually a problem. To help focus on important issues, several 2814 warning levels are defined. No warnings are issued for the use of 2815 undefined signed overflow when estimating how many iterations a 2816 loop will require, in particular when determining whether a loop 2817 will be executed at all. 2818 2819 `-Wstrict-overflow=1' 2820 Warn about cases which are both questionable and easy to 2821 avoid. For example: `x + 1 > x'; with `-fstrict-overflow', 2822 the compiler will simplify this to `1'. This level of 2823 `-Wstrict-overflow' is enabled by `-Wall'; higher levels are 2824 not, and must be explicitly requested. 2825 2826 `-Wstrict-overflow=2' 2827 Also warn about other cases where a comparison is simplified 2828 to a constant. For example: `abs (x) >= 0'. This can only be 2829 simplified when `-fstrict-overflow' is in effect, because 2830 `abs (INT_MIN)' overflows to `INT_MIN', which is less than 2831 zero. `-Wstrict-overflow' (with no level) is the same as 2832 `-Wstrict-overflow=2'. 2833 2834 `-Wstrict-overflow=3' 2835 Also warn about other cases where a comparison is simplified. 2836 For example: `x + 1 > 1' will be simplified to `x > 0'. 2837 2838 `-Wstrict-overflow=4' 2839 Also warn about other simplifications not covered by the 2840 above cases. For example: `(x * 10) / 5' will be simplified 2841 to `x * 2'. 2842 2843 `-Wstrict-overflow=5' 2844 Also warn about cases where the compiler reduces the 2845 magnitude of a constant involved in a comparison. For 2846 example: `x + 2 > y' will be simplified to `x + 1 >= y'. 2847 This is reported only at the highest warning level because 2848 this simplification applies to many comparisons, so this 2849 warning level will give a very large number of false 2850 positives. 2851 2852`-Wall' 2853 All of the above `-W' options combined. This enables all the 2854 warnings about constructions that some users consider 2855 questionable, and that are easy to avoid (or modify to prevent the 2856 warning), even in conjunction with macros. This also enables some 2857 language-specific warnings described in *Note C++ Dialect 2858 Options:: and *Note Objective-C and Objective-C++ Dialect 2859 Options::. 2860 2861 The following `-W...' options are not implied by `-Wall'. Some of 2862them warn about constructions that users generally do not consider 2863questionable, but which occasionally you might wish to check for; 2864others warn about constructions that are necessary or hard to avoid in 2865some cases, and there is no simple way to modify the code to suppress 2866the warning. 2867 2868`-Wextra' 2869 (This option used to be called `-W'. The older name is still 2870 supported, but the newer name is more descriptive.) Print extra 2871 warning messages for these events: 2872 2873 * A function can return either with or without a value. 2874 (Falling off the end of the function body is considered 2875 returning without a value.) For example, this function would 2876 evoke such a warning: 2877 2878 foo (a) 2879 { 2880 if (a > 0) 2881 return a; 2882 } 2883 2884 * An expression-statement or the left-hand side of a comma 2885 expression contains no side effects. To suppress the 2886 warning, cast the unused expression to void. For example, an 2887 expression such as `x[i,j]' will cause a warning, but 2888 `x[(void)i,j]' will not. 2889 2890 * An unsigned value is compared against zero with `<' or `>='. 2891 2892 * Storage-class specifiers like `static' are not the first 2893 things in a declaration. According to the C Standard, this 2894 usage is obsolescent. 2895 2896 * If `-Wall' or `-Wunused' is also specified, warn about unused 2897 arguments. 2898 2899 * A comparison between signed and unsigned values could produce 2900 an incorrect result when the signed value is converted to 2901 unsigned. (But don't warn if `-Wno-sign-compare' is also 2902 specified.) 2903 2904 * An aggregate has an initializer which does not initialize all 2905 members. This warning can be independently controlled by 2906 `-Wmissing-field-initializers'. 2907 2908 * An initialized field without side effects is overridden when 2909 using designated initializers (*note Designated Initializers: 2910 Designated Inits.). This warning can be independently 2911 controlled by `-Woverride-init'. 2912 2913 * A function parameter is declared without a type specifier in 2914 K&R-style functions: 2915 2916 void foo(bar) { } 2917 2918 * An empty body occurs in an `if' or `else' statement. 2919 2920 * A pointer is compared against integer zero with `<', `<=', 2921 `>', or `>='. 2922 2923 * A variable might be changed by `longjmp' or `vfork'. 2924 2925 * (C++ only) An enumerator and a non-enumerator both appear in 2926 a conditional expression. 2927 2928 * (C++ only) A non-static reference or non-static `const' 2929 member appears in a class without constructors. 2930 2931 * (C++ only) Ambiguous virtual bases. 2932 2933 * (C++ only) Subscripting an array which has been declared 2934 `register'. 2935 2936 * (C++ only) Taking the address of a variable which has been 2937 declared `register'. 2938 2939 * (C++ only) A base class is not initialized in a derived 2940 class' copy constructor. 2941 2942`-Wno-div-by-zero' 2943 Do not warn about compile-time integer division by zero. Floating 2944 point division by zero is not warned about, as it can be a 2945 legitimate way of obtaining infinities and NaNs. 2946 2947`-Wsystem-headers' 2948 Print warning messages for constructs found in system header files. 2949 Warnings from system headers are normally suppressed, on the 2950 assumption that they usually do not indicate real problems and 2951 would only make the compiler output harder to read. Using this 2952 command line option tells GCC to emit warnings from system headers 2953 as if they occurred in user code. However, note that using 2954 `-Wall' in conjunction with this option will _not_ warn about 2955 unknown pragmas in system headers--for that, `-Wunknown-pragmas' 2956 must also be used. 2957 2958`-Wfloat-equal' 2959 Warn if floating point values are used in equality comparisons. 2960 2961 The idea behind this is that sometimes it is convenient (for the 2962 programmer) to consider floating-point values as approximations to 2963 infinitely precise real numbers. If you are doing this, then you 2964 need to compute (by analyzing the code, or in some other way) the 2965 maximum or likely maximum error that the computation introduces, 2966 and allow for it when performing comparisons (and when producing 2967 output, but that's a different problem). In particular, instead 2968 of testing for equality, you would check to see whether the two 2969 values have ranges that overlap; and this is done with the 2970 relational operators, so equality comparisons are probably 2971 mistaken. 2972 2973`-Wtraditional (C only)' 2974 Warn about certain constructs that behave differently in 2975 traditional and ISO C. Also warn about ISO C constructs that have 2976 no traditional C equivalent, and/or problematic constructs which 2977 should be avoided. 2978 2979 * Macro parameters that appear within string literals in the 2980 macro body. In traditional C macro replacement takes place 2981 within string literals, but does not in ISO C. 2982 2983 * In traditional C, some preprocessor directives did not exist. 2984 Traditional preprocessors would only consider a line to be a 2985 directive if the `#' appeared in column 1 on the line. 2986 Therefore `-Wtraditional' warns about directives that 2987 traditional C understands but would ignore because the `#' 2988 does not appear as the first character on the line. It also 2989 suggests you hide directives like `#pragma' not understood by 2990 traditional C by indenting them. Some traditional 2991 implementations would not recognize `#elif', so it suggests 2992 avoiding it altogether. 2993 2994 * A function-like macro that appears without arguments. 2995 2996 * The unary plus operator. 2997 2998 * The `U' integer constant suffix, or the `F' or `L' floating 2999 point constant suffixes. (Traditional C does support the `L' 3000 suffix on integer constants.) Note, these suffixes appear in 3001 macros defined in the system headers of most modern systems, 3002 e.g. the `_MIN'/`_MAX' macros in `<limits.h>'. Use of these 3003 macros in user code might normally lead to spurious warnings, 3004 however GCC's integrated preprocessor has enough context to 3005 avoid warning in these cases. 3006 3007 * A function declared external in one block and then used after 3008 the end of the block. 3009 3010 * A `switch' statement has an operand of type `long'. 3011 3012 * A non-`static' function declaration follows a `static' one. 3013 This construct is not accepted by some traditional C 3014 compilers. 3015 3016 * The ISO type of an integer constant has a different width or 3017 signedness from its traditional type. This warning is only 3018 issued if the base of the constant is ten. I.e. hexadecimal 3019 or octal values, which typically represent bit patterns, are 3020 not warned about. 3021 3022 * Usage of ISO string concatenation is detected. 3023 3024 * Initialization of automatic aggregates. 3025 3026 * Identifier conflicts with labels. Traditional C lacks a 3027 separate namespace for labels. 3028 3029 * Initialization of unions. If the initializer is zero, the 3030 warning is omitted. This is done under the assumption that 3031 the zero initializer in user code appears conditioned on e.g. 3032 `__STDC__' to avoid missing initializer warnings and relies 3033 on default initialization to zero in the traditional C case. 3034 3035 * Conversions by prototypes between fixed/floating point values 3036 and vice versa. The absence of these prototypes when 3037 compiling with traditional C would cause serious problems. 3038 This is a subset of the possible conversion warnings, for the 3039 full set use `-Wconversion'. 3040 3041 * Use of ISO C style function definitions. This warning 3042 intentionally is _not_ issued for prototype declarations or 3043 variadic functions because these ISO C features will appear 3044 in your code when using libiberty's traditional C 3045 compatibility macros, `PARAMS' and `VPARAMS'. This warning 3046 is also bypassed for nested functions because that feature is 3047 already a GCC extension and thus not relevant to traditional 3048 C compatibility. 3049 3050`-Wdeclaration-after-statement (C only)' 3051 Warn when a declaration is found after a statement in a block. 3052 This construct, known from C++, was introduced with ISO C99 and is 3053 by default allowed in GCC. It is not supported by ISO C90 and was 3054 not supported by GCC versions before GCC 3.0. *Note Mixed 3055 Declarations::. 3056 3057`-Wundef' 3058 Warn if an undefined identifier is evaluated in an `#if' directive. 3059 3060`-Wno-endif-labels' 3061 Do not warn whenever an `#else' or an `#endif' are followed by 3062 text. 3063 3064`-Wshadow' 3065 Warn whenever a local variable shadows another local variable, 3066 parameter or global variable or whenever a built-in function is 3067 shadowed. 3068 3069`-Wlarger-than-LEN' 3070 Warn whenever an object of larger than LEN bytes is defined. 3071 3072`-Wunsafe-loop-optimizations' 3073 Warn if the loop cannot be optimized because the compiler could not 3074 assume anything on the bounds of the loop indices. With 3075 `-funsafe-loop-optimizations' warn if the compiler made such 3076 assumptions. 3077 3078`-Wpointer-arith' 3079 Warn about anything that depends on the "size of" a function type 3080 or of `void'. GNU C assigns these types a size of 1, for 3081 convenience in calculations with `void *' pointers and pointers to 3082 functions. 3083 3084`-Wbad-function-cast (C only)' 3085 Warn whenever a function call is cast to a non-matching type. For 3086 example, warn if `int malloc()' is cast to `anything *'. 3087 3088`-Wc++-compat' 3089 Warn about ISO C constructs that are outside of the common subset 3090 of ISO C and ISO C++, e.g. request for implicit conversion from 3091 `void *' to a pointer to non-`void' type. 3092 3093`-Wcast-qual' 3094 Warn whenever a pointer is cast so as to remove a type qualifier 3095 from the target type. For example, warn if a `const char *' is 3096 cast to an ordinary `char *'. 3097 3098`-Wcast-align' 3099 Warn whenever a pointer is cast such that the required alignment 3100 of the target is increased. For example, warn if a `char *' is 3101 cast to an `int *' on machines where integers can only be accessed 3102 at two- or four-byte boundaries. 3103 3104`-Wwrite-strings' 3105 When compiling C, give string constants the type `const 3106 char[LENGTH]' so that copying the address of one into a 3107 non-`const' `char *' pointer will get a warning; when compiling 3108 C++, warn about the deprecated conversion from string literals to 3109 `char *'. This warning, by default, is enabled for C++ programs. 3110 These warnings will help you find at compile time code that can 3111 try to write into a string constant, but only if you have been 3112 very careful about using `const' in declarations and prototypes. 3113 Otherwise, it will just be a nuisance; this is why we did not make 3114 `-Wall' request these warnings. 3115 3116`-Wconversion' 3117 Warn if a prototype causes a type conversion that is different 3118 from what would happen to the same argument in the absence of a 3119 prototype. This includes conversions of fixed point to floating 3120 and vice versa, and conversions changing the width or signedness 3121 of a fixed point argument except when the same as the default 3122 promotion. 3123 3124 Also, warn if a negative integer constant expression is implicitly 3125 converted to an unsigned type. For example, warn about the 3126 assignment `x = -1' if `x' is unsigned. But do not warn about 3127 explicit casts like `(unsigned) -1'. 3128 3129`-Wsign-compare' 3130 Warn when a comparison between signed and unsigned values could 3131 produce an incorrect result when the signed value is converted to 3132 unsigned. This warning is also enabled by `-Wextra'; to get the 3133 other warnings of `-Wextra' without this warning, use `-Wextra 3134 -Wno-sign-compare'. 3135 3136`-Waddress' 3137 Warn about suspicious uses of memory addresses. These include using 3138 the address of a function in a conditional expression, such as 3139 `void func(void); if (func)', and comparisons against the memory 3140 address of a string literal, such as `if (x == "abc")'. Such uses 3141 typically indicate a programmer error: the address of a function 3142 always evaluates to true, so their use in a conditional usually 3143 indicate that the programmer forgot the parentheses in a function 3144 call; and comparisons against string literals result in unspecified 3145 behavior and are not portable in C, so they usually indicate that 3146 the programmer intended to use `strcmp'. This warning is enabled 3147 by `-Wall'. 3148 3149`-Waggregate-return' 3150 Warn if any functions that return structures or unions are defined 3151 or called. (In languages where you can return an array, this also 3152 elicits a warning.) 3153 3154`-Wno-attributes' 3155 Do not warn if an unexpected `__attribute__' is used, such as 3156 unrecognized attributes, function attributes applied to variables, 3157 etc. This will not stop errors for incorrect use of supported 3158 attributes. 3159 3160`-Wstrict-prototypes (C only)' 3161 Warn if a function is declared or defined without specifying the 3162 argument types. (An old-style function definition is permitted 3163 without a warning if preceded by a declaration which specifies the 3164 argument types.) 3165 3166`-Wold-style-definition (C only)' 3167 Warn if an old-style function definition is used. A warning is 3168 given even if there is a previous prototype. 3169 3170`-Wmissing-prototypes (C only)' 3171 Warn if a global function is defined without a previous prototype 3172 declaration. This warning is issued even if the definition itself 3173 provides a prototype. The aim is to detect global functions that 3174 fail to be declared in header files. 3175 3176`-Wmissing-declarations (C only)' 3177 Warn if a global function is defined without a previous 3178 declaration. Do so even if the definition itself provides a 3179 prototype. Use this option to detect global functions that are 3180 not declared in header files. 3181 3182`-Wmissing-field-initializers' 3183 Warn if a structure's initializer has some fields missing. For 3184 example, the following code would cause such a warning, because 3185 `x.h' is implicitly zero: 3186 3187 struct s { int f, g, h; }; 3188 struct s x = { 3, 4 }; 3189 3190 This option does not warn about designated initializers, so the 3191 following modification would not trigger a warning: 3192 3193 struct s { int f, g, h; }; 3194 struct s x = { .f = 3, .g = 4 }; 3195 3196 This warning is included in `-Wextra'. To get other `-Wextra' 3197 warnings without this one, use `-Wextra 3198 -Wno-missing-field-initializers'. 3199 3200`-Wmissing-noreturn' 3201 Warn about functions which might be candidates for attribute 3202 `noreturn'. Note these are only possible candidates, not absolute 3203 ones. Care should be taken to manually verify functions actually 3204 do not ever return before adding the `noreturn' attribute, 3205 otherwise subtle code generation bugs could be introduced. You 3206 will not get a warning for `main' in hosted C environments. 3207 3208`-Wmissing-format-attribute' 3209 Warn about function pointers which might be candidates for `format' 3210 attributes. Note these are only possible candidates, not absolute 3211 ones. GCC will guess that function pointers with `format' 3212 attributes that are used in assignment, initialization, parameter 3213 passing or return statements should have a corresponding `format' 3214 attribute in the resulting type. I.e. the left-hand side of the 3215 assignment or initialization, the type of the parameter variable, 3216 or the return type of the containing function respectively should 3217 also have a `format' attribute to avoid the warning. 3218 3219 GCC will also warn about function definitions which might be 3220 candidates for `format' attributes. Again, these are only 3221 possible candidates. GCC will guess that `format' attributes 3222 might be appropriate for any function that calls a function like 3223 `vprintf' or `vscanf', but this might not always be the case, and 3224 some functions for which `format' attributes are appropriate may 3225 not be detected. 3226 3227`-Wno-multichar' 3228 Do not warn if a multicharacter constant (`'FOOF'') is used. 3229 Usually they indicate a typo in the user's code, as they have 3230 implementation-defined values, and should not be used in portable 3231 code. 3232 3233`-Wnormalized=<none|id|nfc|nfkc>' 3234 In ISO C and ISO C++, two identifiers are different if they are 3235 different sequences of characters. However, sometimes when 3236 characters outside the basic ASCII character set are used, you can 3237 have two different character sequences that look the same. To 3238 avoid confusion, the ISO 10646 standard sets out some 3239 "normalization rules" which when applied ensure that two sequences 3240 that look the same are turned into the same sequence. GCC can 3241 warn you if you are using identifiers which have not been 3242 normalized; this option controls that warning. 3243 3244 There are four levels of warning that GCC supports. The default is 3245 `-Wnormalized=nfc', which warns about any identifier which is not 3246 in the ISO 10646 "C" normalized form, "NFC". NFC is the 3247 recommended form for most uses. 3248 3249 Unfortunately, there are some characters which ISO C and ISO C++ 3250 allow in identifiers that when turned into NFC aren't allowable as 3251 identifiers. That is, there's no way to use these symbols in 3252 portable ISO C or C++ and have all your identifiers in NFC. 3253 `-Wnormalized=id' suppresses the warning for these characters. It 3254 is hoped that future versions of the standards involved will 3255 correct this, which is why this option is not the default. 3256 3257 You can switch the warning off for all characters by writing 3258 `-Wnormalized=none'. You would only want to do this if you were 3259 using some other normalization scheme (like "D"), because 3260 otherwise you can easily create bugs that are literally impossible 3261 to see. 3262 3263 Some characters in ISO 10646 have distinct meanings but look 3264 identical in some fonts or display methodologies, especially once 3265 formatting has been applied. For instance `\u207F', "SUPERSCRIPT 3266 LATIN SMALL LETTER N", will display just like a regular `n' which 3267 has been placed in a superscript. ISO 10646 defines the "NFKC" 3268 normalization scheme to convert all these into a standard form as 3269 well, and GCC will warn if your code is not in NFKC if you use 3270 `-Wnormalized=nfkc'. This warning is comparable to warning about 3271 every identifier that contains the letter O because it might be 3272 confused with the digit 0, and so is not the default, but may be 3273 useful as a local coding convention if the programming environment 3274 is unable to be fixed to display these characters distinctly. 3275 3276`-Wno-deprecated-declarations' 3277 Do not warn about uses of functions (*note Function Attributes::), 3278 variables (*note Variable Attributes::), and types (*note Type 3279 Attributes::) marked as deprecated by using the `deprecated' 3280 attribute. 3281 3282`-Wno-overflow' 3283 Do not warn about compile-time overflow in constant expressions. 3284 3285`-Woverride-init' 3286 Warn if an initialized field without side effects is overridden 3287 when using designated initializers (*note Designated Initializers: 3288 Designated Inits.). 3289 3290 This warning is included in `-Wextra'. To get other `-Wextra' 3291 warnings without this one, use `-Wextra -Wno-override-init'. 3292 3293`-Wpacked' 3294 Warn if a structure is given the packed attribute, but the packed 3295 attribute has no effect on the layout or size of the structure. 3296 Such structures may be mis-aligned for little benefit. For 3297 instance, in this code, the variable `f.x' in `struct bar' will be 3298 misaligned even though `struct bar' does not itself have the 3299 packed attribute: 3300 3301 struct foo { 3302 int x; 3303 char a, b, c, d; 3304 } __attribute__((packed)); 3305 struct bar { 3306 char z; 3307 struct foo f; 3308 }; 3309 3310`-Wpadded' 3311 Warn if padding is included in a structure, either to align an 3312 element of the structure or to align the whole structure. 3313 Sometimes when this happens it is possible to rearrange the fields 3314 of the structure to reduce the padding and so make the structure 3315 smaller. 3316 3317`-Wredundant-decls' 3318 Warn if anything is declared more than once in the same scope, 3319 even in cases where multiple declaration is valid and changes 3320 nothing. 3321 3322`-Wnested-externs (C only)' 3323 Warn if an `extern' declaration is encountered within a function. 3324 3325`-Wunreachable-code' 3326 Warn if the compiler detects that code will never be executed. 3327 3328 This option is intended to warn when the compiler detects that at 3329 least a whole line of source code will never be executed, because 3330 some condition is never satisfied or because it is after a 3331 procedure that never returns. 3332 3333 It is possible for this option to produce a warning even though 3334 there are circumstances under which part of the affected line can 3335 be executed, so care should be taken when removing 3336 apparently-unreachable code. 3337 3338 For instance, when a function is inlined, a warning may mean that 3339 the line is unreachable in only one inlined copy of the function. 3340 3341 This option is not made part of `-Wall' because in a debugging 3342 version of a program there is often substantial code which checks 3343 correct functioning of the program and is, hopefully, unreachable 3344 because the program does work. Another common use of unreachable 3345 code is to provide behavior which is selectable at compile-time. 3346 3347`-Winline' 3348 Warn if a function can not be inlined and it was declared as 3349 inline. Even with this option, the compiler will not warn about 3350 failures to inline functions declared in system headers. 3351 3352 The compiler uses a variety of heuristics to determine whether or 3353 not to inline a function. For example, the compiler takes into 3354 account the size of the function being inlined and the amount of 3355 inlining that has already been done in the current function. 3356 Therefore, seemingly insignificant changes in the source program 3357 can cause the warnings produced by `-Winline' to appear or 3358 disappear. 3359 3360`-Wno-invalid-offsetof (C++ only)' 3361 Suppress warnings from applying the `offsetof' macro to a non-POD 3362 type. According to the 1998 ISO C++ standard, applying `offsetof' 3363 to a non-POD type is undefined. In existing C++ implementations, 3364 however, `offsetof' typically gives meaningful results even when 3365 applied to certain kinds of non-POD types. (Such as a simple 3366 `struct' that fails to be a POD type only by virtue of having a 3367 constructor.) This flag is for users who are aware that they are 3368 writing nonportable code and who have deliberately chosen to 3369 ignore the warning about it. 3370 3371 The restrictions on `offsetof' may be relaxed in a future version 3372 of the C++ standard. 3373 3374`-Wno-int-to-pointer-cast (C only)' 3375 Suppress warnings from casts to pointer type of an integer of a 3376 different size. 3377 3378`-Wno-pointer-to-int-cast (C only)' 3379 Suppress warnings from casts from a pointer to an integer type of a 3380 different size. 3381 3382`-Winvalid-pch' 3383 Warn if a precompiled header (*note Precompiled Headers::) is 3384 found in the search path but can't be used. 3385 3386`-Wlong-long' 3387 Warn if `long long' type is used. This is default. To inhibit 3388 the warning messages, use `-Wno-long-long'. Flags `-Wlong-long' 3389 and `-Wno-long-long' are taken into account only when `-pedantic' 3390 flag is used. 3391 3392`-Wvariadic-macros' 3393 Warn if variadic macros are used in pedantic ISO C90 mode, or the 3394 GNU alternate syntax when in pedantic ISO C99 mode. This is 3395 default. To inhibit the warning messages, use 3396 `-Wno-variadic-macros'. 3397 3398`-Wvolatile-register-var' 3399 Warn if a register variable is declared volatile. The volatile 3400 modifier does not inhibit all optimizations that may eliminate 3401 reads and/or writes to register variables. 3402 3403`-Wdisabled-optimization' 3404 Warn if a requested optimization pass is disabled. This warning 3405 does not generally indicate that there is anything wrong with your 3406 code; it merely indicates that GCC's optimizers were unable to 3407 handle the code effectively. Often, the problem is that your code 3408 is too big or too complex; GCC will refuse to optimize programs 3409 when the optimization itself is likely to take inordinate amounts 3410 of time. 3411 3412`-Wpointer-sign' 3413 Warn for pointer argument passing or assignment with different 3414 signedness. This option is only supported for C and Objective-C. 3415 It is implied by `-Wall' and by `-pedantic', which can be disabled 3416 with `-Wno-pointer-sign'. 3417 3418`-Werror' 3419 Make all warnings into errors. 3420 3421`-Werror=' 3422 Make the specified warning into an errors. The specifier for a 3423 warning is appended, for example `-Werror=switch' turns the 3424 warnings controlled by `-Wswitch' into errors. This switch takes 3425 a negative form, to be used to negate `-Werror' for specific 3426 warnings, for example `-Wno-error=switch' makes `-Wswitch' 3427 warnings not be errors, even when `-Werror' is in effect. You can 3428 use the `-fdiagnostics-show-option' option to have each 3429 controllable warning amended with the option which controls it, to 3430 determine what to use with this option. 3431 3432 Note that specifying `-Werror='FOO automatically implies `-W'FOO. 3433 However, `-Wno-error='FOO does not imply anything. 3434 3435`-Wstack-protector' 3436 This option is only active when `-fstack-protector' is active. It 3437 warns about functions that will not be protected against stack 3438 smashing. 3439 3440`-Woverlength-strings' 3441 Warn about string constants which are longer than the "minimum 3442 maximum" length specified in the C standard. Modern compilers 3443 generally allow string constants which are much longer than the 3444 standard's minimum limit, but very portable programs should avoid 3445 using longer strings. 3446 3447 The limit applies _after_ string constant concatenation, and does 3448 not count the trailing NUL. In C89, the limit was 509 characters; 3449 in C99, it was raised to 4095. C++98 does not specify a normative 3450 minimum maximum, so we do not diagnose overlength strings in C++. 3451 3452 This option is implied by `-pedantic', and can be disabled with 3453 `-Wno-overlength-strings'. 3454 3455 3456File: gcc.info, Node: Debugging Options, Next: Optimize Options, Prev: Warning Options, Up: Invoking GCC 3457 34583.9 Options for Debugging Your Program or GCC 3459============================================= 3460 3461GCC has various special options that are used for debugging either your 3462program or GCC: 3463 3464`-g' 3465 Produce debugging information in the operating system's native 3466 format (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this 3467 debugging information. 3468 3469 On most systems that use stabs format, `-g' enables use of extra 3470 debugging information that only GDB can use; this extra information 3471 makes debugging work better in GDB but will probably make other 3472 debuggers crash or refuse to read the program. If you want to 3473 control for certain whether to generate the extra information, use 3474 `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', or `-gvms' (see 3475 below). 3476 3477 GCC allows you to use `-g' with `-O'. The shortcuts taken by 3478 optimized code may occasionally produce surprising results: some 3479 variables you declared may not exist at all; flow of control may 3480 briefly move where you did not expect it; some statements may not 3481 be executed because they compute constant results or their values 3482 were already at hand; some statements may execute in different 3483 places because they were moved out of loops. 3484 3485 Nevertheless it proves possible to debug optimized output. This 3486 makes it reasonable to use the optimizer for programs that might 3487 have bugs. 3488 3489 The following options are useful when GCC is generated with the 3490 capability for more than one debugging format. 3491 3492`-ggdb' 3493 Produce debugging information for use by GDB. This means to use 3494 the most expressive format available (DWARF 2, stabs, or the 3495 native format if neither of those are supported), including GDB 3496 extensions if at all possible. 3497 3498`-gstabs' 3499 Produce debugging information in stabs format (if that is 3500 supported), without GDB extensions. This is the format used by 3501 DBX on most BSD systems. On MIPS, Alpha and System V Release 4 3502 systems this option produces stabs debugging output which is not 3503 understood by DBX or SDB. On System V Release 4 systems this 3504 option requires the GNU assembler. 3505 3506`-feliminate-unused-debug-symbols' 3507 Produce debugging information in stabs format (if that is 3508 supported), for only symbols that are actually used. 3509 3510`-femit-class-debug-always' 3511 Instead of emitting debugging information for a C++ class in only 3512 one object file, emit it in all object files using the class. 3513 This option should be used only with debuggers that are unable to 3514 handle the way GCC normally emits debugging information for 3515 classes because using this option will increase the size of 3516 debugging information by as much as a factor of two. 3517 3518`-gstabs+' 3519 Produce debugging information in stabs format (if that is 3520 supported), using GNU extensions understood only by the GNU 3521 debugger (GDB). The use of these extensions is likely to make 3522 other debuggers crash or refuse to read the program. 3523 3524`-gcoff' 3525 Produce debugging information in COFF format (if that is 3526 supported). This is the format used by SDB on most System V 3527 systems prior to System V Release 4. 3528 3529`-gxcoff' 3530 Produce debugging information in XCOFF format (if that is 3531 supported). This is the format used by the DBX debugger on IBM 3532 RS/6000 systems. 3533 3534`-gxcoff+' 3535 Produce debugging information in XCOFF format (if that is 3536 supported), using GNU extensions understood only by the GNU 3537 debugger (GDB). The use of these extensions is likely to make 3538 other debuggers crash or refuse to read the program, and may cause 3539 assemblers other than the GNU assembler (GAS) to fail with an 3540 error. 3541 3542`-gdwarf-2' 3543 Produce debugging information in DWARF version 2 format (if that is 3544 supported). This is the format used by DBX on IRIX 6. With this 3545 option, GCC uses features of DWARF version 3 when they are useful; 3546 version 3 is upward compatible with version 2, but may still cause 3547 problems for older debuggers. 3548 3549`-gvms' 3550 Produce debugging information in VMS debug format (if that is 3551 supported). This is the format used by DEBUG on VMS systems. 3552 3553`-gLEVEL' 3554`-ggdbLEVEL' 3555`-gstabsLEVEL' 3556`-gcoffLEVEL' 3557`-gxcoffLEVEL' 3558`-gvmsLEVEL' 3559 Request debugging information and also use LEVEL to specify how 3560 much information. The default level is 2. 3561 3562 Level 1 produces minimal information, enough for making backtraces 3563 in parts of the program that you don't plan to debug. This 3564 includes descriptions of functions and external variables, but no 3565 information about local variables and no line numbers. 3566 3567 Level 3 includes extra information, such as all the macro 3568 definitions present in the program. Some debuggers support macro 3569 expansion when you use `-g3'. 3570 3571 `-gdwarf-2' does not accept a concatenated debug level, because 3572 GCC used to support an option `-gdwarf' that meant to generate 3573 debug information in version 1 of the DWARF format (which is very 3574 different from version 2), and it would have been too confusing. 3575 That debug format is long obsolete, but the option cannot be 3576 changed now. Instead use an additional `-gLEVEL' option to change 3577 the debug level for DWARF2. 3578 3579`-feliminate-dwarf2-dups' 3580 Compress DWARF2 debugging information by eliminating duplicated 3581 information about each symbol. This option only makes sense when 3582 generating DWARF2 debugging information with `-gdwarf-2'. 3583 3584`-p' 3585 Generate extra code to write profile information suitable for the 3586 analysis program `prof'. You must use this option when compiling 3587 the source files you want data about, and you must also use it when 3588 linking. 3589 3590`-pg' 3591 Generate extra code to write profile information suitable for the 3592 analysis program `gprof'. You must use this option when compiling 3593 the source files you want data about, and you must also use it when 3594 linking. 3595 3596`-Q' 3597 Makes the compiler print out each function name as it is compiled, 3598 and print some statistics about each pass when it finishes. 3599 3600`-ftime-report' 3601 Makes the compiler print some statistics about the time consumed 3602 by each pass when it finishes. 3603 3604`-fmem-report' 3605 Makes the compiler print some statistics about permanent memory 3606 allocation when it finishes. 3607 3608`-fprofile-arcs' 3609 Add code so that program flow "arcs" are instrumented. During 3610 execution the program records how many times each branch and call 3611 is executed and how many times it is taken or returns. When the 3612 compiled program exits it saves this data to a file called 3613 `AUXNAME.gcda' for each source file. The data may be used for 3614 profile-directed optimizations (`-fbranch-probabilities'), or for 3615 test coverage analysis (`-ftest-coverage'). Each object file's 3616 AUXNAME is generated from the name of the output file, if 3617 explicitly specified and it is not the final executable, otherwise 3618 it is the basename of the source file. In both cases any suffix 3619 is removed (e.g. `foo.gcda' for input file `dir/foo.c', or 3620 `dir/foo.gcda' for output file specified as `-o dir/foo.o'). 3621 *Note Cross-profiling::. 3622 3623`--coverage' 3624 This option is used to compile and link code instrumented for 3625 coverage analysis. The option is a synonym for `-fprofile-arcs' 3626 `-ftest-coverage' (when compiling) and `-lgcov' (when linking). 3627 See the documentation for those options for more details. 3628 3629 * Compile the source files with `-fprofile-arcs' plus 3630 optimization and code generation options. For test coverage 3631 analysis, use the additional `-ftest-coverage' option. You 3632 do not need to profile every source file in a program. 3633 3634 * Link your object files with `-lgcov' or `-fprofile-arcs' (the 3635 latter implies the former). 3636 3637 * Run the program on a representative workload to generate the 3638 arc profile information. This may be repeated any number of 3639 times. You can run concurrent instances of your program, and 3640 provided that the file system supports locking, the data 3641 files will be correctly updated. Also `fork' calls are 3642 detected and correctly handled (double counting will not 3643 happen). 3644 3645 * For profile-directed optimizations, compile the source files 3646 again with the same optimization and code generation options 3647 plus `-fbranch-probabilities' (*note Options that Control 3648 Optimization: Optimize Options.). 3649 3650 * For test coverage analysis, use `gcov' to produce human 3651 readable information from the `.gcno' and `.gcda' files. 3652 Refer to the `gcov' documentation for further information. 3653 3654 3655 With `-fprofile-arcs', for each function of your program GCC 3656 creates a program flow graph, then finds a spanning tree for the 3657 graph. Only arcs that are not on the spanning tree have to be 3658 instrumented: the compiler adds code to count the number of times 3659 that these arcs are executed. When an arc is the only exit or 3660 only entrance to a block, the instrumentation code can be added to 3661 the block; otherwise, a new basic block must be created to hold 3662 the instrumentation code. 3663 3664`-ftest-coverage' 3665 Produce a notes file that the `gcov' code-coverage utility (*note 3666 `gcov'--a Test Coverage Program: Gcov.) can use to show program 3667 coverage. Each source file's note file is called `AUXNAME.gcno'. 3668 Refer to the `-fprofile-arcs' option above for a description of 3669 AUXNAME and instructions on how to generate test coverage data. 3670 Coverage data will match the source files more closely, if you do 3671 not optimize. 3672 3673`-dLETTERS' 3674 3675`-fdump-rtl-PASS' 3676 Says to make debugging dumps during compilation at times specified 3677 by LETTERS. This is used for debugging the RTL-based passes of 3678 the compiler. The file names for most of the dumps are made by 3679 appending a pass number and a word to the DUMPNAME. DUMPNAME is 3680 generated from the name of the output file, if explicitly 3681 specified and it is not an executable, otherwise it is the 3682 basename of the source file. 3683 3684 Most debug dumps can be enabled either passing a letter to the `-d' 3685 option, or with a long `-fdump-rtl' switch; here are the possible 3686 letters for use in LETTERS and PASS, and their meanings: 3687 3688 `-dA' 3689 Annotate the assembler output with miscellaneous debugging 3690 information. 3691 3692 `-dB' 3693 `-fdump-rtl-bbro' 3694 Dump after block reordering, to `FILE.148r.bbro'. 3695 3696 `-dc' 3697 `-fdump-rtl-combine' 3698 Dump after instruction combination, to the file 3699 `FILE.129r.combine'. 3700 3701 `-dC' 3702 `-fdump-rtl-ce1' 3703 `-fdump-rtl-ce2' 3704 `-dC' and `-fdump-rtl-ce1' enable dumping after the first if 3705 conversion, to the file `FILE.117r.ce1'. `-dC' and 3706 `-fdump-rtl-ce2' enable dumping after the second if 3707 conversion, to the file `FILE.130r.ce2'. 3708 3709 `-dd' 3710 `-fdump-rtl-btl' 3711 `-fdump-rtl-dbr' 3712 `-dd' and `-fdump-rtl-btl' enable dumping after branch target 3713 load optimization, to `FILE.31.btl'. `-dd' and 3714 `-fdump-rtl-dbr' enable dumping after delayed branch 3715 scheduling, to `FILE.36.dbr'. 3716 3717 `-dD' 3718 Dump all macro definitions, at the end of preprocessing, in 3719 addition to normal output. 3720 3721 `-dE' 3722 `-fdump-rtl-ce3' 3723 Dump after the third if conversion, to `FILE.146r.ce3'. 3724 3725 `-df' 3726 `-fdump-rtl-cfg' 3727 `-fdump-rtl-life' 3728 `-df' and `-fdump-rtl-cfg' enable dumping after control and 3729 data flow analysis, to `FILE.116r.cfg'. `-df' and 3730 `-fdump-rtl-cfg' enable dumping dump after life analysis, to 3731 `FILE.128r.life1' and `FILE.135r.life2'. 3732 3733 `-dg' 3734 `-fdump-rtl-greg' 3735 Dump after global register allocation, to `FILE.139r.greg'. 3736 3737 `-dG' 3738 `-fdump-rtl-gcse' 3739 `-fdump-rtl-bypass' 3740 `-dG' and `-fdump-rtl-gcse' enable dumping after GCSE, to 3741 `FILE.114r.gcse'. `-dG' and `-fdump-rtl-bypass' enable 3742 dumping after jump bypassing and control flow optimizations, 3743 to `FILE.115r.bypass'. 3744 3745 `-dh' 3746 `-fdump-rtl-eh' 3747 Dump after finalization of EH handling code, to `FILE.02.eh'. 3748 3749 `-di' 3750 `-fdump-rtl-sibling' 3751 Dump after sibling call optimizations, to `FILE.106r.sibling'. 3752 3753 `-dj' 3754 `-fdump-rtl-jump' 3755 Dump after the first jump optimization, to `FILE.112r.jump'. 3756 3757 `-dk' 3758 `-fdump-rtl-stack' 3759 Dump after conversion from registers to stack, to 3760 `FILE.152r.stack'. 3761 3762 `-dl' 3763 `-fdump-rtl-lreg' 3764 Dump after local register allocation, to `FILE.138r.lreg'. 3765 3766 `-dL' 3767 `-fdump-rtl-loop2' 3768 `-dL' and `-fdump-rtl-loop2' enable dumping after the loop 3769 optimization pass, to `FILE.119r.loop2', 3770 `FILE.120r.loop2_init', `FILE.121r.loop2_invariant', and 3771 `FILE.125r.loop2_done'. 3772 3773 `-dm' 3774 `-fdump-rtl-sms' 3775 Dump after modulo scheduling, to `FILE.136r.sms'. 3776 3777 `-dM' 3778 `-fdump-rtl-mach' 3779 Dump after performing the machine dependent reorganization 3780 pass, to `FILE.155r.mach'. 3781 3782 `-dn' 3783 `-fdump-rtl-rnreg' 3784 Dump after register renumbering, to `FILE.147r.rnreg'. 3785 3786 `-dN' 3787 `-fdump-rtl-regmove' 3788 Dump after the register move pass, to `FILE.132r.regmove'. 3789 3790 `-do' 3791 `-fdump-rtl-postreload' 3792 Dump after post-reload optimizations, to `FILE.24.postreload'. 3793 3794 `-dr' 3795 `-fdump-rtl-expand' 3796 Dump after RTL generation, to `FILE.104r.expand'. 3797 3798 `-dR' 3799 `-fdump-rtl-sched2' 3800 Dump after the second scheduling pass, to `FILE.150r.sched2'. 3801 3802 `-ds' 3803 `-fdump-rtl-cse' 3804 Dump after CSE (including the jump optimization that 3805 sometimes follows CSE), to `FILE.113r.cse'. 3806 3807 `-dS' 3808 `-fdump-rtl-sched' 3809 Dump after the first scheduling pass, to `FILE.21.sched'. 3810 3811 `-dt' 3812 `-fdump-rtl-cse2' 3813 Dump after the second CSE pass (including the jump 3814 optimization that sometimes follows CSE), to `FILE.127r.cse2'. 3815 3816 `-dT' 3817 `-fdump-rtl-tracer' 3818 Dump after running tracer, to `FILE.118r.tracer'. 3819 3820 `-dV' 3821 `-fdump-rtl-vpt' 3822 `-fdump-rtl-vartrack' 3823 `-dV' and `-fdump-rtl-vpt' enable dumping after the value 3824 profile transformations, to `FILE.10.vpt'. `-dV' and 3825 `-fdump-rtl-vartrack' enable dumping after variable tracking, 3826 to `FILE.154r.vartrack'. 3827 3828 `-dw' 3829 `-fdump-rtl-flow2' 3830 Dump after the second flow pass, to `FILE.142r.flow2'. 3831 3832 `-dz' 3833 `-fdump-rtl-peephole2' 3834 Dump after the peephole pass, to `FILE.145r.peephole2'. 3835 3836 `-dZ' 3837 `-fdump-rtl-web' 3838 Dump after live range splitting, to `FILE.126r.web'. 3839 3840 `-da' 3841 `-fdump-rtl-all' 3842 Produce all the dumps listed above. 3843 3844 `-dH' 3845 Produce a core dump whenever an error occurs. 3846 3847 `-dm' 3848 Print statistics on memory usage, at the end of the run, to 3849 standard error. 3850 3851 `-dp' 3852 Annotate the assembler output with a comment indicating which 3853 pattern and alternative was used. The length of each 3854 instruction is also printed. 3855 3856 `-dP' 3857 Dump the RTL in the assembler output as a comment before each 3858 instruction. Also turns on `-dp' annotation. 3859 3860 `-dv' 3861 For each of the other indicated dump files (either with `-d' 3862 or `-fdump-rtl-PASS'), dump a representation of the control 3863 flow graph suitable for viewing with VCG to `FILE.PASS.vcg'. 3864 3865 `-dx' 3866 Just generate RTL for a function instead of compiling it. 3867 Usually used with `r' (`-fdump-rtl-expand'). 3868 3869 `-dy' 3870 Dump debugging information during parsing, to standard error. 3871 3872`-fdump-noaddr' 3873 When doing debugging dumps (see `-d' option above), suppress 3874 address output. This makes it more feasible to use diff on 3875 debugging dumps for compiler invocations with different compiler 3876 binaries and/or different text / bss / data / heap / stack / dso 3877 start locations. 3878 3879`-fdump-unnumbered' 3880 When doing debugging dumps (see `-d' option above), suppress 3881 instruction numbers, line number note and address output. This 3882 makes it more feasible to use diff on debugging dumps for compiler 3883 invocations with different options, in particular with and without 3884 `-g'. 3885 3886`-fdump-translation-unit (C++ only)' 3887`-fdump-translation-unit-OPTIONS (C++ only)' 3888 Dump a representation of the tree structure for the entire 3889 translation unit to a file. The file name is made by appending 3890 `.tu' to the source file name. If the `-OPTIONS' form is used, 3891 OPTIONS controls the details of the dump as described for the 3892 `-fdump-tree' options. 3893 3894`-fdump-class-hierarchy (C++ only)' 3895`-fdump-class-hierarchy-OPTIONS (C++ only)' 3896 Dump a representation of each class's hierarchy and virtual 3897 function table layout to a file. The file name is made by 3898 appending `.class' to the source file name. If the `-OPTIONS' 3899 form is used, OPTIONS controls the details of the dump as 3900 described for the `-fdump-tree' options. 3901 3902`-fdump-ipa-SWITCH' 3903 Control the dumping at various stages of inter-procedural analysis 3904 language tree to a file. The file name is generated by appending 3905 a switch specific suffix to the source file name. The following 3906 dumps are possible: 3907 3908 `all' 3909 Enables all inter-procedural analysis dumps; currently the 3910 only produced dump is the `cgraph' dump. 3911 3912 `cgraph' 3913 Dumps information about call-graph optimization, unused 3914 function removal, and inlining decisions. 3915 3916`-fdump-tree-SWITCH' 3917`-fdump-tree-SWITCH-OPTIONS' 3918 Control the dumping at various stages of processing the 3919 intermediate language tree to a file. The file name is generated 3920 by appending a switch specific suffix to the source file name. If 3921 the `-OPTIONS' form is used, OPTIONS is a list of `-' separated 3922 options that control the details of the dump. Not all options are 3923 applicable to all dumps, those which are not meaningful will be 3924 ignored. The following options are available 3925 3926 `address' 3927 Print the address of each node. Usually this is not 3928 meaningful as it changes according to the environment and 3929 source file. Its primary use is for tying up a dump file 3930 with a debug environment. 3931 3932 `slim' 3933 Inhibit dumping of members of a scope or body of a function 3934 merely because that scope has been reached. Only dump such 3935 items when they are directly reachable by some other path. 3936 When dumping pretty-printed trees, this option inhibits 3937 dumping the bodies of control structures. 3938 3939 `raw' 3940 Print a raw representation of the tree. By default, trees are 3941 pretty-printed into a C-like representation. 3942 3943 `details' 3944 Enable more detailed dumps (not honored by every dump option). 3945 3946 `stats' 3947 Enable dumping various statistics about the pass (not honored 3948 by every dump option). 3949 3950 `blocks' 3951 Enable showing basic block boundaries (disabled in raw dumps). 3952 3953 `vops' 3954 Enable showing virtual operands for every statement. 3955 3956 `lineno' 3957 Enable showing line numbers for statements. 3958 3959 `uid' 3960 Enable showing the unique ID (`DECL_UID') for each variable. 3961 3962 `all' 3963 Turn on all options, except `raw', `slim' and `lineno'. 3964 3965 The following tree dumps are possible: 3966 `original' 3967 Dump before any tree based optimization, to `FILE.original'. 3968 3969 `optimized' 3970 Dump after all tree based optimization, to `FILE.optimized'. 3971 3972 `inlined' 3973 Dump after function inlining, to `FILE.inlined'. 3974 3975 `gimple' 3976 Dump each function before and after the gimplification pass 3977 to a file. The file name is made by appending `.gimple' to 3978 the source file name. 3979 3980 `cfg' 3981 Dump the control flow graph of each function to a file. The 3982 file name is made by appending `.cfg' to the source file name. 3983 3984 `vcg' 3985 Dump the control flow graph of each function to a file in VCG 3986 format. The file name is made by appending `.vcg' to the 3987 source file name. Note that if the file contains more than 3988 one function, the generated file cannot be used directly by 3989 VCG. You will need to cut and paste each function's graph 3990 into its own separate file first. 3991 3992 `ch' 3993 Dump each function after copying loop headers. The file name 3994 is made by appending `.ch' to the source file name. 3995 3996 `ssa' 3997 Dump SSA related information to a file. The file name is 3998 made by appending `.ssa' to the source file name. 3999 4000 `salias' 4001 Dump structure aliasing variable information to a file. This 4002 file name is made by appending `.salias' to the source file 4003 name. 4004 4005 `alias' 4006 Dump aliasing information for each function. The file name 4007 is made by appending `.alias' to the source file name. 4008 4009 `ccp' 4010 Dump each function after CCP. The file name is made by 4011 appending `.ccp' to the source file name. 4012 4013 `storeccp' 4014 Dump each function after STORE-CCP. The file name is made by 4015 appending `.storeccp' to the source file name. 4016 4017 `pre' 4018 Dump trees after partial redundancy elimination. The file 4019 name is made by appending `.pre' to the source file name. 4020 4021 `fre' 4022 Dump trees after full redundancy elimination. The file name 4023 is made by appending `.fre' to the source file name. 4024 4025 `copyprop' 4026 Dump trees after copy propagation. The file name is made by 4027 appending `.copyprop' to the source file name. 4028 4029 `store_copyprop' 4030 Dump trees after store copy-propagation. The file name is 4031 made by appending `.store_copyprop' to the source file name. 4032 4033 `dce' 4034 Dump each function after dead code elimination. The file 4035 name is made by appending `.dce' to the source file name. 4036 4037 `mudflap' 4038 Dump each function after adding mudflap instrumentation. The 4039 file name is made by appending `.mudflap' to the source file 4040 name. 4041 4042 `sra' 4043 Dump each function after performing scalar replacement of 4044 aggregates. The file name is made by appending `.sra' to the 4045 source file name. 4046 4047 `sink' 4048 Dump each function after performing code sinking. The file 4049 name is made by appending `.sink' to the source file name. 4050 4051 `dom' 4052 Dump each function after applying dominator tree 4053 optimizations. The file name is made by appending `.dom' to 4054 the source file name. 4055 4056 `dse' 4057 Dump each function after applying dead store elimination. 4058 The file name is made by appending `.dse' to the source file 4059 name. 4060 4061 `phiopt' 4062 Dump each function after optimizing PHI nodes into 4063 straightline code. The file name is made by appending 4064 `.phiopt' to the source file name. 4065 4066 `forwprop' 4067 Dump each function after forward propagating single use 4068 variables. The file name is made by appending `.forwprop' to 4069 the source file name. 4070 4071 `copyrename' 4072 Dump each function after applying the copy rename 4073 optimization. The file name is made by appending 4074 `.copyrename' to the source file name. 4075 4076 `nrv' 4077 Dump each function after applying the named return value 4078 optimization on generic trees. The file name is made by 4079 appending `.nrv' to the source file name. 4080 4081 `vect' 4082 Dump each function after applying vectorization of loops. 4083 The file name is made by appending `.vect' to the source file 4084 name. 4085 4086 `vrp' 4087 Dump each function after Value Range Propagation (VRP). The 4088 file name is made by appending `.vrp' to the source file name. 4089 4090 `all' 4091 Enable all the available tree dumps with the flags provided 4092 in this option. 4093 4094`-ftree-vectorizer-verbose=N' 4095 This option controls the amount of debugging output the vectorizer 4096 prints. This information is written to standard error, unless 4097 `-fdump-tree-all' or `-fdump-tree-vect' is specified, in which 4098 case it is output to the usual dump listing file, `.vect'. For 4099 N=0 no diagnostic information is reported. If N=1 the vectorizer 4100 reports each loop that got vectorized, and the total number of 4101 loops that got vectorized. If N=2 the vectorizer also reports 4102 non-vectorized loops that passed the first analysis phase 4103 (vect_analyze_loop_form) - i.e. countable, inner-most, single-bb, 4104 single-entry/exit loops. This is the same verbosity level that 4105 `-fdump-tree-vect-stats' uses. Higher verbosity levels mean 4106 either more information dumped for each reported loop, or same 4107 amount of information reported for more loops: If N=3, alignment 4108 related information is added to the reports. If N=4, 4109 data-references related information (e.g. memory dependences, 4110 memory access-patterns) is added to the reports. If N=5, the 4111 vectorizer reports also non-vectorized inner-most loops that did 4112 not pass the first analysis phase (i.e. may not be countable, or 4113 may have complicated control-flow). If N=6, the vectorizer 4114 reports also non-vectorized nested loops. For N=7, all the 4115 information the vectorizer generates during its analysis and 4116 transformation is reported. This is the same verbosity level that 4117 `-fdump-tree-vect-details' uses. 4118 4119`-frandom-seed=STRING' 4120 This option provides a seed that GCC uses when it would otherwise 4121 use random numbers. It is used to generate certain symbol names 4122 that have to be different in every compiled file. It is also used 4123 to place unique stamps in coverage data files and the object files 4124 that produce them. You can use the `-frandom-seed' option to 4125 produce reproducibly identical object files. 4126 4127 The STRING should be different for every file you compile. 4128 4129`-fsched-verbose=N' 4130 On targets that use instruction scheduling, this option controls 4131 the amount of debugging output the scheduler prints. This 4132 information is written to standard error, unless `-dS' or `-dR' is 4133 specified, in which case it is output to the usual dump listing 4134 file, `.sched' or `.sched2' respectively. However for N greater 4135 than nine, the output is always printed to standard error. 4136 4137 For N greater than zero, `-fsched-verbose' outputs the same 4138 information as `-dRS'. For N greater than one, it also output 4139 basic block probabilities, detailed ready list information and 4140 unit/insn info. For N greater than two, it includes RTL at abort 4141 point, control-flow and regions info. And for N over four, 4142 `-fsched-verbose' also includes dependence info. 4143 4144`-save-temps' 4145 Store the usual "temporary" intermediate files permanently; place 4146 them in the current directory and name them based on the source 4147 file. Thus, compiling `foo.c' with `-c -save-temps' would produce 4148 files `foo.i' and `foo.s', as well as `foo.o'. This creates a 4149 preprocessed `foo.i' output file even though the compiler now 4150 normally uses an integrated preprocessor. 4151 4152 When used in combination with the `-x' command line option, 4153 `-save-temps' is sensible enough to avoid over writing an input 4154 source file with the same extension as an intermediate file. The 4155 corresponding intermediate file may be obtained by renaming the 4156 source file before using `-save-temps'. 4157 4158`-time' 4159 Report the CPU time taken by each subprocess in the compilation 4160 sequence. For C source files, this is the compiler proper and 4161 assembler (plus the linker if linking is done). The output looks 4162 like this: 4163 4164 # cc1 0.12 0.01 4165 # as 0.00 0.01 4166 4167 The first number on each line is the "user time", that is time 4168 spent executing the program itself. The second number is "system 4169 time", time spent executing operating system routines on behalf of 4170 the program. Both numbers are in seconds. 4171 4172`-fvar-tracking' 4173 Run variable tracking pass. It computes where variables are 4174 stored at each position in code. Better debugging information is 4175 then generated (if the debugging information format supports this 4176 information). 4177 4178 It is enabled by default when compiling with optimization (`-Os', 4179 `-O', `-O2', ...), debugging information (`-g') and the debug info 4180 format supports it. 4181 4182`-print-file-name=LIBRARY' 4183 Print the full absolute name of the library file LIBRARY that 4184 would be used when linking--and don't do anything else. With this 4185 option, GCC does not compile or link anything; it just prints the 4186 file name. 4187 4188`-print-multi-directory' 4189 Print the directory name corresponding to the multilib selected by 4190 any other switches present in the command line. This directory is 4191 supposed to exist in `GCC_EXEC_PREFIX'. 4192 4193`-print-multi-lib' 4194 Print the mapping from multilib directory names to compiler 4195 switches that enable them. The directory name is separated from 4196 the switches by `;', and each switch starts with an `@' instead of 4197 the `-', without spaces between multiple switches. This is 4198 supposed to ease shell-processing. 4199 4200`-print-prog-name=PROGRAM' 4201 Like `-print-file-name', but searches for a program such as `cpp'. 4202 4203`-print-libgcc-file-name' 4204 Same as `-print-file-name=libgcc.a'. 4205 4206 This is useful when you use `-nostdlib' or `-nodefaultlibs' but 4207 you do want to link with `libgcc.a'. You can do 4208 4209 gcc -nostdlib FILES... `gcc -print-libgcc-file-name` 4210 4211`-print-search-dirs' 4212 Print the name of the configured installation directory and a list 4213 of program and library directories `gcc' will search--and don't do 4214 anything else. 4215 4216 This is useful when `gcc' prints the error message `installation 4217 problem, cannot exec cpp0: No such file or directory'. To resolve 4218 this you either need to put `cpp0' and the other compiler 4219 components where `gcc' expects to find them, or you can set the 4220 environment variable `GCC_EXEC_PREFIX' to the directory where you 4221 installed them. Don't forget the trailing `/'. *Note Environment 4222 Variables::. 4223 4224`-dumpmachine' 4225 Print the compiler's target machine (for example, 4226 `i686-pc-linux-gnu')--and don't do anything else. 4227 4228`-dumpversion' 4229 Print the compiler version (for example, `3.0')--and don't do 4230 anything else. 4231 4232`-dumpspecs' 4233 Print the compiler's built-in specs--and don't do anything else. 4234 (This is used when GCC itself is being built.) *Note Spec Files::. 4235 4236`-feliminate-unused-debug-types' 4237 Normally, when producing DWARF2 output, GCC will emit debugging 4238 information for all types declared in a compilation unit, 4239 regardless of whether or not they are actually used in that 4240 compilation unit. Sometimes this is useful, such as if, in the 4241 debugger, you want to cast a value to a type that is not actually 4242 used in your program (but is declared). More often, however, this 4243 results in a significant amount of wasted space. With this 4244 option, GCC will avoid producing debug symbol output for types 4245 that are nowhere used in the source file being compiled. 4246 4247 4248File: gcc.info, Node: Optimize Options, Next: Preprocessor Options, Prev: Debugging Options, Up: Invoking GCC 4249 42503.10 Options That Control Optimization 4251====================================== 4252 4253These options control various sorts of optimizations. 4254 4255 Without any optimization option, the compiler's goal is to reduce the 4256cost of compilation and to make debugging produce the expected results. 4257Statements are independent: if you stop the program with a breakpoint 4258between statements, you can then assign a new value to any variable or 4259change the program counter to any other statement in the function and 4260get exactly the results you would expect from the source code. 4261 4262 Turning on optimization flags makes the compiler attempt to improve 4263the performance and/or code size at the expense of compilation time and 4264possibly the ability to debug the program. 4265 4266 The compiler performs optimization based on the knowledge it has of 4267the program. Optimization levels `-O' and above, in particular, enable 4268_unit-at-a-time_ mode, which allows the compiler to consider 4269information gained from later functions in the file when compiling a 4270function. Compiling multiple files at once to a single output file in 4271_unit-at-a-time_ mode allows the compiler to use information gained 4272from all of the files when compiling each of them. 4273 4274 Not all optimizations are controlled directly by a flag. Only 4275optimizations that have a flag are listed. 4276 4277`-O' 4278`-O1' 4279 Optimize. Optimizing compilation takes somewhat more time, and a 4280 lot more memory for a large function. 4281 4282 With `-O', the compiler tries to reduce code size and execution 4283 time, without performing any optimizations that take a great deal 4284 of compilation time. 4285 4286 `-O' turns on the following optimization flags: 4287 -fdefer-pop 4288 -fdelayed-branch 4289 -fguess-branch-probability 4290 -fcprop-registers 4291 -fif-conversion 4292 -fif-conversion2 4293 -ftree-ccp 4294 -ftree-dce 4295 -ftree-dominator-opts 4296 -ftree-dse 4297 -ftree-ter 4298 -ftree-lrs 4299 -ftree-sra 4300 -ftree-copyrename 4301 -ftree-fre 4302 -ftree-ch 4303 -funit-at-a-time 4304 -fmerge-constants 4305 4306 `-O' also turns on `-fomit-frame-pointer' on machines where doing 4307 so does not interfere with debugging. 4308 4309`-O2' 4310 Optimize even more. GCC performs nearly all supported 4311 optimizations that do not involve a space-speed tradeoff. The 4312 compiler does not perform loop unrolling or function inlining when 4313 you specify `-O2'. As compared to `-O', this option increases 4314 both compilation time and the performance of the generated code. 4315 4316 `-O2' turns on all optimization flags specified by `-O'. It also 4317 turns on the following optimization flags: 4318 -fthread-jumps 4319 -fcrossjumping 4320 -foptimize-sibling-calls 4321 -fcse-follow-jumps -fcse-skip-blocks 4322 -fgcse -fgcse-lm 4323 -fexpensive-optimizations 4324 -frerun-cse-after-loop 4325 -fcaller-saves 4326 -fpeephole2 4327 -fschedule-insns -fschedule-insns2 4328 -fsched-interblock -fsched-spec 4329 -fregmove 4330 -fstrict-aliasing -fstrict-overflow 4331 -fdelete-null-pointer-checks 4332 -freorder-blocks -freorder-functions 4333 -falign-functions -falign-jumps 4334 -falign-loops -falign-labels 4335 -ftree-vrp 4336 -ftree-pre 4337 4338 Please note the warning under `-fgcse' about invoking `-O2' on 4339 programs that use computed gotos. 4340 4341 `-O2' doesn't turn on `-ftree-vrp' for the Ada compiler. This 4342 option must be explicitly specified on the command line to be 4343 enabled for the Ada compiler. 4344 4345`-O3' 4346 Optimize yet more. `-O3' turns on all optimizations specified by 4347 `-O2' and also turns on the `-finline-functions', 4348 `-funswitch-loops' and `-fgcse-after-reload' options. 4349 4350`-O0' 4351 Do not optimize. This is the default. 4352 4353`-Os' 4354 Optimize for size. `-Os' enables all `-O2' optimizations that do 4355 not typically increase code size. It also performs further 4356 optimizations designed to reduce code size. 4357 4358 `-Os' disables the following optimization flags: 4359 -falign-functions -falign-jumps -falign-loops 4360 -falign-labels -freorder-blocks -freorder-blocks-and-partition 4361 -fprefetch-loop-arrays -ftree-vect-loop-version 4362 4363 If you use multiple `-O' options, with or without level numbers, 4364 the last such option is the one that is effective. 4365 4366 Options of the form `-fFLAG' specify machine-independent flags. Most 4367flags have both positive and negative forms; the negative form of 4368`-ffoo' would be `-fno-foo'. In the table below, only one of the forms 4369is listed--the one you typically will use. You can figure out the 4370other form by either removing `no-' or adding it. 4371 4372 The following options control specific optimizations. They are either 4373activated by `-O' options or are related to ones that are. You can use 4374the following flags in the rare cases when "fine-tuning" of 4375optimizations to be performed is desired. 4376 4377`-fno-default-inline' 4378 Do not make member functions inline by default merely because they 4379 are defined inside the class scope (C++ only). Otherwise, when 4380 you specify `-O', member functions defined inside class scope are 4381 compiled inline by default; i.e., you don't need to add `inline' 4382 in front of the member function name. 4383 4384`-fno-defer-pop' 4385 Always pop the arguments to each function call as soon as that 4386 function returns. For machines which must pop arguments after a 4387 function call, the compiler normally lets arguments accumulate on 4388 the stack for several function calls and pops them all at once. 4389 4390 Disabled at levels `-O', `-O2', `-O3', `-Os'. 4391 4392`-fforce-mem' 4393 Force memory operands to be copied into registers before doing 4394 arithmetic on them. This produces better code by making all memory 4395 references potential common subexpressions. When they are not 4396 common subexpressions, instruction combination should eliminate 4397 the separate register-load. This option is now a nop and will be 4398 removed in 4.3. 4399 4400`-fforce-addr' 4401 Force memory address constants to be copied into registers before 4402 doing arithmetic on them. 4403 4404`-fomit-frame-pointer' 4405 Don't keep the frame pointer in a register for functions that 4406 don't need one. This avoids the instructions to save, set up and 4407 restore frame pointers; it also makes an extra register available 4408 in many functions. *It also makes debugging impossible on some 4409 machines.* 4410 4411 On some machines, such as the VAX, this flag has no effect, because 4412 the standard calling sequence automatically handles the frame 4413 pointer and nothing is saved by pretending it doesn't exist. The 4414 machine-description macro `FRAME_POINTER_REQUIRED' controls 4415 whether a target machine supports this flag. *Note Register 4416 Usage: (gccint)Registers. 4417 4418 Enabled at levels `-O', `-O2', `-O3', `-Os'. 4419 4420`-foptimize-sibling-calls' 4421 Optimize sibling and tail recursive calls. 4422 4423 Enabled at levels `-O2', `-O3', `-Os'. 4424 4425`-fno-inline' 4426 Don't pay attention to the `inline' keyword. Normally this option 4427 is used to keep the compiler from expanding any functions inline. 4428 Note that if you are not optimizing, no functions can be expanded 4429 inline. 4430 4431`-finline-functions' 4432 Integrate all simple functions into their callers. The compiler 4433 heuristically decides which functions are simple enough to be worth 4434 integrating in this way. 4435 4436 If all calls to a given function are integrated, and the function 4437 is declared `static', then the function is normally not output as 4438 assembler code in its own right. 4439 4440 Enabled at level `-O3'. 4441 4442`-finline-functions-called-once' 4443 Consider all `static' functions called once for inlining into their 4444 caller even if they are not marked `inline'. If a call to a given 4445 function is integrated, then the function is not output as 4446 assembler code in its own right. 4447 4448 Enabled if `-funit-at-a-time' is enabled. 4449 4450`-fearly-inlining' 4451 Inline functions marked by `always_inline' and functions whose 4452 body seems smaller than the function call overhead early before 4453 doing `-fprofile-generate' instrumentation and real inlining pass. 4454 Doing so makes profiling significantly cheaper and usually 4455 inlining faster on programs having large chains of nested wrapper 4456 functions. 4457 4458 Enabled by default. 4459 4460`-finline-limit=N' 4461 By default, GCC limits the size of functions that can be inlined. 4462 This flag allows the control of this limit for functions that are 4463 explicitly marked as inline (i.e., marked with the inline keyword 4464 or defined within the class definition in c++). N is the size of 4465 functions that can be inlined in number of pseudo instructions 4466 (not counting parameter handling). The default value of N is 600. 4467 Increasing this value can result in more inlined code at the cost 4468 of compilation time and memory consumption. Decreasing usually 4469 makes the compilation faster and less code will be inlined (which 4470 presumably means slower programs). This option is particularly 4471 useful for programs that use inlining heavily such as those based 4472 on recursive templates with C++. 4473 4474 Inlining is actually controlled by a number of parameters, which 4475 may be specified individually by using `--param NAME=VALUE'. The 4476 `-finline-limit=N' option sets some of these parameters as follows: 4477 4478 `max-inline-insns-single' 4479 is set to N/2. 4480 4481 `max-inline-insns-auto' 4482 is set to N/2. 4483 4484 `min-inline-insns' 4485 is set to 130 or N/4, whichever is smaller. 4486 4487 `max-inline-insns-rtl' 4488 is set to N. 4489 4490 See below for a documentation of the individual parameters 4491 controlling inlining. 4492 4493 _Note:_ pseudo instruction represents, in this particular context, 4494 an abstract measurement of function's size. In no way does it 4495 represent a count of assembly instructions and as such its exact 4496 meaning might change from one release to an another. 4497 4498`-fkeep-inline-functions' 4499 In C, emit `static' functions that are declared `inline' into the 4500 object file, even if the function has been inlined into all of its 4501 callers. This switch does not affect functions using the `extern 4502 inline' extension in GNU C. In C++, emit any and all inline 4503 functions into the object file. 4504 4505`-fkeep-static-consts' 4506 Emit variables declared `static const' when optimization isn't 4507 turned on, even if the variables aren't referenced. 4508 4509 GCC enables this option by default. If you want to force the 4510 compiler to check if the variable was referenced, regardless of 4511 whether or not optimization is turned on, use the 4512 `-fno-keep-static-consts' option. 4513 4514`-fmerge-constants' 4515 Attempt to merge identical constants (string constants and 4516 floating point constants) across compilation units. 4517 4518 This option is the default for optimized compilation if the 4519 assembler and linker support it. Use `-fno-merge-constants' to 4520 inhibit this behavior. 4521 4522 Enabled at levels `-O', `-O2', `-O3', `-Os'. 4523 4524`-fmerge-all-constants' 4525 Attempt to merge identical constants and identical variables. 4526 4527 This option implies `-fmerge-constants'. In addition to 4528 `-fmerge-constants' this considers e.g. even constant initialized 4529 arrays or initialized constant variables with integral or floating 4530 point types. Languages like C or C++ require each non-automatic 4531 variable to have distinct location, so using this option will 4532 result in non-conforming behavior. 4533 4534`-fmodulo-sched' 4535 Perform swing modulo scheduling immediately before the first 4536 scheduling pass. This pass looks at innermost loops and reorders 4537 their instructions by overlapping different iterations. 4538 4539`-fno-branch-count-reg' 4540 Do not use "decrement and branch" instructions on a count register, 4541 but instead generate a sequence of instructions that decrement a 4542 register, compare it against zero, then branch based upon the 4543 result. This option is only meaningful on architectures that 4544 support such instructions, which include x86, PowerPC, IA-64 and 4545 S/390. 4546 4547 The default is `-fbranch-count-reg'. 4548 4549`-fno-function-cse' 4550 Do not put function addresses in registers; make each instruction 4551 that calls a constant function contain the function's address 4552 explicitly. 4553 4554 This option results in less efficient code, but some strange hacks 4555 that alter the assembler output may be confused by the 4556 optimizations performed when this option is not used. 4557 4558 The default is `-ffunction-cse' 4559 4560`-fno-zero-initialized-in-bss' 4561 If the target supports a BSS section, GCC by default puts 4562 variables that are initialized to zero into BSS. This can save 4563 space in the resulting code. 4564 4565 This option turns off this behavior because some programs 4566 explicitly rely on variables going to the data section. E.g., so 4567 that the resulting executable can find the beginning of that 4568 section and/or make assumptions based on that. 4569 4570 The default is `-fzero-initialized-in-bss'. 4571 4572`-fbounds-check' 4573 For front-ends that support it, generate additional code to check 4574 that indices used to access arrays are within the declared range. 4575 This is currently only supported by the Java and Fortran 4576 front-ends, where this option defaults to true and false 4577 respectively. 4578 4579`-fmudflap -fmudflapth -fmudflapir' 4580 For front-ends that support it (C and C++), instrument all risky 4581 pointer/array dereferencing operations, some standard library 4582 string/heap functions, and some other associated constructs with 4583 range/validity tests. Modules so instrumented should be immune to 4584 buffer overflows, invalid heap use, and some other classes of C/C++ 4585 programming errors. The instrumentation relies on a separate 4586 runtime library (`libmudflap'), which will be linked into a 4587 program if `-fmudflap' is given at link time. Run-time behavior 4588 of the instrumented program is controlled by the `MUDFLAP_OPTIONS' 4589 environment variable. See `env MUDFLAP_OPTIONS=-help a.out' for 4590 its options. 4591 4592 Use `-fmudflapth' instead of `-fmudflap' to compile and to link if 4593 your program is multi-threaded. Use `-fmudflapir', in addition to 4594 `-fmudflap' or `-fmudflapth', if instrumentation should ignore 4595 pointer reads. This produces less instrumentation (and therefore 4596 faster execution) and still provides some protection against 4597 outright memory corrupting writes, but allows erroneously read 4598 data to propagate within a program. 4599 4600`-fthread-jumps' 4601 Perform optimizations where we check to see if a jump branches to a 4602 location where another comparison subsumed by the first is found. 4603 If so, the first branch is redirected to either the destination of 4604 the second branch or a point immediately following it, depending 4605 on whether the condition is known to be true or false. 4606 4607 Enabled at levels `-O2', `-O3', `-Os'. 4608 4609`-fcse-follow-jumps' 4610 In common subexpression elimination, scan through jump instructions 4611 when the target of the jump is not reached by any other path. For 4612 example, when CSE encounters an `if' statement with an `else' 4613 clause, CSE will follow the jump when the condition tested is 4614 false. 4615 4616 Enabled at levels `-O2', `-O3', `-Os'. 4617 4618`-fcse-skip-blocks' 4619 This is similar to `-fcse-follow-jumps', but causes CSE to follow 4620 jumps which conditionally skip over blocks. When CSE encounters a 4621 simple `if' statement with no else clause, `-fcse-skip-blocks' 4622 causes CSE to follow the jump around the body of the `if'. 4623 4624 Enabled at levels `-O2', `-O3', `-Os'. 4625 4626`-frerun-cse-after-loop' 4627 Re-run common subexpression elimination after loop optimizations 4628 has been performed. 4629 4630 Enabled at levels `-O2', `-O3', `-Os'. 4631 4632`-fgcse' 4633 Perform a global common subexpression elimination pass. This pass 4634 also performs global constant and copy propagation. 4635 4636 _Note:_ When compiling a program using computed gotos, a GCC 4637 extension, you may get better runtime performance if you disable 4638 the global common subexpression elimination pass by adding 4639 `-fno-gcse' to the command line. 4640 4641 Enabled at levels `-O2', `-O3', `-Os'. 4642 4643`-fgcse-lm' 4644 When `-fgcse-lm' is enabled, global common subexpression 4645 elimination will attempt to move loads which are only killed by 4646 stores into themselves. This allows a loop containing a 4647 load/store sequence to be changed to a load outside the loop, and 4648 a copy/store within the loop. 4649 4650 Enabled by default when gcse is enabled. 4651 4652`-fgcse-sm' 4653 When `-fgcse-sm' is enabled, a store motion pass is run after 4654 global common subexpression elimination. This pass will attempt 4655 to move stores out of loops. When used in conjunction with 4656 `-fgcse-lm', loops containing a load/store sequence can be changed 4657 to a load before the loop and a store after the loop. 4658 4659 Not enabled at any optimization level. 4660 4661`-fgcse-las' 4662 When `-fgcse-las' is enabled, the global common subexpression 4663 elimination pass eliminates redundant loads that come after stores 4664 to the same memory location (both partial and full redundancies). 4665 4666 Not enabled at any optimization level. 4667 4668`-fgcse-after-reload' 4669 When `-fgcse-after-reload' is enabled, a redundant load elimination 4670 pass is performed after reload. The purpose of this pass is to 4671 cleanup redundant spilling. 4672 4673`-funsafe-loop-optimizations' 4674 If given, the loop optimizer will assume that loop indices do not 4675 overflow, and that the loops with nontrivial exit condition are not 4676 infinite. This enables a wider range of loop optimizations even if 4677 the loop optimizer itself cannot prove that these assumptions are 4678 valid. Using `-Wunsafe-loop-optimizations', the compiler will 4679 warn you if it finds this kind of loop. 4680 4681`-fcrossjumping' 4682 Perform cross-jumping transformation. This transformation unifies 4683 equivalent code and save code size. The resulting code may or may 4684 not perform better than without cross-jumping. 4685 4686 Enabled at levels `-O2', `-O3', `-Os'. 4687 4688`-fif-conversion' 4689 Attempt to transform conditional jumps into branch-less 4690 equivalents. This include use of conditional moves, min, max, set 4691 flags and abs instructions, and some tricks doable by standard 4692 arithmetics. The use of conditional execution on chips where it 4693 is available is controlled by `if-conversion2'. 4694 4695 Enabled at levels `-O', `-O2', `-O3', `-Os'. 4696 4697`-fif-conversion2' 4698 Use conditional execution (where available) to transform 4699 conditional jumps into branch-less equivalents. 4700 4701 Enabled at levels `-O', `-O2', `-O3', `-Os'. 4702 4703`-fdelete-null-pointer-checks' 4704 Use global dataflow analysis to identify and eliminate useless 4705 checks for null pointers. The compiler assumes that dereferencing 4706 a null pointer would have halted the program. If a pointer is 4707 checked after it has already been dereferenced, it cannot be null. 4708 4709 In some environments, this assumption is not true, and programs can 4710 safely dereference null pointers. Use 4711 `-fno-delete-null-pointer-checks' to disable this optimization for 4712 programs which depend on that behavior. 4713 4714 Enabled at levels `-O2', `-O3', `-Os'. 4715 4716`-fexpensive-optimizations' 4717 Perform a number of minor optimizations that are relatively 4718 expensive. 4719 4720 Enabled at levels `-O2', `-O3', `-Os'. 4721 4722`-foptimize-register-move' 4723`-fregmove' 4724 Attempt to reassign register numbers in move instructions and as 4725 operands of other simple instructions in order to maximize the 4726 amount of register tying. This is especially helpful on machines 4727 with two-operand instructions. 4728 4729 Note `-fregmove' and `-foptimize-register-move' are the same 4730 optimization. 4731 4732 Enabled at levels `-O2', `-O3', `-Os'. 4733 4734`-fdelayed-branch' 4735 If supported for the target machine, attempt to reorder 4736 instructions to exploit instruction slots available after delayed 4737 branch instructions. 4738 4739 Enabled at levels `-O', `-O2', `-O3', `-Os'. 4740 4741`-fschedule-insns' 4742 If supported for the target machine, attempt to reorder 4743 instructions to eliminate execution stalls due to required data 4744 being unavailable. This helps machines that have slow floating 4745 point or memory load instructions by allowing other instructions 4746 to be issued until the result of the load or floating point 4747 instruction is required. 4748 4749 Enabled at levels `-O2', `-O3', `-Os'. 4750 4751`-fschedule-insns2' 4752 Similar to `-fschedule-insns', but requests an additional pass of 4753 instruction scheduling after register allocation has been done. 4754 This is especially useful on machines with a relatively small 4755 number of registers and where memory load instructions take more 4756 than one cycle. 4757 4758 Enabled at levels `-O2', `-O3', `-Os'. 4759 4760`-fno-sched-interblock' 4761 Don't schedule instructions across basic blocks. This is normally 4762 enabled by default when scheduling before register allocation, i.e. 4763 with `-fschedule-insns' or at `-O2' or higher. 4764 4765`-fno-sched-spec' 4766 Don't allow speculative motion of non-load instructions. This is 4767 normally enabled by default when scheduling before register 4768 allocation, i.e. with `-fschedule-insns' or at `-O2' or higher. 4769 4770`-fsched-spec-load' 4771 Allow speculative motion of some load instructions. This only 4772 makes sense when scheduling before register allocation, i.e. with 4773 `-fschedule-insns' or at `-O2' or higher. 4774 4775`-fsched-spec-load-dangerous' 4776 Allow speculative motion of more load instructions. This only 4777 makes sense when scheduling before register allocation, i.e. with 4778 `-fschedule-insns' or at `-O2' or higher. 4779 4780`-fsched-stalled-insns=N' 4781 Define how many insns (if any) can be moved prematurely from the 4782 queue of stalled insns into the ready list, during the second 4783 scheduling pass. 4784 4785`-fsched-stalled-insns-dep=N' 4786 Define how many insn groups (cycles) will be examined for a 4787 dependency on a stalled insn that is candidate for premature 4788 removal from the queue of stalled insns. Has an effect only 4789 during the second scheduling pass, and only if 4790 `-fsched-stalled-insns' is used and its value is not zero. 4791 4792`-fsched2-use-superblocks' 4793 When scheduling after register allocation, do use superblock 4794 scheduling algorithm. Superblock scheduling allows motion across 4795 basic block boundaries resulting on faster schedules. This option 4796 is experimental, as not all machine descriptions used by GCC model 4797 the CPU closely enough to avoid unreliable results from the 4798 algorithm. 4799 4800 This only makes sense when scheduling after register allocation, 4801 i.e. with `-fschedule-insns2' or at `-O2' or higher. 4802 4803`-fsched2-use-traces' 4804 Use `-fsched2-use-superblocks' algorithm when scheduling after 4805 register allocation and additionally perform code duplication in 4806 order to increase the size of superblocks using tracer pass. See 4807 `-ftracer' for details on trace formation. 4808 4809 This mode should produce faster but significantly longer programs. 4810 Also without `-fbranch-probabilities' the traces constructed may 4811 not match the reality and hurt the performance. This only makes 4812 sense when scheduling after register allocation, i.e. with 4813 `-fschedule-insns2' or at `-O2' or higher. 4814 4815`-fsee' 4816 Eliminates redundant extension instructions and move the non 4817 redundant ones to optimal placement using LCM. 4818 4819`-freschedule-modulo-scheduled-loops' 4820 The modulo scheduling comes before the traditional scheduling, if 4821 a loop was modulo scheduled we may want to prevent the later 4822 scheduling passes from changing its schedule, we use this option 4823 to control that. 4824 4825`-fcaller-saves' 4826 Enable values to be allocated in registers that will be clobbered 4827 by function calls, by emitting extra instructions to save and 4828 restore the registers around such calls. Such allocation is done 4829 only when it seems to result in better code than would otherwise 4830 be produced. 4831 4832 This option is always enabled by default on certain machines, 4833 usually those which have no call-preserved registers to use 4834 instead. 4835 4836 Enabled at levels `-O2', `-O3', `-Os'. 4837 4838`-ftree-pre' 4839 Perform Partial Redundancy Elimination (PRE) on trees. This flag 4840 is enabled by default at `-O2' and `-O3'. 4841 4842`-ftree-fre' 4843 Perform Full Redundancy Elimination (FRE) on trees. The difference 4844 between FRE and PRE is that FRE only considers expressions that 4845 are computed on all paths leading to the redundant computation. 4846 This analysis faster than PRE, though it exposes fewer 4847 redundancies. This flag is enabled by default at `-O' and higher. 4848 4849`-ftree-copy-prop' 4850 Perform copy propagation on trees. This pass eliminates 4851 unnecessary copy operations. This flag is enabled by default at 4852 `-O' and higher. 4853 4854`-ftree-store-copy-prop' 4855 Perform copy propagation of memory loads and stores. This pass 4856 eliminates unnecessary copy operations in memory references 4857 (structures, global variables, arrays, etc). This flag is enabled 4858 by default at `-O2' and higher. 4859 4860`-ftree-salias' 4861 Perform structural alias analysis on trees. This flag is enabled 4862 by default at `-O' and higher. 4863 4864`-fipa-pta' 4865 Perform interprocedural pointer analysis. 4866 4867`-ftree-sink' 4868 Perform forward store motion on trees. This flag is enabled by 4869 default at `-O' and higher. 4870 4871`-ftree-ccp' 4872 Perform sparse conditional constant propagation (CCP) on trees. 4873 This pass only operates on local scalar variables and is enabled 4874 by default at `-O' and higher. 4875 4876`-ftree-store-ccp' 4877 Perform sparse conditional constant propagation (CCP) on trees. 4878 This pass operates on both local scalar variables and memory 4879 stores and loads (global variables, structures, arrays, etc). 4880 This flag is enabled by default at `-O2' and higher. 4881 4882`-ftree-dce' 4883 Perform dead code elimination (DCE) on trees. This flag is 4884 enabled by default at `-O' and higher. 4885 4886`-ftree-dominator-opts' 4887 Perform a variety of simple scalar cleanups (constant/copy 4888 propagation, redundancy elimination, range propagation and 4889 expression simplification) based on a dominator tree traversal. 4890 This also performs jump threading (to reduce jumps to jumps). This 4891 flag is enabled by default at `-O' and higher. 4892 4893`-ftree-ch' 4894 Perform loop header copying on trees. This is beneficial since it 4895 increases effectiveness of code motion optimizations. It also 4896 saves one jump. This flag is enabled by default at `-O' and 4897 higher. It is not enabled for `-Os', since it usually increases 4898 code size. 4899 4900`-ftree-loop-optimize' 4901 Perform loop optimizations on trees. This flag is enabled by 4902 default at `-O' and higher. 4903 4904`-ftree-loop-linear' 4905 Perform linear loop transformations on tree. This flag can 4906 improve cache performance and allow further loop optimizations to 4907 take place. 4908 4909`-ftree-loop-im' 4910 Perform loop invariant motion on trees. This pass moves only 4911 invariants that would be hard to handle at RTL level (function 4912 calls, operations that expand to nontrivial sequences of insns). 4913 With `-funswitch-loops' it also moves operands of conditions that 4914 are invariant out of the loop, so that we can use just trivial 4915 invariantness analysis in loop unswitching. The pass also includes 4916 store motion. 4917 4918`-ftree-loop-ivcanon' 4919 Create a canonical counter for number of iterations in the loop 4920 for that determining number of iterations requires complicated 4921 analysis. Later optimizations then may determine the number 4922 easily. Useful especially in connection with unrolling. 4923 4924`-fivopts' 4925 Perform induction variable optimizations (strength reduction, 4926 induction variable merging and induction variable elimination) on 4927 trees. 4928 4929`-ftree-sra' 4930 Perform scalar replacement of aggregates. This pass replaces 4931 structure references with scalars to prevent committing structures 4932 to memory too early. This flag is enabled by default at `-O' and 4933 higher. 4934 4935`-ftree-copyrename' 4936 Perform copy renaming on trees. This pass attempts to rename 4937 compiler temporaries to other variables at copy locations, usually 4938 resulting in variable names which more closely resemble the 4939 original variables. This flag is enabled by default at `-O' and 4940 higher. 4941 4942`-ftree-ter' 4943 Perform temporary expression replacement during the SSA->normal 4944 phase. Single use/single def temporaries are replaced at their 4945 use location with their defining expression. This results in 4946 non-GIMPLE code, but gives the expanders much more complex trees 4947 to work on resulting in better RTL generation. This is enabled by 4948 default at `-O' and higher. 4949 4950`-ftree-lrs' 4951 Perform live range splitting during the SSA->normal phase. 4952 Distinct live ranges of a variable are split into unique 4953 variables, allowing for better optimization later. This is 4954 enabled by default at `-O' and higher. 4955 4956`-ftree-vectorize' 4957 Perform loop vectorization on trees. 4958 4959`-ftree-vect-loop-version' 4960 Perform loop versioning when doing loop vectorization on trees. 4961 When a loop appears to be vectorizable except that data alignment 4962 or data dependence cannot be determined at compile time then 4963 vectorized and non-vectorized versions of the loop are generated 4964 along with runtime checks for alignment or dependence to control 4965 which version is executed. This option is enabled by default 4966 except at level `-Os' where it is disabled. 4967 4968`-ftree-vrp' 4969 Perform Value Range Propagation on trees. This is similar to the 4970 constant propagation pass, but instead of values, ranges of values 4971 are propagated. This allows the optimizers to remove unnecessary 4972 range checks like array bound checks and null pointer checks. 4973 This is enabled by default at `-O2' and higher. Null pointer check 4974 elimination is only done if `-fdelete-null-pointer-checks' is 4975 enabled. 4976 4977`-ftracer' 4978 Perform tail duplication to enlarge superblock size. This 4979 transformation simplifies the control flow of the function 4980 allowing other optimizations to do better job. 4981 4982`-funroll-loops' 4983 Unroll loops whose number of iterations can be determined at 4984 compile time or upon entry to the loop. `-funroll-loops' implies 4985 `-frerun-cse-after-loop'. This option makes code larger, and may 4986 or may not make it run faster. 4987 4988`-funroll-all-loops' 4989 Unroll all loops, even if their number of iterations is uncertain 4990 when the loop is entered. This usually makes programs run more 4991 slowly. `-funroll-all-loops' implies the same options as 4992 `-funroll-loops', 4993 4994`-fsplit-ivs-in-unroller' 4995 Enables expressing of values of induction variables in later 4996 iterations of the unrolled loop using the value in the first 4997 iteration. This breaks long dependency chains, thus improving 4998 efficiency of the scheduling passes. 4999 5000 Combination of `-fweb' and CSE is often sufficient to obtain the 5001 same effect. However in cases the loop body is more complicated 5002 than a single basic block, this is not reliable. It also does not 5003 work at all on some of the architectures due to restrictions in 5004 the CSE pass. 5005 5006 This optimization is enabled by default. 5007 5008`-fvariable-expansion-in-unroller' 5009 With this option, the compiler will create multiple copies of some 5010 local variables when unrolling a loop which can result in superior 5011 code. 5012 5013`-fprefetch-loop-arrays' 5014 If supported by the target machine, generate instructions to 5015 prefetch memory to improve the performance of loops that access 5016 large arrays. 5017 5018 This option may generate better or worse code; results are highly 5019 dependent on the structure of loops within the source code. 5020 5021 Disabled at level `-Os'. 5022 5023`-fno-peephole' 5024`-fno-peephole2' 5025 Disable any machine-specific peephole optimizations. The 5026 difference between `-fno-peephole' and `-fno-peephole2' is in how 5027 they are implemented in the compiler; some targets use one, some 5028 use the other, a few use both. 5029 5030 `-fpeephole' is enabled by default. `-fpeephole2' enabled at 5031 levels `-O2', `-O3', `-Os'. 5032 5033`-fno-guess-branch-probability' 5034 Do not guess branch probabilities using heuristics. 5035 5036 GCC will use heuristics to guess branch probabilities if they are 5037 not provided by profiling feedback (`-fprofile-arcs'). These 5038 heuristics are based on the control flow graph. If some branch 5039 probabilities are specified by `__builtin_expect', then the 5040 heuristics will be used to guess branch probabilities for the rest 5041 of the control flow graph, taking the `__builtin_expect' info into 5042 account. The interactions between the heuristics and 5043 `__builtin_expect' can be complex, and in some cases, it may be 5044 useful to disable the heuristics so that the effects of 5045 `__builtin_expect' are easier to understand. 5046 5047 The default is `-fguess-branch-probability' at levels `-O', `-O2', 5048 `-O3', `-Os'. 5049 5050`-freorder-blocks' 5051 Reorder basic blocks in the compiled function in order to reduce 5052 number of taken branches and improve code locality. 5053 5054 Enabled at levels `-O2', `-O3'. 5055 5056`-freorder-blocks-and-partition' 5057 In addition to reordering basic blocks in the compiled function, 5058 in order to reduce number of taken branches, partitions hot and 5059 cold basic blocks into separate sections of the assembly and .o 5060 files, to improve paging and cache locality performance. 5061 5062 This optimization is automatically turned off in the presence of 5063 exception handling, for linkonce sections, for functions with a 5064 user-defined section attribute and on any architecture that does 5065 not support named sections. 5066 5067`-freorder-functions' 5068 Reorder functions in the object file in order to improve code 5069 locality. This is implemented by using special subsections 5070 `.text.hot' for most frequently executed functions and 5071 `.text.unlikely' for unlikely executed functions. Reordering is 5072 done by the linker so object file format must support named 5073 sections and linker must place them in a reasonable way. 5074 5075 Also profile feedback must be available in to make this option 5076 effective. See `-fprofile-arcs' for details. 5077 5078 Enabled at levels `-O2', `-O3', `-Os'. 5079 5080`-fstrict-aliasing' 5081 Allows the compiler to assume the strictest aliasing rules 5082 applicable to the language being compiled. For C (and C++), this 5083 activates optimizations based on the type of expressions. In 5084 particular, an object of one type is assumed never to reside at 5085 the same address as an object of a different type, unless the 5086 types are almost the same. For example, an `unsigned int' can 5087 alias an `int', but not a `void*' or a `double'. A character type 5088 may alias any other type. 5089 5090 Pay special attention to code like this: 5091 union a_union { 5092 int i; 5093 double d; 5094 }; 5095 5096 int f() { 5097 a_union t; 5098 t.d = 3.0; 5099 return t.i; 5100 } 5101 The practice of reading from a different union member than the one 5102 most recently written to (called "type-punning") is common. Even 5103 with `-fstrict-aliasing', type-punning is allowed, provided the 5104 memory is accessed through the union type. So, the code above 5105 will work as expected. However, this code might not: 5106 int f() { 5107 a_union t; 5108 int* ip; 5109 t.d = 3.0; 5110 ip = &t.i; 5111 return *ip; 5112 } 5113 5114 Every language that wishes to perform language-specific alias 5115 analysis should define a function that computes, given an `tree' 5116 node, an alias set for the node. Nodes in different alias sets 5117 are not allowed to alias. For an example, see the C front-end 5118 function `c_get_alias_set'. 5119 5120 Enabled at levels `-O2', `-O3', `-Os'. 5121 5122`-fstrict-overflow' 5123 Allow the compiler to assume strict signed overflow rules, 5124 depending on the language being compiled. For C (and C++) this 5125 means that overflow when doing arithmetic with signed numbers is 5126 undefined, which means that the compiler may assume that it will 5127 not happen. This permits various optimizations. For example, the 5128 compiler will assume that an expression like `i + 10 > i' will 5129 always be true for signed `i'. This assumption is only valid if 5130 signed overflow is undefined, as the expression is false if `i + 5131 10' overflows when using twos complement arithmetic. When this 5132 option is in effect any attempt to determine whether an operation 5133 on signed numbers will overflow must be written carefully to not 5134 actually involve overflow. 5135 5136 See also the `-fwrapv' option. Using `-fwrapv' means that signed 5137 overflow is fully defined: it wraps. When `-fwrapv' is used, 5138 there is no difference between `-fstrict-overflow' and 5139 `-fno-strict-overflow'. With `-fwrapv' certain types of overflow 5140 are permitted. For example, if the compiler gets an overflow when 5141 doing arithmetic on constants, the overflowed value can still be 5142 used with `-fwrapv', but not otherwise. 5143 5144 The `-fstrict-overflow' option is enabled at levels `-O2', `-O3', 5145 `-Os'. 5146 5147`-falign-functions' 5148`-falign-functions=N' 5149 Align the start of functions to the next power-of-two greater than 5150 N, skipping up to N bytes. For instance, `-falign-functions=32' 5151 aligns functions to the next 32-byte boundary, but 5152 `-falign-functions=24' would align to the next 32-byte boundary 5153 only if this can be done by skipping 23 bytes or less. 5154 5155 `-fno-align-functions' and `-falign-functions=1' are equivalent 5156 and mean that functions will not be aligned. 5157 5158 Some assemblers only support this flag when N is a power of two; 5159 in that case, it is rounded up. 5160 5161 If N is not specified or is zero, use a machine-dependent default. 5162 5163 Enabled at levels `-O2', `-O3'. 5164 5165`-falign-labels' 5166`-falign-labels=N' 5167 Align all branch targets to a power-of-two boundary, skipping up to 5168 N bytes like `-falign-functions'. This option can easily make 5169 code slower, because it must insert dummy operations for when the 5170 branch target is reached in the usual flow of the code. 5171 5172 `-fno-align-labels' and `-falign-labels=1' are equivalent and mean 5173 that labels will not be aligned. 5174 5175 If `-falign-loops' or `-falign-jumps' are applicable and are 5176 greater than this value, then their values are used instead. 5177 5178 If N is not specified or is zero, use a machine-dependent default 5179 which is very likely to be `1', meaning no alignment. 5180 5181 Enabled at levels `-O2', `-O3'. 5182 5183`-falign-loops' 5184`-falign-loops=N' 5185 Align loops to a power-of-two boundary, skipping up to N bytes 5186 like `-falign-functions'. The hope is that the loop will be 5187 executed many times, which will make up for any execution of the 5188 dummy operations. 5189 5190 `-fno-align-loops' and `-falign-loops=1' are equivalent and mean 5191 that loops will not be aligned. 5192 5193 If N is not specified or is zero, use a machine-dependent default. 5194 5195 Enabled at levels `-O2', `-O3'. 5196 5197`-falign-jumps' 5198`-falign-jumps=N' 5199 Align branch targets to a power-of-two boundary, for branch targets 5200 where the targets can only be reached by jumping, skipping up to N 5201 bytes like `-falign-functions'. In this case, no dummy operations 5202 need be executed. 5203 5204 `-fno-align-jumps' and `-falign-jumps=1' are equivalent and mean 5205 that loops will not be aligned. 5206 5207 If N is not specified or is zero, use a machine-dependent default. 5208 5209 Enabled at levels `-O2', `-O3'. 5210 5211`-funit-at-a-time' 5212 Parse the whole compilation unit before starting to produce code. 5213 This allows some extra optimizations to take place but consumes 5214 more memory (in general). There are some compatibility issues 5215 with _unit-at-a-time_ mode: 5216 * enabling _unit-at-a-time_ mode may change the order in which 5217 functions, variables, and top-level `asm' statements are 5218 emitted, and will likely break code relying on some particular 5219 ordering. The majority of such top-level `asm' statements, 5220 though, can be replaced by `section' attributes. The 5221 `fno-toplevel-reorder' option may be used to keep the ordering 5222 used in the input file, at the cost of some optimizations. 5223 5224 * _unit-at-a-time_ mode removes unreferenced static variables 5225 and functions. This may result in undefined references when 5226 an `asm' statement refers directly to variables or functions 5227 that are otherwise unused. In that case either the 5228 variable/function shall be listed as an operand of the `asm' 5229 statement operand or, in the case of top-level `asm' 5230 statements the attribute `used' shall be used on the 5231 declaration. 5232 5233 * Static functions now can use non-standard passing conventions 5234 that may break `asm' statements calling functions directly. 5235 Again, attribute `used' will prevent this behavior. 5236 5237 As a temporary workaround, `-fno-unit-at-a-time' can be used, but 5238 this scheme may not be supported by future releases of GCC. 5239 5240 Enabled at levels `-O', `-O2', `-O3', `-Os'. 5241 5242`-fno-toplevel-reorder' 5243 Do not reorder top-level functions, variables, and `asm' 5244 statements. Output them in the same order that they appear in the 5245 input file. When this option is used, unreferenced static 5246 variables will not be removed. This option is intended to support 5247 existing code which relies on a particular ordering. For new 5248 code, it is better to use attributes. 5249 5250`-fweb' 5251 Constructs webs as commonly used for register allocation purposes 5252 and assign each web individual pseudo register. This allows the 5253 register allocation pass to operate on pseudos directly, but also 5254 strengthens several other optimization passes, such as CSE, loop 5255 optimizer and trivial dead code remover. It can, however, make 5256 debugging impossible, since variables will no longer stay in a 5257 "home register". 5258 5259 Enabled by default with `-funroll-loops'. 5260 5261`-fwhole-program' 5262 Assume that the current compilation unit represents whole program 5263 being compiled. All public functions and variables with the 5264 exception of `main' and those merged by attribute 5265 `externally_visible' become static functions and in a affect gets 5266 more aggressively optimized by interprocedural optimizers. While 5267 this option is equivalent to proper use of `static' keyword for 5268 programs consisting of single file, in combination with option 5269 `--combine' this flag can be used to compile most of smaller scale 5270 C programs since the functions and variables become local for the 5271 whole combined compilation unit, not for the single source file 5272 itself. 5273 5274`-fno-cprop-registers' 5275 After register allocation and post-register allocation instruction 5276 splitting, we perform a copy-propagation pass to try to reduce 5277 scheduling dependencies and occasionally eliminate the copy. 5278 5279 Disabled at levels `-O', `-O2', `-O3', `-Os'. 5280 5281`-fprofile-generate' 5282 Enable options usually used for instrumenting application to 5283 produce profile useful for later recompilation with profile 5284 feedback based optimization. You must use `-fprofile-generate' 5285 both when compiling and when linking your program. 5286 5287 The following options are enabled: `-fprofile-arcs', 5288 `-fprofile-values', `-fvpt'. 5289 5290`-fprofile-use' 5291 Enable profile feedback directed optimizations, and optimizations 5292 generally profitable only with profile feedback available. 5293 5294 The following options are enabled: `-fbranch-probabilities', 5295 `-fvpt', `-funroll-loops', `-fpeel-loops', `-ftracer' 5296 5297 5298 The following options control compiler behavior regarding floating 5299point arithmetic. These options trade off between speed and 5300correctness. All must be specifically enabled. 5301 5302`-ffloat-store' 5303 Do not store floating point variables in registers, and inhibit 5304 other options that might change whether a floating point value is 5305 taken from a register or memory. 5306 5307 This option prevents undesirable excess precision on machines such 5308 as the 68000 where the floating registers (of the 68881) keep more 5309 precision than a `double' is supposed to have. Similarly for the 5310 x86 architecture. For most programs, the excess precision does 5311 only good, but a few programs rely on the precise definition of 5312 IEEE floating point. Use `-ffloat-store' for such programs, after 5313 modifying them to store all pertinent intermediate computations 5314 into variables. 5315 5316`-ffast-math' 5317 Sets `-fno-math-errno', `-funsafe-math-optimizations', 5318 `-fno-trapping-math', `-ffinite-math-only', `-fno-rounding-math', 5319 `-fno-signaling-nans' and `fcx-limited-range'. 5320 5321 This option causes the preprocessor macro `__FAST_MATH__' to be 5322 defined. 5323 5324 This option should never be turned on by any `-O' option since it 5325 can result in incorrect output for programs which depend on an 5326 exact implementation of IEEE or ISO rules/specifications for math 5327 functions. 5328 5329`-fno-math-errno' 5330 Do not set ERRNO after calling math functions that are executed 5331 with a single instruction, e.g., sqrt. A program that relies on 5332 IEEE exceptions for math error handling may want to use this flag 5333 for speed while maintaining IEEE arithmetic compatibility. 5334 5335 This option should never be turned on by any `-O' option since it 5336 can result in incorrect output for programs which depend on an 5337 exact implementation of IEEE or ISO rules/specifications for math 5338 functions. 5339 5340 The default is `-fmath-errno'. 5341 5342 On Darwin systems, the math library never sets `errno'. There is 5343 therefore no reason for the compiler to consider the possibility 5344 that it might, and `-fno-math-errno' is the default. 5345 5346`-funsafe-math-optimizations' 5347 Allow optimizations for floating-point arithmetic that (a) assume 5348 that arguments and results are valid and (b) may violate IEEE or 5349 ANSI standards. When used at link-time, it may include libraries 5350 or startup files that change the default FPU control word or other 5351 similar optimizations. 5352 5353 This option should never be turned on by any `-O' option since it 5354 can result in incorrect output for programs which depend on an 5355 exact implementation of IEEE or ISO rules/specifications for math 5356 functions. 5357 5358 The default is `-fno-unsafe-math-optimizations'. 5359 5360`-ffinite-math-only' 5361 Allow optimizations for floating-point arithmetic that assume that 5362 arguments and results are not NaNs or +-Infs. 5363 5364 This option should never be turned on by any `-O' option since it 5365 can result in incorrect output for programs which depend on an 5366 exact implementation of IEEE or ISO rules/specifications. 5367 5368 The default is `-fno-finite-math-only'. 5369 5370`-fno-trapping-math' 5371 Compile code assuming that floating-point operations cannot 5372 generate user-visible traps. These traps include division by 5373 zero, overflow, underflow, inexact result and invalid operation. 5374 This option implies `-fno-signaling-nans'. Setting this option 5375 may allow faster code if one relies on "non-stop" IEEE arithmetic, 5376 for example. 5377 5378 This option should never be turned on by any `-O' option since it 5379 can result in incorrect output for programs which depend on an 5380 exact implementation of IEEE or ISO rules/specifications for math 5381 functions. 5382 5383 The default is `-ftrapping-math'. 5384 5385`-frounding-math' 5386 Disable transformations and optimizations that assume default 5387 floating point rounding behavior. This is round-to-zero for all 5388 floating point to integer conversions, and round-to-nearest for 5389 all other arithmetic truncations. This option should be specified 5390 for programs that change the FP rounding mode dynamically, or that 5391 may be executed with a non-default rounding mode. This option 5392 disables constant folding of floating point expressions at 5393 compile-time (which may be affected by rounding mode) and 5394 arithmetic transformations that are unsafe in the presence of 5395 sign-dependent rounding modes. 5396 5397 The default is `-fno-rounding-math'. 5398 5399 This option is experimental and does not currently guarantee to 5400 disable all GCC optimizations that are affected by rounding mode. 5401 Future versions of GCC may provide finer control of this setting 5402 using C99's `FENV_ACCESS' pragma. This command line option will 5403 be used to specify the default state for `FENV_ACCESS'. 5404 5405`-frtl-abstract-sequences' 5406 It is a size optimization method. This option is to find identical 5407 sequences of code, which can be turned into pseudo-procedures and 5408 then replace all occurrences with calls to the newly created 5409 subroutine. It is kind of an opposite of `-finline-functions'. 5410 This optimization runs at RTL level. 5411 5412`-fsignaling-nans' 5413 Compile code assuming that IEEE signaling NaNs may generate 5414 user-visible traps during floating-point operations. Setting this 5415 option disables optimizations that may change the number of 5416 exceptions visible with signaling NaNs. This option implies 5417 `-ftrapping-math'. 5418 5419 This option causes the preprocessor macro `__SUPPORT_SNAN__' to be 5420 defined. 5421 5422 The default is `-fno-signaling-nans'. 5423 5424 This option is experimental and does not currently guarantee to 5425 disable all GCC optimizations that affect signaling NaN behavior. 5426 5427`-fsingle-precision-constant' 5428 Treat floating point constant as single precision constant instead 5429 of implicitly converting it to double precision constant. 5430 5431`-fcx-limited-range' 5432`-fno-cx-limited-range' 5433 When enabled, this option states that a range reduction step is not 5434 needed when performing complex division. The default is 5435 `-fno-cx-limited-range', but is enabled by `-ffast-math'. 5436 5437 This option controls the default setting of the ISO C99 5438 `CX_LIMITED_RANGE' pragma. Nevertheless, the option applies to 5439 all languages. 5440 5441 5442 The following options control optimizations that may improve 5443performance, but are not enabled by any `-O' options. This section 5444includes experimental options that may produce broken code. 5445 5446`-fbranch-probabilities' 5447 After running a program compiled with `-fprofile-arcs' (*note 5448 Options for Debugging Your Program or `gcc': Debugging Options.), 5449 you can compile it a second time using `-fbranch-probabilities', 5450 to improve optimizations based on the number of times each branch 5451 was taken. When the program compiled with `-fprofile-arcs' exits 5452 it saves arc execution counts to a file called `SOURCENAME.gcda' 5453 for each source file The information in this data file is very 5454 dependent on the structure of the generated code, so you must use 5455 the same source code and the same optimization options for both 5456 compilations. 5457 5458 With `-fbranch-probabilities', GCC puts a `REG_BR_PROB' note on 5459 each `JUMP_INSN' and `CALL_INSN'. These can be used to improve 5460 optimization. Currently, they are only used in one place: in 5461 `reorg.c', instead of guessing which path a branch is mostly to 5462 take, the `REG_BR_PROB' values are used to exactly determine which 5463 path is taken more often. 5464 5465`-fprofile-values' 5466 If combined with `-fprofile-arcs', it adds code so that some data 5467 about values of expressions in the program is gathered. 5468 5469 With `-fbranch-probabilities', it reads back the data gathered 5470 from profiling values of expressions and adds `REG_VALUE_PROFILE' 5471 notes to instructions for their later usage in optimizations. 5472 5473 Enabled with `-fprofile-generate' and `-fprofile-use'. 5474 5475`-fvpt' 5476 If combined with `-fprofile-arcs', it instructs the compiler to add 5477 a code to gather information about values of expressions. 5478 5479 With `-fbranch-probabilities', it reads back the data gathered and 5480 actually performs the optimizations based on them. Currently the 5481 optimizations include specialization of division operation using 5482 the knowledge about the value of the denominator. 5483 5484`-frename-registers' 5485 Attempt to avoid false dependencies in scheduled code by making use 5486 of registers left over after register allocation. This 5487 optimization will most benefit processors with lots of registers. 5488 Depending on the debug information format adopted by the target, 5489 however, it can make debugging impossible, since variables will no 5490 longer stay in a "home register". 5491 5492 Enabled by default with `-funroll-loops'. 5493 5494`-ftracer' 5495 Perform tail duplication to enlarge superblock size. This 5496 transformation simplifies the control flow of the function 5497 allowing other optimizations to do better job. 5498 5499 Enabled with `-fprofile-use'. 5500 5501`-funroll-loops' 5502 Unroll loops whose number of iterations can be determined at 5503 compile time or upon entry to the loop. `-funroll-loops' implies 5504 `-frerun-cse-after-loop', `-fweb' and `-frename-registers'. It 5505 also turns on complete loop peeling (i.e. complete removal of 5506 loops with small constant number of iterations). This option 5507 makes code larger, and may or may not make it run faster. 5508 5509 Enabled with `-fprofile-use'. 5510 5511`-funroll-all-loops' 5512 Unroll all loops, even if their number of iterations is uncertain 5513 when the loop is entered. This usually makes programs run more 5514 slowly. `-funroll-all-loops' implies the same options as 5515 `-funroll-loops'. 5516 5517`-fpeel-loops' 5518 Peels the loops for that there is enough information that they do 5519 not roll much (from profile feedback). It also turns on complete 5520 loop peeling (i.e. complete removal of loops with small constant 5521 number of iterations). 5522 5523 Enabled with `-fprofile-use'. 5524 5525`-fmove-loop-invariants' 5526 Enables the loop invariant motion pass in the RTL loop optimizer. 5527 Enabled at level `-O1' 5528 5529`-funswitch-loops' 5530 Move branches with loop invariant conditions out of the loop, with 5531 duplicates of the loop on both branches (modified according to 5532 result of the condition). 5533 5534`-ffunction-sections' 5535`-fdata-sections' 5536 Place each function or data item into its own section in the output 5537 file if the target supports arbitrary sections. The name of the 5538 function or the name of the data item determines the section's name 5539 in the output file. 5540 5541 Use these options on systems where the linker can perform 5542 optimizations to improve locality of reference in the instruction 5543 space. Most systems using the ELF object format and SPARC 5544 processors running Solaris 2 have linkers with such optimizations. 5545 AIX may have these optimizations in the future. 5546 5547 Only use these options when there are significant benefits from 5548 doing so. When you specify these options, the assembler and 5549 linker will create larger object and executable files and will 5550 also be slower. You will not be able to use `gprof' on all 5551 systems if you specify this option and you may have problems with 5552 debugging if you specify both this option and `-g'. 5553 5554`-fbranch-target-load-optimize' 5555 Perform branch target register load optimization before prologue / 5556 epilogue threading. The use of target registers can typically be 5557 exposed only during reload, thus hoisting loads out of loops and 5558 doing inter-block scheduling needs a separate optimization pass. 5559 5560`-fbranch-target-load-optimize2' 5561 Perform branch target register load optimization after prologue / 5562 epilogue threading. 5563 5564`-fbtr-bb-exclusive' 5565 When performing branch target register load optimization, don't 5566 reuse branch target registers in within any basic block. 5567 5568`-fstack-protector' 5569 Emit extra code to check for buffer overflows, such as stack 5570 smashing attacks. This is done by adding a guard variable to 5571 functions with vulnerable objects. This includes functions that 5572 call alloca, and functions with buffers larger than 8 bytes. The 5573 guards are initialized when a function is entered and then checked 5574 when the function exits. If a guard check fails, an error message 5575 is printed and the program exits. 5576 5577`-fstack-protector-all' 5578 Like `-fstack-protector' except that all functions are protected. 5579 5580`-fsection-anchors' 5581 Try to reduce the number of symbolic address calculations by using 5582 shared "anchor" symbols to address nearby objects. This 5583 transformation can help to reduce the number of GOT entries and 5584 GOT accesses on some targets. 5585 5586 For example, the implementation of the following function `foo': 5587 5588 static int a, b, c; 5589 int foo (void) { return a + b + c; } 5590 5591 would usually calculate the addresses of all three variables, but 5592 if you compile it with `-fsection-anchors', it will access the 5593 variables from a common anchor point instead. The effect is 5594 similar to the following pseudocode (which isn't valid C): 5595 5596 int foo (void) 5597 { 5598 register int *xr = &x; 5599 return xr[&a - &x] + xr[&b - &x] + xr[&c - &x]; 5600 } 5601 5602 Not all targets support this option. 5603 5604`--param NAME=VALUE' 5605 In some places, GCC uses various constants to control the amount of 5606 optimization that is done. For example, GCC will not inline 5607 functions that contain more that a certain number of instructions. 5608 You can control some of these constants on the command-line using 5609 the `--param' option. 5610 5611 The names of specific parameters, and the meaning of the values, 5612 are tied to the internals of the compiler, and are subject to 5613 change without notice in future releases. 5614 5615 In each case, the VALUE is an integer. The allowable choices for 5616 NAME are given in the following table: 5617 5618 `salias-max-implicit-fields' 5619 The maximum number of fields in a variable without direct 5620 structure accesses for which structure aliasing will consider 5621 trying to track each field. The default is 5 5622 5623 `salias-max-array-elements' 5624 The maximum number of elements an array can have and its 5625 elements still be tracked individually by structure aliasing. 5626 The default is 4 5627 5628 `sra-max-structure-size' 5629 The maximum structure size, in bytes, at which the scalar 5630 replacement of aggregates (SRA) optimization will perform 5631 block copies. The default value, 0, implies that GCC will 5632 select the most appropriate size itself. 5633 5634 `sra-field-structure-ratio' 5635 The threshold ratio (as a percentage) between instantiated 5636 fields and the complete structure size. We say that if the 5637 ratio of the number of bytes in instantiated fields to the 5638 number of bytes in the complete structure exceeds this 5639 parameter, then block copies are not used. The default is 75. 5640 5641 `max-crossjump-edges' 5642 The maximum number of incoming edges to consider for 5643 crossjumping. The algorithm used by `-fcrossjumping' is 5644 O(N^2) in the number of edges incoming to each block. 5645 Increasing values mean more aggressive optimization, making 5646 the compile time increase with probably small improvement in 5647 executable size. 5648 5649 `min-crossjump-insns' 5650 The minimum number of instructions which must be matched at 5651 the end of two blocks before crossjumping will be performed 5652 on them. This value is ignored in the case where all 5653 instructions in the block being crossjumped from are matched. 5654 The default value is 5. 5655 5656 `max-grow-copy-bb-insns' 5657 The maximum code size expansion factor when copying basic 5658 blocks instead of jumping. The expansion is relative to a 5659 jump instruction. The default value is 8. 5660 5661 `max-goto-duplication-insns' 5662 The maximum number of instructions to duplicate to a block 5663 that jumps to a computed goto. To avoid O(N^2) behavior in a 5664 number of passes, GCC factors computed gotos early in the 5665 compilation process, and unfactors them as late as possible. 5666 Only computed jumps at the end of a basic blocks with no more 5667 than max-goto-duplication-insns are unfactored. The default 5668 value is 8. 5669 5670 `max-delay-slot-insn-search' 5671 The maximum number of instructions to consider when looking 5672 for an instruction to fill a delay slot. If more than this 5673 arbitrary number of instructions is searched, the time 5674 savings from filling the delay slot will be minimal so stop 5675 searching. Increasing values mean more aggressive 5676 optimization, making the compile time increase with probably 5677 small improvement in executable run time. 5678 5679 `max-delay-slot-live-search' 5680 When trying to fill delay slots, the maximum number of 5681 instructions to consider when searching for a block with 5682 valid live register information. Increasing this arbitrarily 5683 chosen value means more aggressive optimization, increasing 5684 the compile time. This parameter should be removed when the 5685 delay slot code is rewritten to maintain the control-flow 5686 graph. 5687 5688 `max-gcse-memory' 5689 The approximate maximum amount of memory that will be 5690 allocated in order to perform the global common subexpression 5691 elimination optimization. If more memory than specified is 5692 required, the optimization will not be done. 5693 5694 `max-gcse-passes' 5695 The maximum number of passes of GCSE to run. The default is 5696 1. 5697 5698 `max-pending-list-length' 5699 The maximum number of pending dependencies scheduling will 5700 allow before flushing the current state and starting over. 5701 Large functions with few branches or calls can create 5702 excessively large lists which needlessly consume memory and 5703 resources. 5704 5705 `max-inline-insns-single' 5706 Several parameters control the tree inliner used in gcc. 5707 This number sets the maximum number of instructions (counted 5708 in GCC's internal representation) in a single function that 5709 the tree inliner will consider for inlining. This only 5710 affects functions declared inline and methods implemented in 5711 a class declaration (C++). The default value is 450. 5712 5713 `max-inline-insns-auto' 5714 When you use `-finline-functions' (included in `-O3'), a lot 5715 of functions that would otherwise not be considered for 5716 inlining by the compiler will be investigated. To those 5717 functions, a different (more restrictive) limit compared to 5718 functions declared inline can be applied. The default value 5719 is 90. 5720 5721 `large-function-insns' 5722 The limit specifying really large functions. For functions 5723 larger than this limit after inlining inlining is constrained 5724 by `--param large-function-growth'. This parameter is useful 5725 primarily to avoid extreme compilation time caused by 5726 non-linear algorithms used by the backend. This parameter is 5727 ignored when `-funit-at-a-time' is not used. The default 5728 value is 2700. 5729 5730 `large-function-growth' 5731 Specifies maximal growth of large function caused by inlining 5732 in percents. This parameter is ignored when 5733 `-funit-at-a-time' is not used. The default value is 100 5734 which limits large function growth to 2.0 times the original 5735 size. 5736 5737 `large-unit-insns' 5738 The limit specifying large translation unit. Growth caused 5739 by inlining of units larger than this limit is limited by 5740 `--param inline-unit-growth'. For small units this might be 5741 too tight (consider unit consisting of function A that is 5742 inline and B that just calls A three time. If B is small 5743 relative to A, the growth of unit is 300\% and yet such 5744 inlining is very sane. For very large units consisting of 5745 small inlininable functions however the overall unit growth 5746 limit is needed to avoid exponential explosion of code size. 5747 Thus for smaller units, the size is increased to `--param 5748 large-unit-insns' before applying `--param 5749 inline-unit-growth'. The default is 10000 5750 5751 `inline-unit-growth' 5752 Specifies maximal overall growth of the compilation unit 5753 caused by inlining. This parameter is ignored when 5754 `-funit-at-a-time' is not used. The default value is 50 5755 which limits unit growth to 1.5 times the original size. 5756 5757 `max-inline-insns-recursive' 5758 `max-inline-insns-recursive-auto' 5759 Specifies maximum number of instructions out-of-line copy of 5760 self recursive inline function can grow into by performing 5761 recursive inlining. 5762 5763 For functions declared inline `--param 5764 max-inline-insns-recursive' is taken into account. For 5765 function not declared inline, recursive inlining happens only 5766 when `-finline-functions' (included in `-O3') is enabled and 5767 `--param max-inline-insns-recursive-auto' is used. The 5768 default value is 450. 5769 5770 `max-inline-recursive-depth' 5771 `max-inline-recursive-depth-auto' 5772 Specifies maximum recursion depth used by the recursive 5773 inlining. 5774 5775 For functions declared inline `--param 5776 max-inline-recursive-depth' is taken into account. For 5777 function not declared inline, recursive inlining happens only 5778 when `-finline-functions' (included in `-O3') is enabled and 5779 `--param max-inline-recursive-depth-auto' is used. The 5780 default value is 450. 5781 5782 `min-inline-recursive-probability' 5783 Recursive inlining is profitable only for function having 5784 deep recursion in average and can hurt for function having 5785 little recursion depth by increasing the prologue size or 5786 complexity of function body to other optimizers. 5787 5788 When profile feedback is available (see `-fprofile-generate') 5789 the actual recursion depth can be guessed from probability 5790 that function will recurse via given call expression. This 5791 parameter limits inlining only to call expression whose 5792 probability exceeds given threshold (in percents). The 5793 default value is 10. 5794 5795 `inline-call-cost' 5796 Specify cost of call instruction relative to simple 5797 arithmetics operations (having cost of 1). Increasing this 5798 cost disqualifies inlining of non-leaf functions and at the 5799 same time increases size of leaf function that is believed to 5800 reduce function size by being inlined. In effect it 5801 increases amount of inlining for code having large 5802 abstraction penalty (many functions that just pass the 5803 arguments to other functions) and decrease inlining for code 5804 with low abstraction penalty. The default value is 16. 5805 5806 `max-unrolled-insns' 5807 The maximum number of instructions that a loop should have if 5808 that loop is unrolled, and if the loop is unrolled, it 5809 determines how many times the loop code is unrolled. 5810 5811 `max-average-unrolled-insns' 5812 The maximum number of instructions biased by probabilities of 5813 their execution that a loop should have if that loop is 5814 unrolled, and if the loop is unrolled, it determines how many 5815 times the loop code is unrolled. 5816 5817 `max-unroll-times' 5818 The maximum number of unrollings of a single loop. 5819 5820 `max-peeled-insns' 5821 The maximum number of instructions that a loop should have if 5822 that loop is peeled, and if the loop is peeled, it determines 5823 how many times the loop code is peeled. 5824 5825 `max-peel-times' 5826 The maximum number of peelings of a single loop. 5827 5828 `max-completely-peeled-insns' 5829 The maximum number of insns of a completely peeled loop. 5830 5831 `max-completely-peel-times' 5832 The maximum number of iterations of a loop to be suitable for 5833 complete peeling. 5834 5835 `max-unswitch-insns' 5836 The maximum number of insns of an unswitched loop. 5837 5838 `max-unswitch-level' 5839 The maximum number of branches unswitched in a single loop. 5840 5841 `lim-expensive' 5842 The minimum cost of an expensive expression in the loop 5843 invariant motion. 5844 5845 `iv-consider-all-candidates-bound' 5846 Bound on number of candidates for induction variables below 5847 that all candidates are considered for each use in induction 5848 variable optimizations. Only the most relevant candidates 5849 are considered if there are more candidates, to avoid 5850 quadratic time complexity. 5851 5852 `iv-max-considered-uses' 5853 The induction variable optimizations give up on loops that 5854 contain more induction variable uses. 5855 5856 `iv-always-prune-cand-set-bound' 5857 If number of candidates in the set is smaller than this value, 5858 we always try to remove unnecessary ivs from the set during 5859 its optimization when a new iv is added to the set. 5860 5861 `scev-max-expr-size' 5862 Bound on size of expressions used in the scalar evolutions 5863 analyzer. Large expressions slow the analyzer. 5864 5865 `vect-max-version-checks' 5866 The maximum number of runtime checks that can be performed 5867 when doing loop versioning in the vectorizer. See option 5868 ftree-vect-loop-version for more information. 5869 5870 `max-iterations-to-track' 5871 The maximum number of iterations of a loop the brute force 5872 algorithm for analysis of # of iterations of the loop tries 5873 to evaluate. 5874 5875 `hot-bb-count-fraction' 5876 Select fraction of the maximal count of repetitions of basic 5877 block in program given basic block needs to have to be 5878 considered hot. 5879 5880 `hot-bb-frequency-fraction' 5881 Select fraction of the maximal frequency of executions of 5882 basic block in function given basic block needs to have to be 5883 considered hot 5884 5885 `max-predicted-iterations' 5886 The maximum number of loop iterations we predict statically. 5887 This is useful in cases where function contain single loop 5888 with known bound and other loop with unknown. We predict the 5889 known number of iterations correctly, while the unknown 5890 number of iterations average to roughly 10. This means that 5891 the loop without bounds would appear artificially cold 5892 relative to the other one. 5893 5894 `tracer-dynamic-coverage' 5895 `tracer-dynamic-coverage-feedback' 5896 This value is used to limit superblock formation once the 5897 given percentage of executed instructions is covered. This 5898 limits unnecessary code size expansion. 5899 5900 The `tracer-dynamic-coverage-feedback' is used only when 5901 profile feedback is available. The real profiles (as opposed 5902 to statically estimated ones) are much less balanced allowing 5903 the threshold to be larger value. 5904 5905 `tracer-max-code-growth' 5906 Stop tail duplication once code growth has reached given 5907 percentage. This is rather hokey argument, as most of the 5908 duplicates will be eliminated later in cross jumping, so it 5909 may be set to much higher values than is the desired code 5910 growth. 5911 5912 `tracer-min-branch-ratio' 5913 Stop reverse growth when the reverse probability of best edge 5914 is less than this threshold (in percent). 5915 5916 `tracer-min-branch-ratio' 5917 `tracer-min-branch-ratio-feedback' 5918 Stop forward growth if the best edge do have probability 5919 lower than this threshold. 5920 5921 Similarly to `tracer-dynamic-coverage' two values are 5922 present, one for compilation for profile feedback and one for 5923 compilation without. The value for compilation with profile 5924 feedback needs to be more conservative (higher) in order to 5925 make tracer effective. 5926 5927 `max-cse-path-length' 5928 Maximum number of basic blocks on path that cse considers. 5929 The default is 10. 5930 5931 `max-cse-insns' 5932 The maximum instructions CSE process before flushing. The 5933 default is 1000. 5934 5935 `global-var-threshold' 5936 Counts the number of function calls (N) and the number of 5937 call-clobbered variables (V). If NxV is larger than this 5938 limit, a single artificial variable will be created to 5939 represent all the call-clobbered variables at function call 5940 sites. This artificial variable will then be made to alias 5941 every call-clobbered variable. (done as `int * size_t' on 5942 the host machine; beware overflow). 5943 5944 `max-aliased-vops' 5945 Maximum number of virtual operands allowed to represent 5946 aliases before triggering the alias grouping heuristic. 5947 Alias grouping reduces compile times and memory consumption 5948 needed for aliasing at the expense of precision loss in alias 5949 information. 5950 5951 `ggc-min-expand' 5952 GCC uses a garbage collector to manage its own memory 5953 allocation. This parameter specifies the minimum percentage 5954 by which the garbage collector's heap should be allowed to 5955 expand between collections. Tuning this may improve 5956 compilation speed; it has no effect on code generation. 5957 5958 The default is 30% + 70% * (RAM/1GB) with an upper bound of 5959 100% when RAM >= 1GB. If `getrlimit' is available, the 5960 notion of "RAM" is the smallest of actual RAM and 5961 `RLIMIT_DATA' or `RLIMIT_AS'. If GCC is not able to 5962 calculate RAM on a particular platform, the lower bound of 5963 30% is used. Setting this parameter and `ggc-min-heapsize' 5964 to zero causes a full collection to occur at every 5965 opportunity. This is extremely slow, but can be useful for 5966 debugging. 5967 5968 `ggc-min-heapsize' 5969 Minimum size of the garbage collector's heap before it begins 5970 bothering to collect garbage. The first collection occurs 5971 after the heap expands by `ggc-min-expand'% beyond 5972 `ggc-min-heapsize'. Again, tuning this may improve 5973 compilation speed, and has no effect on code generation. 5974 5975 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit 5976 which tries to ensure that RLIMIT_DATA or RLIMIT_AS are not 5977 exceeded, but with a lower bound of 4096 (four megabytes) and 5978 an upper bound of 131072 (128 megabytes). If GCC is not able 5979 to calculate RAM on a particular platform, the lower bound is 5980 used. Setting this parameter very large effectively disables 5981 garbage collection. Setting this parameter and 5982 `ggc-min-expand' to zero causes a full collection to occur at 5983 every opportunity. 5984 5985 `max-reload-search-insns' 5986 The maximum number of instruction reload should look backward 5987 for equivalent register. Increasing values mean more 5988 aggressive optimization, making the compile time increase 5989 with probably slightly better performance. The default value 5990 is 100. 5991 5992 `max-cselib-memory-locations' 5993 The maximum number of memory locations cselib should take 5994 into account. Increasing values mean more aggressive 5995 optimization, making the compile time increase with probably 5996 slightly better performance. The default value is 500. 5997 5998 `max-flow-memory-locations' 5999 Similar as `max-cselib-memory-locations' but for dataflow 6000 liveness. The default value is 100. 6001 6002 `reorder-blocks-duplicate' 6003 `reorder-blocks-duplicate-feedback' 6004 Used by basic block reordering pass to decide whether to use 6005 unconditional branch or duplicate the code on its 6006 destination. Code is duplicated when its estimated size is 6007 smaller than this value multiplied by the estimated size of 6008 unconditional jump in the hot spots of the program. 6009 6010 The `reorder-block-duplicate-feedback' is used only when 6011 profile feedback is available and may be set to higher values 6012 than `reorder-block-duplicate' since information about the 6013 hot spots is more accurate. 6014 6015 `max-sched-ready-insns' 6016 The maximum number of instructions ready to be issued the 6017 scheduler should consider at any given time during the first 6018 scheduling pass. Increasing values mean more thorough 6019 searches, making the compilation time increase with probably 6020 little benefit. The default value is 100. 6021 6022 `max-sched-region-blocks' 6023 The maximum number of blocks in a region to be considered for 6024 interblock scheduling. The default value is 10. 6025 6026 `max-sched-region-insns' 6027 The maximum number of insns in a region to be considered for 6028 interblock scheduling. The default value is 100. 6029 6030 `min-spec-prob' 6031 The minimum probability (in percents) of reaching a source 6032 block for interblock speculative scheduling. The default 6033 value is 40. 6034 6035 `max-sched-extend-regions-iters' 6036 The maximum number of iterations through CFG to extend 6037 regions. 0 - disable region extension, N - do at most N 6038 iterations. The default value is 0. 6039 6040 `max-sched-insn-conflict-delay' 6041 The maximum conflict delay for an insn to be considered for 6042 speculative motion. The default value is 3. 6043 6044 `sched-spec-prob-cutoff' 6045 The minimal probability of speculation success (in percents), 6046 so that speculative insn will be scheduled. The default 6047 value is 40. 6048 6049 `max-last-value-rtl' 6050 The maximum size measured as number of RTLs that can be 6051 recorded in an expression in combiner for a pseudo register 6052 as last known value of that register. The default is 10000. 6053 6054 `integer-share-limit' 6055 Small integer constants can use a shared data structure, 6056 reducing the compiler's memory usage and increasing its 6057 speed. This sets the maximum value of a shared integer 6058 constant's. The default value is 256. 6059 6060 `min-virtual-mappings' 6061 Specifies the minimum number of virtual mappings in the 6062 incremental SSA updater that should be registered to trigger 6063 the virtual mappings heuristic defined by 6064 virtual-mappings-ratio. The default value is 100. 6065 6066 `virtual-mappings-ratio' 6067 If the number of virtual mappings is virtual-mappings-ratio 6068 bigger than the number of virtual symbols to be updated, then 6069 the incremental SSA updater switches to a full update for 6070 those symbols. The default ratio is 3. 6071 6072 `ssp-buffer-size' 6073 The minimum size of buffers (i.e. arrays) that will receive 6074 stack smashing protection when `-fstack-protection' is used. 6075 6076 `max-jump-thread-duplication-stmts' 6077 Maximum number of statements allowed in a block that needs to 6078 be duplicated when threading jumps. 6079 6080 `max-fields-for-field-sensitive' 6081 Maximum number of fields in a structure we will treat in a 6082 field sensitive manner during pointer analysis. 6083 6084 6085 6086File: gcc.info, Node: Preprocessor Options, Next: Assembler Options, Prev: Optimize Options, Up: Invoking GCC 6087 60883.11 Options Controlling the Preprocessor 6089========================================= 6090 6091These options control the C preprocessor, which is run on each C source 6092file before actual compilation. 6093 6094 If you use the `-E' option, nothing is done except preprocessing. 6095Some of these options make sense only together with `-E' because they 6096cause the preprocessor output to be unsuitable for actual compilation. 6097 6098 You can use `-Wp,OPTION' to bypass the compiler driver and pass 6099 OPTION directly through to the preprocessor. If OPTION contains 6100 commas, it is split into multiple options at the commas. However, 6101 many options are modified, translated or interpreted by the 6102 compiler driver before being passed to the preprocessor, and `-Wp' 6103 forcibly bypasses this phase. The preprocessor's direct interface 6104 is undocumented and subject to change, so whenever possible you 6105 should avoid using `-Wp' and let the driver handle the options 6106 instead. 6107 6108`-Xpreprocessor OPTION' 6109 Pass OPTION as an option to the preprocessor. You can use this to 6110 supply system-specific preprocessor options which GCC does not 6111 know how to recognize. 6112 6113 If you want to pass an option that takes an argument, you must use 6114 `-Xpreprocessor' twice, once for the option and once for the 6115 argument. 6116 6117`-D NAME' 6118 Predefine NAME as a macro, with definition `1'. 6119 6120`-D NAME=DEFINITION' 6121 The contents of DEFINITION are tokenized and processed as if they 6122 appeared during translation phase three in a `#define' directive. 6123 In particular, the definition will be truncated by embedded 6124 newline characters. 6125 6126 If you are invoking the preprocessor from a shell or shell-like 6127 program you may need to use the shell's quoting syntax to protect 6128 characters such as spaces that have a meaning in the shell syntax. 6129 6130 If you wish to define a function-like macro on the command line, 6131 write its argument list with surrounding parentheses before the 6132 equals sign (if any). Parentheses are meaningful to most shells, 6133 so you will need to quote the option. With `sh' and `csh', 6134 `-D'NAME(ARGS...)=DEFINITION'' works. 6135 6136 `-D' and `-U' options are processed in the order they are given on 6137 the command line. All `-imacros FILE' and `-include FILE' options 6138 are processed after all `-D' and `-U' options. 6139 6140`-U NAME' 6141 Cancel any previous definition of NAME, either built in or 6142 provided with a `-D' option. 6143 6144`-undef' 6145 Do not predefine any system-specific or GCC-specific macros. The 6146 standard predefined macros remain defined. 6147 6148`-I DIR' 6149 Add the directory DIR to the list of directories to be searched 6150 for header files. Directories named by `-I' are searched before 6151 the standard system include directories. If the directory DIR is 6152 a standard system include directory, the option is ignored to 6153 ensure that the default search order for system directories and 6154 the special treatment of system headers are not defeated . 6155 6156`-o FILE' 6157 Write output to FILE. This is the same as specifying FILE as the 6158 second non-option argument to `cpp'. `gcc' has a different 6159 interpretation of a second non-option argument, so you must use 6160 `-o' to specify the output file. 6161 6162`-Wall' 6163 Turns on all optional warnings which are desirable for normal code. 6164 At present this is `-Wcomment', `-Wtrigraphs', `-Wmultichar' and a 6165 warning about integer promotion causing a change of sign in `#if' 6166 expressions. Note that many of the preprocessor's warnings are on 6167 by default and have no options to control them. 6168 6169`-Wcomment' 6170`-Wcomments' 6171 Warn whenever a comment-start sequence `/*' appears in a `/*' 6172 comment, or whenever a backslash-newline appears in a `//' comment. 6173 (Both forms have the same effect.) 6174 6175`-Wtrigraphs' 6176 Most trigraphs in comments cannot affect the meaning of the 6177 program. However, a trigraph that would form an escaped newline 6178 (`??/' at the end of a line) can, by changing where the comment 6179 begins or ends. Therefore, only trigraphs that would form escaped 6180 newlines produce warnings inside a comment. 6181 6182 This option is implied by `-Wall'. If `-Wall' is not given, this 6183 option is still enabled unless trigraphs are enabled. To get 6184 trigraph conversion without warnings, but get the other `-Wall' 6185 warnings, use `-trigraphs -Wall -Wno-trigraphs'. 6186 6187`-Wtraditional' 6188 Warn about certain constructs that behave differently in 6189 traditional and ISO C. Also warn about ISO C constructs that have 6190 no traditional C equivalent, and problematic constructs which 6191 should be avoided. 6192 6193`-Wimport' 6194 Warn the first time `#import' is used. 6195 6196`-Wundef' 6197 Warn whenever an identifier which is not a macro is encountered in 6198 an `#if' directive, outside of `defined'. Such identifiers are 6199 replaced with zero. 6200 6201`-Wunused-macros' 6202 Warn about macros defined in the main file that are unused. A 6203 macro is "used" if it is expanded or tested for existence at least 6204 once. The preprocessor will also warn if the macro has not been 6205 used at the time it is redefined or undefined. 6206 6207 Built-in macros, macros defined on the command line, and macros 6208 defined in include files are not warned about. 6209 6210 _Note:_ If a macro is actually used, but only used in skipped 6211 conditional blocks, then CPP will report it as unused. To avoid 6212 the warning in such a case, you might improve the scope of the 6213 macro's definition by, for example, moving it into the first 6214 skipped block. Alternatively, you could provide a dummy use with 6215 something like: 6216 6217 #if defined the_macro_causing_the_warning 6218 #endif 6219 6220`-Wendif-labels' 6221 Warn whenever an `#else' or an `#endif' are followed by text. 6222 This usually happens in code of the form 6223 6224 #if FOO 6225 ... 6226 #else FOO 6227 ... 6228 #endif FOO 6229 6230 The second and third `FOO' should be in comments, but often are not 6231 in older programs. This warning is on by default. 6232 6233`-Werror' 6234 Make all warnings into hard errors. Source code which triggers 6235 warnings will be rejected. 6236 6237`-Wsystem-headers' 6238 Issue warnings for code in system headers. These are normally 6239 unhelpful in finding bugs in your own code, therefore suppressed. 6240 If you are responsible for the system library, you may want to see 6241 them. 6242 6243`-w' 6244 Suppress all warnings, including those which GNU CPP issues by 6245 default. 6246 6247`-pedantic' 6248 Issue all the mandatory diagnostics listed in the C standard. 6249 Some of them are left out by default, since they trigger 6250 frequently on harmless code. 6251 6252`-pedantic-errors' 6253 Issue all the mandatory diagnostics, and make all mandatory 6254 diagnostics into errors. This includes mandatory diagnostics that 6255 GCC issues without `-pedantic' but treats as warnings. 6256 6257`-M' 6258 Instead of outputting the result of preprocessing, output a rule 6259 suitable for `make' describing the dependencies of the main source 6260 file. The preprocessor outputs one `make' rule containing the 6261 object file name for that source file, a colon, and the names of 6262 all the included files, including those coming from `-include' or 6263 `-imacros' command line options. 6264 6265 Unless specified explicitly (with `-MT' or `-MQ'), the object file 6266 name consists of the basename of the source file with any suffix 6267 replaced with object file suffix. If there are many included 6268 files then the rule is split into several lines using `\'-newline. 6269 The rule has no commands. 6270 6271 This option does not suppress the preprocessor's debug output, 6272 such as `-dM'. To avoid mixing such debug output with the 6273 dependency rules you should explicitly specify the dependency 6274 output file with `-MF', or use an environment variable like 6275 `DEPENDENCIES_OUTPUT' (*note Environment Variables::). Debug 6276 output will still be sent to the regular output stream as normal. 6277 6278 Passing `-M' to the driver implies `-E', and suppresses warnings 6279 with an implicit `-w'. 6280 6281`-MM' 6282 Like `-M' but do not mention header files that are found in system 6283 header directories, nor header files that are included, directly 6284 or indirectly, from such a header. 6285 6286 This implies that the choice of angle brackets or double quotes in 6287 an `#include' directive does not in itself determine whether that 6288 header will appear in `-MM' dependency output. This is a slight 6289 change in semantics from GCC versions 3.0 and earlier. 6290 6291`-MF FILE' 6292 When used with `-M' or `-MM', specifies a file to write the 6293 dependencies to. If no `-MF' switch is given the preprocessor 6294 sends the rules to the same place it would have sent preprocessed 6295 output. 6296 6297 When used with the driver options `-MD' or `-MMD', `-MF' overrides 6298 the default dependency output file. 6299 6300`-MG' 6301 In conjunction with an option such as `-M' requesting dependency 6302 generation, `-MG' assumes missing header files are generated files 6303 and adds them to the dependency list without raising an error. 6304 The dependency filename is taken directly from the `#include' 6305 directive without prepending any path. `-MG' also suppresses 6306 preprocessed output, as a missing header file renders this useless. 6307 6308 This feature is used in automatic updating of makefiles. 6309 6310`-MP' 6311 This option instructs CPP to add a phony target for each dependency 6312 other than the main file, causing each to depend on nothing. These 6313 dummy rules work around errors `make' gives if you remove header 6314 files without updating the `Makefile' to match. 6315 6316 This is typical output: 6317 6318 test.o: test.c test.h 6319 6320 test.h: 6321 6322`-MT TARGET' 6323 Change the target of the rule emitted by dependency generation. By 6324 default CPP takes the name of the main input file, including any 6325 path, deletes any file suffix such as `.c', and appends the 6326 platform's usual object suffix. The result is the target. 6327 6328 An `-MT' option will set the target to be exactly the string you 6329 specify. If you want multiple targets, you can specify them as a 6330 single argument to `-MT', or use multiple `-MT' options. 6331 6332 For example, `-MT '$(objpfx)foo.o'' might give 6333 6334 $(objpfx)foo.o: foo.c 6335 6336`-MQ TARGET' 6337 Same as `-MT', but it quotes any characters which are special to 6338 Make. `-MQ '$(objpfx)foo.o'' gives 6339 6340 $$(objpfx)foo.o: foo.c 6341 6342 The default target is automatically quoted, as if it were given 6343 with `-MQ'. 6344 6345`-MD' 6346 `-MD' is equivalent to `-M -MF FILE', except that `-E' is not 6347 implied. The driver determines FILE based on whether an `-o' 6348 option is given. If it is, the driver uses its argument but with 6349 a suffix of `.d', otherwise it take the basename of the input file 6350 and applies a `.d' suffix. 6351 6352 If `-MD' is used in conjunction with `-E', any `-o' switch is 6353 understood to specify the dependency output file (*note -MF: 6354 dashMF.), but if used without `-E', each `-o' is understood to 6355 specify a target object file. 6356 6357 Since `-E' is not implied, `-MD' can be used to generate a 6358 dependency output file as a side-effect of the compilation process. 6359 6360`-MMD' 6361 Like `-MD' except mention only user header files, not system 6362 header files. 6363 6364`-fpch-deps' 6365 When using precompiled headers (*note Precompiled Headers::), this 6366 flag will cause the dependency-output flags to also list the files 6367 from the precompiled header's dependencies. If not specified only 6368 the precompiled header would be listed and not the files that were 6369 used to create it because those files are not consulted when a 6370 precompiled header is used. 6371 6372`-fpch-preprocess' 6373 This option allows use of a precompiled header (*note Precompiled 6374 Headers::) together with `-E'. It inserts a special `#pragma', 6375 `#pragma GCC pch_preprocess "<filename>"' in the output to mark 6376 the place where the precompiled header was found, and its 6377 filename. When `-fpreprocessed' is in use, GCC recognizes this 6378 `#pragma' and loads the PCH. 6379 6380 This option is off by default, because the resulting preprocessed 6381 output is only really suitable as input to GCC. It is switched on 6382 by `-save-temps'. 6383 6384 You should not write this `#pragma' in your own code, but it is 6385 safe to edit the filename if the PCH file is available in a 6386 different location. The filename may be absolute or it may be 6387 relative to GCC's current directory. 6388 6389`-x c' 6390`-x c++' 6391`-x objective-c' 6392`-x assembler-with-cpp' 6393 Specify the source language: C, C++, Objective-C, or assembly. 6394 This has nothing to do with standards conformance or extensions; 6395 it merely selects which base syntax to expect. If you give none 6396 of these options, cpp will deduce the language from the extension 6397 of the source file: `.c', `.cc', `.m', or `.S'. Some other common 6398 extensions for C++ and assembly are also recognized. If cpp does 6399 not recognize the extension, it will treat the file as C; this is 6400 the most generic mode. 6401 6402 _Note:_ Previous versions of cpp accepted a `-lang' option which 6403 selected both the language and the standards conformance level. 6404 This option has been removed, because it conflicts with the `-l' 6405 option. 6406 6407`-std=STANDARD' 6408`-ansi' 6409 Specify the standard to which the code should conform. Currently 6410 CPP knows about C and C++ standards; others may be added in the 6411 future. 6412 6413 STANDARD may be one of: 6414 `iso9899:1990' 6415 `c89' 6416 The ISO C standard from 1990. `c89' is the customary 6417 shorthand for this version of the standard. 6418 6419 The `-ansi' option is equivalent to `-std=c89'. 6420 6421 `iso9899:199409' 6422 The 1990 C standard, as amended in 1994. 6423 6424 `iso9899:1999' 6425 `c99' 6426 `iso9899:199x' 6427 `c9x' 6428 The revised ISO C standard, published in December 1999. 6429 Before publication, this was known as C9X. 6430 6431 `gnu89' 6432 The 1990 C standard plus GNU extensions. 6433 6434 `gnu99' 6435 `gnu9x' 6436 The 1999 C standard plus GNU extensions. This is the default. 6437 6438 `c++98' 6439 The 1998 ISO C++ standard plus amendments. 6440 6441 `gnu++98' 6442 The same as `-std=c++98' plus GNU extensions. This is the 6443 default for C++ code. 6444 6445`-I-' 6446 Split the include path. Any directories specified with `-I' 6447 options before `-I-' are searched only for headers requested with 6448 `#include "FILE"'; they are not searched for `#include <FILE>'. 6449 If additional directories are specified with `-I' options after 6450 the `-I-', those directories are searched for all `#include' 6451 directives. 6452 6453 In addition, `-I-' inhibits the use of the directory of the current 6454 file directory as the first search directory for `#include "FILE"'. 6455 This option has been deprecated. 6456 6457`-nostdinc' 6458 Do not search the standard system directories for header files. 6459 Only the directories you have specified with `-I' options (and the 6460 directory of the current file, if appropriate) are searched. 6461 6462`-nostdinc++' 6463 Do not search for header files in the C++-specific standard 6464 directories, but do still search the other standard directories. 6465 (This option is used when building the C++ library.) 6466 6467`-include FILE' 6468 Process FILE as if `#include "file"' appeared as the first line of 6469 the primary source file. However, the first directory searched 6470 for FILE is the preprocessor's working directory _instead of_ the 6471 directory containing the main source file. If not found there, it 6472 is searched for in the remainder of the `#include "..."' search 6473 chain as normal. 6474 6475 If multiple `-include' options are given, the files are included 6476 in the order they appear on the command line. 6477 6478`-imacros FILE' 6479 Exactly like `-include', except that any output produced by 6480 scanning FILE is thrown away. Macros it defines remain defined. 6481 This allows you to acquire all the macros from a header without 6482 also processing its declarations. 6483 6484 All files specified by `-imacros' are processed before all files 6485 specified by `-include'. 6486 6487`-idirafter DIR' 6488 Search DIR for header files, but do it _after_ all directories 6489 specified with `-I' and the standard system directories have been 6490 exhausted. DIR is treated as a system include directory. 6491 6492`-iprefix PREFIX' 6493 Specify PREFIX as the prefix for subsequent `-iwithprefix' 6494 options. If the prefix represents a directory, you should include 6495 the final `/'. 6496 6497`-iwithprefix DIR' 6498`-iwithprefixbefore DIR' 6499 Append DIR to the prefix specified previously with `-iprefix', and 6500 add the resulting directory to the include search path. 6501 `-iwithprefixbefore' puts it in the same place `-I' would; 6502 `-iwithprefix' puts it where `-idirafter' would. 6503 6504`-isysroot DIR' 6505 This option is like the `--sysroot' option, but applies only to 6506 header files. See the `--sysroot' option for more information. 6507 6508`-imultilib DIR' 6509 Use DIR as a subdirectory of the directory containing 6510 target-specific C++ headers. 6511 6512`-isystem DIR' 6513 Search DIR for header files, after all directories specified by 6514 `-I' but before the standard system directories. Mark it as a 6515 system directory, so that it gets the same special treatment as is 6516 applied to the standard system directories. 6517 6518`-iquote DIR' 6519 Search DIR only for header files requested with `#include "FILE"'; 6520 they are not searched for `#include <FILE>', before all 6521 directories specified by `-I' and before the standard system 6522 directories. 6523 6524`-fdollars-in-identifiers' 6525 Accept `$' in identifiers. 6526 6527`-fextended-identifiers' 6528 Accept universal character names in identifiers. This option is 6529 experimental; in a future version of GCC, it will be enabled by 6530 default for C99 and C++. 6531 6532`-fpreprocessed' 6533 Indicate to the preprocessor that the input file has already been 6534 preprocessed. This suppresses things like macro expansion, 6535 trigraph conversion, escaped newline splicing, and processing of 6536 most directives. The preprocessor still recognizes and removes 6537 comments, so that you can pass a file preprocessed with `-C' to 6538 the compiler without problems. In this mode the integrated 6539 preprocessor is little more than a tokenizer for the front ends. 6540 6541 `-fpreprocessed' is implicit if the input file has one of the 6542 extensions `.i', `.ii' or `.mi'. These are the extensions that 6543 GCC uses for preprocessed files created by `-save-temps'. 6544 6545`-ftabstop=WIDTH' 6546 Set the distance between tab stops. This helps the preprocessor 6547 report correct column numbers in warnings or errors, even if tabs 6548 appear on the line. If the value is less than 1 or greater than 6549 100, the option is ignored. The default is 8. 6550 6551`-fexec-charset=CHARSET' 6552 Set the execution character set, used for string and character 6553 constants. The default is UTF-8. CHARSET can be any encoding 6554 supported by the system's `iconv' library routine. 6555 6556`-fwide-exec-charset=CHARSET' 6557 Set the wide execution character set, used for wide string and 6558 character constants. The default is UTF-32 or UTF-16, whichever 6559 corresponds to the width of `wchar_t'. As with `-fexec-charset', 6560 CHARSET can be any encoding supported by the system's `iconv' 6561 library routine; however, you will have problems with encodings 6562 that do not fit exactly in `wchar_t'. 6563 6564`-finput-charset=CHARSET' 6565 Set the input character set, used for translation from the 6566 character set of the input file to the source character set used 6567 by GCC. If the locale does not specify, or GCC cannot get this 6568 information from the locale, the default is UTF-8. This can be 6569 overridden by either the locale or this command line option. 6570 Currently the command line option takes precedence if there's a 6571 conflict. CHARSET can be any encoding supported by the system's 6572 `iconv' library routine. 6573 6574`-fworking-directory' 6575 Enable generation of linemarkers in the preprocessor output that 6576 will let the compiler know the current working directory at the 6577 time of preprocessing. When this option is enabled, the 6578 preprocessor will emit, after the initial linemarker, a second 6579 linemarker with the current working directory followed by two 6580 slashes. GCC will use this directory, when it's present in the 6581 preprocessed input, as the directory emitted as the current 6582 working directory in some debugging information formats. This 6583 option is implicitly enabled if debugging information is enabled, 6584 but this can be inhibited with the negated form 6585 `-fno-working-directory'. If the `-P' flag is present in the 6586 command line, this option has no effect, since no `#line' 6587 directives are emitted whatsoever. 6588 6589`-fno-show-column' 6590 Do not print column numbers in diagnostics. This may be necessary 6591 if diagnostics are being scanned by a program that does not 6592 understand the column numbers, such as `dejagnu'. 6593 6594`-A PREDICATE=ANSWER' 6595 Make an assertion with the predicate PREDICATE and answer ANSWER. 6596 This form is preferred to the older form `-A PREDICATE(ANSWER)', 6597 which is still supported, because it does not use shell special 6598 characters. 6599 6600`-A -PREDICATE=ANSWER' 6601 Cancel an assertion with the predicate PREDICATE and answer ANSWER. 6602 6603`-dCHARS' 6604 CHARS is a sequence of one or more of the following characters, 6605 and must not be preceded by a space. Other characters are 6606 interpreted by the compiler proper, or reserved for future 6607 versions of GCC, and so are silently ignored. If you specify 6608 characters whose behavior conflicts, the result is undefined. 6609 6610 `M' 6611 Instead of the normal output, generate a list of `#define' 6612 directives for all the macros defined during the execution of 6613 the preprocessor, including predefined macros. This gives 6614 you a way of finding out what is predefined in your version 6615 of the preprocessor. Assuming you have no file `foo.h', the 6616 command 6617 6618 touch foo.h; cpp -dM foo.h 6619 6620 will show all the predefined macros. 6621 6622 `D' 6623 Like `M' except in two respects: it does _not_ include the 6624 predefined macros, and it outputs _both_ the `#define' 6625 directives and the result of preprocessing. Both kinds of 6626 output go to the standard output file. 6627 6628 `N' 6629 Like `D', but emit only the macro names, not their expansions. 6630 6631 `I' 6632 Output `#include' directives in addition to the result of 6633 preprocessing. 6634 6635`-P' 6636 Inhibit generation of linemarkers in the output from the 6637 preprocessor. This might be useful when running the preprocessor 6638 on something that is not C code, and will be sent to a program 6639 which might be confused by the linemarkers. 6640 6641`-C' 6642 Do not discard comments. All comments are passed through to the 6643 output file, except for comments in processed directives, which 6644 are deleted along with the directive. 6645 6646 You should be prepared for side effects when using `-C'; it causes 6647 the preprocessor to treat comments as tokens in their own right. 6648 For example, comments appearing at the start of what would be a 6649 directive line have the effect of turning that line into an 6650 ordinary source line, since the first token on the line is no 6651 longer a `#'. 6652 6653`-CC' 6654 Do not discard comments, including during macro expansion. This is 6655 like `-C', except that comments contained within macros are also 6656 passed through to the output file where the macro is expanded. 6657 6658 In addition to the side-effects of the `-C' option, the `-CC' 6659 option causes all C++-style comments inside a macro to be 6660 converted to C-style comments. This is to prevent later use of 6661 that macro from inadvertently commenting out the remainder of the 6662 source line. 6663 6664 The `-CC' option is generally used to support lint comments. 6665 6666`-traditional-cpp' 6667 Try to imitate the behavior of old-fashioned C preprocessors, as 6668 opposed to ISO C preprocessors. 6669 6670`-trigraphs' 6671 Process trigraph sequences. These are three-character sequences, 6672 all starting with `??', that are defined by ISO C to stand for 6673 single characters. For example, `??/' stands for `\', so `'??/n'' 6674 is a character constant for a newline. By default, GCC ignores 6675 trigraphs, but in standard-conforming modes it converts them. See 6676 the `-std' and `-ansi' options. 6677 6678 The nine trigraphs and their replacements are 6679 6680 Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??- 6681 Replacement: [ ] { } # \ ^ | ~ 6682 6683`-remap' 6684 Enable special code to work around file systems which only permit 6685 very short file names, such as MS-DOS. 6686 6687`--help' 6688`--target-help' 6689 Print text describing all the command line options instead of 6690 preprocessing anything. 6691 6692`-v' 6693 Verbose mode. Print out GNU CPP's version number at the beginning 6694 of execution, and report the final form of the include path. 6695 6696`-H' 6697 Print the name of each header file used, in addition to other 6698 normal activities. Each name is indented to show how deep in the 6699 `#include' stack it is. Precompiled header files are also 6700 printed, even if they are found to be invalid; an invalid 6701 precompiled header file is printed with `...x' and a valid one 6702 with `...!' . 6703 6704`-version' 6705`--version' 6706 Print out GNU CPP's version number. With one dash, proceed to 6707 preprocess as normal. With two dashes, exit immediately. 6708 6709 6710File: gcc.info, Node: Assembler Options, Next: Link Options, Prev: Preprocessor Options, Up: Invoking GCC 6711 67123.12 Passing Options to the Assembler 6713===================================== 6714 6715You can pass options to the assembler. 6716 6717`-Wa,OPTION' 6718 Pass OPTION as an option to the assembler. If OPTION contains 6719 commas, it is split into multiple options at the commas. 6720 6721`-Xassembler OPTION' 6722 Pass OPTION as an option to the assembler. You can use this to 6723 supply system-specific assembler options which GCC does not know 6724 how to recognize. 6725 6726 If you want to pass an option that takes an argument, you must use 6727 `-Xassembler' twice, once for the option and once for the argument. 6728 6729 6730 6731File: gcc.info, Node: Link Options, Next: Directory Options, Prev: Assembler Options, Up: Invoking GCC 6732 67333.13 Options for Linking 6734======================== 6735 6736These options come into play when the compiler links object files into 6737an executable output file. They are meaningless if the compiler is not 6738doing a link step. 6739 6740`OBJECT-FILE-NAME' 6741 A file name that does not end in a special recognized suffix is 6742 considered to name an object file or library. (Object files are 6743 distinguished from libraries by the linker according to the file 6744 contents.) If linking is done, these object files are used as 6745 input to the linker. 6746 6747`-c' 6748`-S' 6749`-E' 6750 If any of these options is used, then the linker is not run, and 6751 object file names should not be used as arguments. *Note Overall 6752 Options::. 6753 6754`-lLIBRARY' 6755`-l LIBRARY' 6756 Search the library named LIBRARY when linking. (The second 6757 alternative with the library as a separate argument is only for 6758 POSIX compliance and is not recommended.) 6759 6760 It makes a difference where in the command you write this option; 6761 the linker searches and processes libraries and object files in 6762 the order they are specified. Thus, `foo.o -lz bar.o' searches 6763 library `z' after file `foo.o' but before `bar.o'. If `bar.o' 6764 refers to functions in `z', those functions may not be loaded. 6765 6766 The linker searches a standard list of directories for the library, 6767 which is actually a file named `libLIBRARY.a'. The linker then 6768 uses this file as if it had been specified precisely by name. 6769 6770 The directories searched include several standard system 6771 directories plus any that you specify with `-L'. 6772 6773 Normally the files found this way are library files--archive files 6774 whose members are object files. The linker handles an archive 6775 file by scanning through it for members which define symbols that 6776 have so far been referenced but not defined. But if the file that 6777 is found is an ordinary object file, it is linked in the usual 6778 fashion. The only difference between using an `-l' option and 6779 specifying a file name is that `-l' surrounds LIBRARY with `lib' 6780 and `.a' and searches several directories. 6781 6782`-lobjc' 6783 You need this special case of the `-l' option in order to link an 6784 Objective-C or Objective-C++ program. 6785 6786`-nostartfiles' 6787 Do not use the standard system startup files when linking. The 6788 standard system libraries are used normally, unless `-nostdlib' or 6789 `-nodefaultlibs' is used. 6790 6791`-nodefaultlibs' 6792 Do not use the standard system libraries when linking. Only the 6793 libraries you specify will be passed to the linker. The standard 6794 startup files are used normally, unless `-nostartfiles' is used. 6795 The compiler may generate calls to `memcmp', `memset', `memcpy' 6796 and `memmove'. These entries are usually resolved by entries in 6797 libc. These entry points should be supplied through some other 6798 mechanism when this option is specified. 6799 6800`-nostdlib' 6801 Do not use the standard system startup files or libraries when 6802 linking. No startup files and only the libraries you specify will 6803 be passed to the linker. The compiler may generate calls to 6804 `memcmp', `memset', `memcpy' and `memmove'. These entries are 6805 usually resolved by entries in libc. These entry points should be 6806 supplied through some other mechanism when this option is 6807 specified. 6808 6809 One of the standard libraries bypassed by `-nostdlib' and 6810 `-nodefaultlibs' is `libgcc.a', a library of internal subroutines 6811 that GCC uses to overcome shortcomings of particular machines, or 6812 special needs for some languages. (*Note Interfacing to GCC 6813 Output: (gccint)Interface, for more discussion of `libgcc.a'.) In 6814 most cases, you need `libgcc.a' even when you want to avoid other 6815 standard libraries. In other words, when you specify `-nostdlib' 6816 or `-nodefaultlibs' you should usually specify `-lgcc' as well. 6817 This ensures that you have no unresolved references to internal GCC 6818 library subroutines. (For example, `__main', used to ensure C++ 6819 constructors will be called; *note `collect2': (gccint)Collect2.) 6820 6821`-pie' 6822 Produce a position independent executable on targets which support 6823 it. For predictable results, you must also specify the same set 6824 of options that were used to generate code (`-fpie', `-fPIE', or 6825 model suboptions) when you specify this option. 6826 6827`-rdynamic' 6828 Pass the flag `-export-dynamic' to the ELF linker, on targets that 6829 support it. This instructs the linker to add all symbols, not only 6830 used ones, to the dynamic symbol table. This option is needed for 6831 some uses of `dlopen' or to allow obtaining backtraces from within 6832 a program. 6833 6834`-s' 6835 Remove all symbol table and relocation information from the 6836 executable. 6837 6838`-static' 6839 On systems that support dynamic linking, this prevents linking 6840 with the shared libraries. On other systems, this option has no 6841 effect. 6842 6843`-shared' 6844 Produce a shared object which can then be linked with other 6845 objects to form an executable. Not all systems support this 6846 option. For predictable results, you must also specify the same 6847 set of options that were used to generate code (`-fpic', `-fPIC', 6848 or model suboptions) when you specify this option.(1) 6849 6850`-shared-libgcc' 6851`-static-libgcc' 6852 On systems that provide `libgcc' as a shared library, these options 6853 force the use of either the shared or static version respectively. 6854 If no shared version of `libgcc' was built when the compiler was 6855 configured, these options have no effect. 6856 6857 There are several situations in which an application should use the 6858 shared `libgcc' instead of the static version. The most common of 6859 these is when the application wishes to throw and catch exceptions 6860 across different shared libraries. In that case, each of the 6861 libraries as well as the application itself should use the shared 6862 `libgcc'. 6863 6864 Therefore, the G++ and GCJ drivers automatically add 6865 `-shared-libgcc' whenever you build a shared library or a main 6866 executable, because C++ and Java programs typically use 6867 exceptions, so this is the right thing to do. 6868 6869 If, instead, you use the GCC driver to create shared libraries, 6870 you may find that they will not always be linked with the shared 6871 `libgcc'. If GCC finds, at its configuration time, that you have 6872 a non-GNU linker or a GNU linker that does not support option 6873 `--eh-frame-hdr', it will link the shared version of `libgcc' into 6874 shared libraries by default. Otherwise, it will take advantage of 6875 the linker and optimize away the linking with the shared version 6876 of `libgcc', linking with the static version of libgcc by default. 6877 This allows exceptions to propagate through such shared 6878 libraries, without incurring relocation costs at library load time. 6879 6880 However, if a library or main executable is supposed to throw or 6881 catch exceptions, you must link it using the G++ or GCJ driver, as 6882 appropriate for the languages used in the program, or using the 6883 option `-shared-libgcc', such that it is linked with the shared 6884 `libgcc'. 6885 6886`-symbolic' 6887 Bind references to global symbols when building a shared object. 6888 Warn about any unresolved references (unless overridden by the 6889 link editor option `-Xlinker -z -Xlinker defs'). Only a few 6890 systems support this option. 6891 6892`-Xlinker OPTION' 6893 Pass OPTION as an option to the linker. You can use this to 6894 supply system-specific linker options which GCC does not know how 6895 to recognize. 6896 6897 If you want to pass an option that takes an argument, you must use 6898 `-Xlinker' twice, once for the option and once for the argument. 6899 For example, to pass `-assert definitions', you must write 6900 `-Xlinker -assert -Xlinker definitions'. It does not work to write 6901 `-Xlinker "-assert definitions"', because this passes the entire 6902 string as a single argument, which is not what the linker expects. 6903 6904`-Wl,OPTION' 6905 Pass OPTION as an option to the linker. If OPTION contains 6906 commas, it is split into multiple options at the commas. 6907 6908`-u SYMBOL' 6909 Pretend the symbol SYMBOL is undefined, to force linking of 6910 library modules to define it. You can use `-u' multiple times with 6911 different symbols to force loading of additional library modules. 6912 6913 ---------- Footnotes ---------- 6914 6915 (1) On some systems, `gcc -shared' needs to build supplementary stub 6916code for constructors to work. On multi-libbed systems, `gcc -shared' 6917must select the correct support libraries to link against. Failing to 6918supply the correct flags may lead to subtle defects. Supplying them in 6919cases where they are not necessary is innocuous. 6920 6921 6922File: gcc.info, Node: Directory Options, Next: Spec Files, Prev: Link Options, Up: Invoking GCC 6923 69243.14 Options for Directory Search 6925================================= 6926 6927These options specify directories to search for header files, for 6928libraries and for parts of the compiler: 6929 6930`-IDIR' 6931 Add the directory DIR to the head of the list of directories to be 6932 searched for header files. This can be used to override a system 6933 header file, substituting your own version, since these 6934 directories are searched before the system header file 6935 directories. However, you should not use this option to add 6936 directories that contain vendor-supplied system header files (use 6937 `-isystem' for that). If you use more than one `-I' option, the 6938 directories are scanned in left-to-right order; the standard 6939 system directories come after. 6940 6941 If a standard system include directory, or a directory specified 6942 with `-isystem', is also specified with `-I', the `-I' option will 6943 be ignored. The directory will still be searched but as a system 6944 directory at its normal position in the system include chain. 6945 This is to ensure that GCC's procedure to fix buggy system headers 6946 and the ordering for the include_next directive are not 6947 inadvertently changed. If you really need to change the search 6948 order for system directories, use the `-nostdinc' and/or 6949 `-isystem' options. 6950 6951`-iquoteDIR' 6952 Add the directory DIR to the head of the list of directories to be 6953 searched for header files only for the case of `#include "FILE"'; 6954 they are not searched for `#include <FILE>', otherwise just like 6955 `-I'. 6956 6957`-LDIR' 6958 Add directory DIR to the list of directories to be searched for 6959 `-l'. 6960 6961`-BPREFIX' 6962 This option specifies where to find the executables, libraries, 6963 include files, and data files of the compiler itself. 6964 6965 The compiler driver program runs one or more of the subprograms 6966 `cpp', `cc1', `as' and `ld'. It tries PREFIX as a prefix for each 6967 program it tries to run, both with and without `MACHINE/VERSION/' 6968 (*note Target Options::). 6969 6970 For each subprogram to be run, the compiler driver first tries the 6971 `-B' prefix, if any. If that name is not found, or if `-B' was 6972 not specified, the driver tries two standard prefixes, which are 6973 `/usr/lib/gcc/' and `/usr/local/lib/gcc/'. If neither of those 6974 results in a file name that is found, the unmodified program name 6975 is searched for using the directories specified in your `PATH' 6976 environment variable. 6977 6978 The compiler will check to see if the path provided by the `-B' 6979 refers to a directory, and if necessary it will add a directory 6980 separator character at the end of the path. 6981 6982 `-B' prefixes that effectively specify directory names also apply 6983 to libraries in the linker, because the compiler translates these 6984 options into `-L' options for the linker. They also apply to 6985 includes files in the preprocessor, because the compiler 6986 translates these options into `-isystem' options for the 6987 preprocessor. In this case, the compiler appends `include' to the 6988 prefix. 6989 6990 The run-time support file `libgcc.a' can also be searched for using 6991 the `-B' prefix, if needed. If it is not found there, the two 6992 standard prefixes above are tried, and that is all. The file is 6993 left out of the link if it is not found by those means. 6994 6995 Another way to specify a prefix much like the `-B' prefix is to use 6996 the environment variable `GCC_EXEC_PREFIX'. *Note Environment 6997 Variables::. 6998 6999 As a special kludge, if the path provided by `-B' is 7000 `[dir/]stageN/', where N is a number in the range 0 to 9, then it 7001 will be replaced by `[dir/]include'. This is to help with 7002 boot-strapping the compiler. 7003 7004`-specs=FILE' 7005 Process FILE after the compiler reads in the standard `specs' 7006 file, in order to override the defaults that the `gcc' driver 7007 program uses when determining what switches to pass to `cc1', 7008 `cc1plus', `as', `ld', etc. More than one `-specs=FILE' can be 7009 specified on the command line, and they are processed in order, 7010 from left to right. 7011 7012`--sysroot=DIR' 7013 Use DIR as the logical root directory for headers and libraries. 7014 For example, if the compiler would normally search for headers in 7015 `/usr/include' and libraries in `/usr/lib', it will instead search 7016 `DIR/usr/include' and `DIR/usr/lib'. 7017 7018 If you use both this option and the `-isysroot' option, then the 7019 `--sysroot' option will apply to libraries, but the `-isysroot' 7020 option will apply to header files. 7021 7022 The GNU linker (beginning with version 2.16) has the necessary 7023 support for this option. If your linker does not support this 7024 option, the header file aspect of `--sysroot' will still work, but 7025 the library aspect will not. 7026 7027`-I-' 7028 This option has been deprecated. Please use `-iquote' instead for 7029 `-I' directories before the `-I-' and remove the `-I-'. Any 7030 directories you specify with `-I' options before the `-I-' option 7031 are searched only for the case of `#include "FILE"'; they are not 7032 searched for `#include <FILE>'. 7033 7034 If additional directories are specified with `-I' options after 7035 the `-I-', these directories are searched for all `#include' 7036 directives. (Ordinarily _all_ `-I' directories are used this way.) 7037 7038 In addition, the `-I-' option inhibits the use of the current 7039 directory (where the current input file came from) as the first 7040 search directory for `#include "FILE"'. There is no way to 7041 override this effect of `-I-'. With `-I.' you can specify 7042 searching the directory which was current when the compiler was 7043 invoked. That is not exactly the same as what the preprocessor 7044 does by default, but it is often satisfactory. 7045 7046 `-I-' does not inhibit the use of the standard system directories 7047 for header files. Thus, `-I-' and `-nostdinc' are independent. 7048 7049 7050File: gcc.info, Node: Spec Files, Next: Target Options, Prev: Directory Options, Up: Invoking GCC 7051 70523.15 Specifying subprocesses and the switches to pass to them 7053============================================================= 7054 7055`gcc' is a driver program. It performs its job by invoking a sequence 7056of other programs to do the work of compiling, assembling and linking. 7057GCC interprets its command-line parameters and uses these to deduce 7058which programs it should invoke, and which command-line options it 7059ought to place on their command lines. This behavior is controlled by 7060"spec strings". In most cases there is one spec string for each 7061program that GCC can invoke, but a few programs have multiple spec 7062strings to control their behavior. The spec strings built into GCC can 7063be overridden by using the `-specs=' command-line switch to specify a 7064spec file. 7065 7066 "Spec files" are plaintext files that are used to construct spec 7067strings. They consist of a sequence of directives separated by blank 7068lines. The type of directive is determined by the first non-whitespace 7069character on the line and it can be one of the following: 7070 7071`%COMMAND' 7072 Issues a COMMAND to the spec file processor. The commands that can 7073 appear here are: 7074 7075 `%include <FILE>' 7076 Search for FILE and insert its text at the current point in 7077 the specs file. 7078 7079 `%include_noerr <FILE>' 7080 Just like `%include', but do not generate an error message if 7081 the include file cannot be found. 7082 7083 `%rename OLD_NAME NEW_NAME' 7084 Rename the spec string OLD_NAME to NEW_NAME. 7085 7086 7087`*[SPEC_NAME]:' 7088 This tells the compiler to create, override or delete the named 7089 spec string. All lines after this directive up to the next 7090 directive or blank line are considered to be the text for the spec 7091 string. If this results in an empty string then the spec will be 7092 deleted. (Or, if the spec did not exist, then nothing will 7093 happened.) Otherwise, if the spec does not currently exist a new 7094 spec will be created. If the spec does exist then its contents 7095 will be overridden by the text of this directive, unless the first 7096 character of that text is the `+' character, in which case the 7097 text will be appended to the spec. 7098 7099`[SUFFIX]:' 7100 Creates a new `[SUFFIX] spec' pair. All lines after this directive 7101 and up to the next directive or blank line are considered to make 7102 up the spec string for the indicated suffix. When the compiler 7103 encounters an input file with the named suffix, it will processes 7104 the spec string in order to work out how to compile that file. 7105 For example: 7106 7107 .ZZ: 7108 z-compile -input %i 7109 7110 This says that any input file whose name ends in `.ZZ' should be 7111 passed to the program `z-compile', which should be invoked with the 7112 command-line switch `-input' and with the result of performing the 7113 `%i' substitution. (See below.) 7114 7115 As an alternative to providing a spec string, the text that 7116 follows a suffix directive can be one of the following: 7117 7118 `@LANGUAGE' 7119 This says that the suffix is an alias for a known LANGUAGE. 7120 This is similar to using the `-x' command-line switch to GCC 7121 to specify a language explicitly. For example: 7122 7123 .ZZ: 7124 @c++ 7125 7126 Says that .ZZ files are, in fact, C++ source files. 7127 7128 `#NAME' 7129 This causes an error messages saying: 7130 7131 NAME compiler not installed on this system. 7132 7133 GCC already has an extensive list of suffixes built into it. This 7134 directive will add an entry to the end of the list of suffixes, but 7135 since the list is searched from the end backwards, it is 7136 effectively possible to override earlier entries using this 7137 technique. 7138 7139 7140 GCC has the following spec strings built into it. Spec files can 7141override these strings or create their own. Note that individual 7142targets can also add their own spec strings to this list. 7143 7144 asm Options to pass to the assembler 7145 asm_final Options to pass to the assembler post-processor 7146 cpp Options to pass to the C preprocessor 7147 cc1 Options to pass to the C compiler 7148 cc1plus Options to pass to the C++ compiler 7149 endfile Object files to include at the end of the link 7150 link Options to pass to the linker 7151 lib Libraries to include on the command line to the linker 7152 libgcc Decides which GCC support library to pass to the linker 7153 linker Sets the name of the linker 7154 predefines Defines to be passed to the C preprocessor 7155 signed_char Defines to pass to CPP to say whether `char' is signed 7156 by default 7157 startfile Object files to include at the start of the link 7158 7159 Here is a small example of a spec file: 7160 7161 %rename lib old_lib 7162 7163 *lib: 7164 --start-group -lgcc -lc -leval1 --end-group %(old_lib) 7165 7166 This example renames the spec called `lib' to `old_lib' and then 7167overrides the previous definition of `lib' with a new one. The new 7168definition adds in some extra command-line options before including the 7169text of the old definition. 7170 7171 "Spec strings" are a list of command-line options to be passed to their 7172corresponding program. In addition, the spec strings can contain 7173`%'-prefixed sequences to substitute variable text or to conditionally 7174insert text into the command line. Using these constructs it is 7175possible to generate quite complex command lines. 7176 7177 Here is a table of all defined `%'-sequences for spec strings. Note 7178that spaces are not generated automatically around the results of 7179expanding these sequences. Therefore you can concatenate them together 7180or combine them with constant text in a single argument. 7181 7182`%%' 7183 Substitute one `%' into the program name or argument. 7184 7185`%i' 7186 Substitute the name of the input file being processed. 7187 7188`%b' 7189 Substitute the basename of the input file being processed. This 7190 is the substring up to (and not including) the last period and not 7191 including the directory. 7192 7193`%B' 7194 This is the same as `%b', but include the file suffix (text after 7195 the last period). 7196 7197`%d' 7198 Marks the argument containing or following the `%d' as a temporary 7199 file name, so that that file will be deleted if GCC exits 7200 successfully. Unlike `%g', this contributes no text to the 7201 argument. 7202 7203`%gSUFFIX' 7204 Substitute a file name that has suffix SUFFIX and is chosen once 7205 per compilation, and mark the argument in the same way as `%d'. 7206 To reduce exposure to denial-of-service attacks, the file name is 7207 now chosen in a way that is hard to predict even when previously 7208 chosen file names are known. For example, `%g.s ... %g.o ... %g.s' 7209 might turn into `ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s'. SUFFIX 7210 matches the regexp `[.A-Za-z]*' or the special string `%O', which 7211 is treated exactly as if `%O' had been preprocessed. Previously, 7212 `%g' was simply substituted with a file name chosen once per 7213 compilation, without regard to any appended suffix (which was 7214 therefore treated just like ordinary text), making such attacks 7215 more likely to succeed. 7216 7217`%uSUFFIX' 7218 Like `%g', but generates a new temporary file name even if 7219 `%uSUFFIX' was already seen. 7220 7221`%USUFFIX' 7222 Substitutes the last file name generated with `%uSUFFIX', 7223 generating a new one if there is no such last file name. In the 7224 absence of any `%uSUFFIX', this is just like `%gSUFFIX', except 7225 they don't share the same suffix _space_, so `%g.s ... %U.s ... 7226 %g.s ... %U.s' would involve the generation of two distinct file 7227 names, one for each `%g.s' and another for each `%U.s'. 7228 Previously, `%U' was simply substituted with a file name chosen 7229 for the previous `%u', without regard to any appended suffix. 7230 7231`%jSUFFIX' 7232 Substitutes the name of the `HOST_BIT_BUCKET', if any, and if it is 7233 writable, and if save-temps is off; otherwise, substitute the name 7234 of a temporary file, just like `%u'. This temporary file is not 7235 meant for communication between processes, but rather as a junk 7236 disposal mechanism. 7237 7238`%|SUFFIX' 7239`%mSUFFIX' 7240 Like `%g', except if `-pipe' is in effect. In that case `%|' 7241 substitutes a single dash and `%m' substitutes nothing at all. 7242 These are the two most common ways to instruct a program that it 7243 should read from standard input or write to standard output. If 7244 you need something more elaborate you can use an `%{pipe:`X'}' 7245 construct: see for example `f/lang-specs.h'. 7246 7247`%.SUFFIX' 7248 Substitutes .SUFFIX for the suffixes of a matched switch's args 7249 when it is subsequently output with `%*'. SUFFIX is terminated by 7250 the next space or %. 7251 7252`%w' 7253 Marks the argument containing or following the `%w' as the 7254 designated output file of this compilation. This puts the argument 7255 into the sequence of arguments that `%o' will substitute later. 7256 7257`%o' 7258 Substitutes the names of all the output files, with spaces 7259 automatically placed around them. You should write spaces around 7260 the `%o' as well or the results are undefined. `%o' is for use in 7261 the specs for running the linker. Input files whose names have no 7262 recognized suffix are not compiled at all, but they are included 7263 among the output files, so they will be linked. 7264 7265`%O' 7266 Substitutes the suffix for object files. Note that this is 7267 handled specially when it immediately follows `%g, %u, or %U', 7268 because of the need for those to form complete file names. The 7269 handling is such that `%O' is treated exactly as if it had already 7270 been substituted, except that `%g, %u, and %U' do not currently 7271 support additional SUFFIX characters following `%O' as they would 7272 following, for example, `.o'. 7273 7274`%p' 7275 Substitutes the standard macro predefinitions for the current 7276 target machine. Use this when running `cpp'. 7277 7278`%P' 7279 Like `%p', but puts `__' before and after the name of each 7280 predefined macro, except for macros that start with `__' or with 7281 `_L', where L is an uppercase letter. This is for ISO C. 7282 7283`%I' 7284 Substitute any of `-iprefix' (made from `GCC_EXEC_PREFIX'), 7285 `-isysroot' (made from `TARGET_SYSTEM_ROOT'), `-isystem' (made 7286 from `COMPILER_PATH' and `-B' options) and `-imultilib' as 7287 necessary. 7288 7289`%s' 7290 Current argument is the name of a library or startup file of some 7291 sort. Search for that file in a standard list of directories and 7292 substitute the full name found. 7293 7294`%eSTR' 7295 Print STR as an error message. STR is terminated by a newline. 7296 Use this when inconsistent options are detected. 7297 7298`%(NAME)' 7299 Substitute the contents of spec string NAME at this point. 7300 7301`%[NAME]' 7302 Like `%(...)' but put `__' around `-D' arguments. 7303 7304`%x{OPTION}' 7305 Accumulate an option for `%X'. 7306 7307`%X' 7308 Output the accumulated linker options specified by `-Wl' or a `%x' 7309 spec string. 7310 7311`%Y' 7312 Output the accumulated assembler options specified by `-Wa'. 7313 7314`%Z' 7315 Output the accumulated preprocessor options specified by `-Wp'. 7316 7317`%a' 7318 Process the `asm' spec. This is used to compute the switches to 7319 be passed to the assembler. 7320 7321`%A' 7322 Process the `asm_final' spec. This is a spec string for passing 7323 switches to an assembler post-processor, if such a program is 7324 needed. 7325 7326`%l' 7327 Process the `link' spec. This is the spec for computing the 7328 command line passed to the linker. Typically it will make use of 7329 the `%L %G %S %D and %E' sequences. 7330 7331`%D' 7332 Dump out a `-L' option for each directory that GCC believes might 7333 contain startup files. If the target supports multilibs then the 7334 current multilib directory will be prepended to each of these 7335 paths. 7336 7337`%L' 7338 Process the `lib' spec. This is a spec string for deciding which 7339 libraries should be included on the command line to the linker. 7340 7341`%G' 7342 Process the `libgcc' spec. This is a spec string for deciding 7343 which GCC support library should be included on the command line 7344 to the linker. 7345 7346`%S' 7347 Process the `startfile' spec. This is a spec for deciding which 7348 object files should be the first ones passed to the linker. 7349 Typically this might be a file named `crt0.o'. 7350 7351`%E' 7352 Process the `endfile' spec. This is a spec string that specifies 7353 the last object files that will be passed to the linker. 7354 7355`%C' 7356 Process the `cpp' spec. This is used to construct the arguments 7357 to be passed to the C preprocessor. 7358 7359`%1' 7360 Process the `cc1' spec. This is used to construct the options to 7361 be passed to the actual C compiler (`cc1'). 7362 7363`%2' 7364 Process the `cc1plus' spec. This is used to construct the options 7365 to be passed to the actual C++ compiler (`cc1plus'). 7366 7367`%*' 7368 Substitute the variable part of a matched option. See below. 7369 Note that each comma in the substituted string is replaced by a 7370 single space. 7371 7372`%<`S'' 7373 Remove all occurrences of `-S' from the command line. Note--this 7374 command is position dependent. `%' commands in the spec string 7375 before this one will see `-S', `%' commands in the spec string 7376 after this one will not. 7377 7378`%:FUNCTION(ARGS)' 7379 Call the named function FUNCTION, passing it ARGS. ARGS is first 7380 processed as a nested spec string, then split into an argument 7381 vector in the usual fashion. The function returns a string which 7382 is processed as if it had appeared literally as part of the 7383 current spec. 7384 7385 The following built-in spec functions are provided: 7386 7387 ``if-exists'' 7388 The `if-exists' spec function takes one argument, an absolute 7389 pathname to a file. If the file exists, `if-exists' returns 7390 the pathname. Here is a small example of its usage: 7391 7392 *startfile: 7393 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s 7394 7395 ``if-exists-else'' 7396 The `if-exists-else' spec function is similar to the 7397 `if-exists' spec function, except that it takes two 7398 arguments. The first argument is an absolute pathname to a 7399 file. If the file exists, `if-exists-else' returns the 7400 pathname. If it does not exist, it returns the second 7401 argument. This way, `if-exists-else' can be used to select 7402 one file or another, based on the existence of the first. 7403 Here is a small example of its usage: 7404 7405 *startfile: 7406 crt0%O%s %:if-exists(crti%O%s) \ 7407 %:if-exists-else(crtbeginT%O%s crtbegin%O%s) 7408 7409 ``replace-outfile'' 7410 The `replace-outfile' spec function takes two arguments. It 7411 looks for the first argument in the outfiles array and 7412 replaces it with the second argument. Here is a small 7413 example of its usage: 7414 7415 %{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)} 7416 7417 7418`%{`S'}' 7419 Substitutes the `-S' switch, if that switch was given to GCC. If 7420 that switch was not specified, this substitutes nothing. Note that 7421 the leading dash is omitted when specifying this option, and it is 7422 automatically inserted if the substitution is performed. Thus the 7423 spec string `%{foo}' would match the command-line option `-foo' 7424 and would output the command line option `-foo'. 7425 7426`%W{`S'}' 7427 Like %{`S'} but mark last argument supplied within as a file to be 7428 deleted on failure. 7429 7430`%{`S'*}' 7431 Substitutes all the switches specified to GCC whose names start 7432 with `-S', but which also take an argument. This is used for 7433 switches like `-o', `-D', `-I', etc. GCC considers `-o foo' as 7434 being one switch whose names starts with `o'. %{o*} would 7435 substitute this text, including the space. Thus two arguments 7436 would be generated. 7437 7438`%{`S'*&`T'*}' 7439 Like %{`S'*}, but preserve order of `S' and `T' options (the order 7440 of `S' and `T' in the spec is not significant). There can be any 7441 number of ampersand-separated variables; for each the wild card is 7442 optional. Useful for CPP as `%{D*&U*&A*}'. 7443 7444`%{`S':`X'}' 7445 Substitutes `X', if the `-S' switch was given to GCC. 7446 7447`%{!`S':`X'}' 7448 Substitutes `X', if the `-S' switch was _not_ given to GCC. 7449 7450`%{`S'*:`X'}' 7451 Substitutes `X' if one or more switches whose names start with 7452 `-S' are specified to GCC. Normally `X' is substituted only once, 7453 no matter how many such switches appeared. However, if `%*' 7454 appears somewhere in `X', then `X' will be substituted once for 7455 each matching switch, with the `%*' replaced by the part of that 7456 switch that matched the `*'. 7457 7458`%{.`S':`X'}' 7459 Substitutes `X', if processing a file with suffix `S'. 7460 7461`%{!.`S':`X'}' 7462 Substitutes `X', if _not_ processing a file with suffix `S'. 7463 7464`%{`S'|`P':`X'}' 7465 Substitutes `X' if either `-S' or `-P' was given to GCC. This may 7466 be combined with `!', `.', and `*' sequences as well, although 7467 they have a stronger binding than the `|'. If `%*' appears in 7468 `X', all of the alternatives must be starred, and only the first 7469 matching alternative is substituted. 7470 7471 For example, a spec string like this: 7472 7473 %{.c:-foo} %{!.c:-bar} %{.c|d:-baz} %{!.c|d:-boggle} 7474 7475 will output the following command-line options from the following 7476 input command-line options: 7477 7478 fred.c -foo -baz 7479 jim.d -bar -boggle 7480 -d fred.c -foo -baz -boggle 7481 -d jim.d -bar -baz -boggle 7482 7483`%{S:X; T:Y; :D}' 7484 If `S' was given to GCC, substitutes `X'; else if `T' was given to 7485 GCC, substitutes `Y'; else substitutes `D'. There can be as many 7486 clauses as you need. This may be combined with `.', `!', `|', and 7487 `*' as needed. 7488 7489 7490 The conditional text `X' in a %{`S':`X'} or similar construct may 7491contain other nested `%' constructs or spaces, or even newlines. They 7492are processed as usual, as described above. Trailing white space in 7493`X' is ignored. White space may also appear anywhere on the left side 7494of the colon in these constructs, except between `.' or `*' and the 7495corresponding word. 7496 7497 The `-O', `-f', `-m', and `-W' switches are handled specifically in 7498these constructs. If another value of `-O' or the negated form of a 7499`-f', `-m', or `-W' switch is found later in the command line, the 7500earlier switch value is ignored, except with {`S'*} where `S' is just 7501one letter, which passes all matching options. 7502 7503 The character `|' at the beginning of the predicate text is used to 7504indicate that a command should be piped to the following command, but 7505only if `-pipe' is specified. 7506 7507 It is built into GCC which switches take arguments and which do not. 7508(You might think it would be useful to generalize this to allow each 7509compiler's spec to say which switches take arguments. But this cannot 7510be done in a consistent fashion. GCC cannot even decide which input 7511files have been specified without knowing which switches take arguments, 7512and it must know which input files to compile in order to tell which 7513compilers to run). 7514 7515 GCC also knows implicitly that arguments starting in `-l' are to be 7516treated as compiler output files, and passed to the linker in their 7517proper position among the other output files. 7518 7519 7520File: gcc.info, Node: Target Options, Next: Submodel Options, Prev: Spec Files, Up: Invoking GCC 7521 75223.16 Specifying Target Machine and Compiler Version 7523=================================================== 7524 7525The usual way to run GCC is to run the executable called `gcc', or 7526`<machine>-gcc' when cross-compiling, or `<machine>-gcc-<version>' to 7527run a version other than the one that was installed last. Sometimes 7528this is inconvenient, so GCC provides options that will switch to 7529another cross-compiler or version. 7530 7531`-b MACHINE' 7532 The argument MACHINE specifies the target machine for compilation. 7533 7534 The value to use for MACHINE is the same as was specified as the 7535 machine type when configuring GCC as a cross-compiler. For 7536 example, if a cross-compiler was configured with `configure 7537 arm-elf', meaning to compile for an arm processor with elf 7538 binaries, then you would specify `-b arm-elf' to run that cross 7539 compiler. Because there are other options beginning with `-b', the 7540 configuration must contain a hyphen. 7541 7542`-V VERSION' 7543 The argument VERSION specifies which version of GCC to run. This 7544 is useful when multiple versions are installed. For example, 7545 VERSION might be `4.0', meaning to run GCC version 4.0. 7546 7547 The `-V' and `-b' options work by running the 7548`<machine>-gcc-<version>' executable, so there's no real reason to use 7549them if you can just run that directly. 7550 7551 7552File: gcc.info, Node: Submodel Options, Next: Code Gen Options, Prev: Target Options, Up: Invoking GCC 7553 75543.17 Hardware Models and Configurations 7555======================================= 7556 7557Earlier we discussed the standard option `-b' which chooses among 7558different installed compilers for completely different target machines, 7559such as VAX vs. 68000 vs. 80386. 7560 7561 In addition, each of these target machine types can have its own 7562special options, starting with `-m', to choose among various hardware 7563models or configurations--for example, 68010 vs 68020, floating 7564coprocessor or none. A single installed version of the compiler can 7565compile for any model or configuration, according to the options 7566specified. 7567 7568 Some configurations of the compiler also support additional special 7569options, usually for compatibility with other compilers on the same 7570platform. 7571 7572* Menu: 7573 7574* ARC Options:: 7575* ARM Options:: 7576* AVR Options:: 7577* Blackfin Options:: 7578* CRIS Options:: 7579* CRX Options:: 7580* Darwin Options:: 7581* DEC Alpha Options:: 7582* DEC Alpha/VMS Options:: 7583* FRV Options:: 7584* GNU/Linux Options:: 7585* H8/300 Options:: 7586* HPPA Options:: 7587* i386 and x86-64 Options:: 7588* IA-64 Options:: 7589* M32C Options:: 7590* M32R/D Options:: 7591* M680x0 Options:: 7592* M68hc1x Options:: 7593* MCore Options:: 7594* MIPS Options:: 7595* MMIX Options:: 7596* MN10300 Options:: 7597* MT Options:: 7598* PDP-11 Options:: 7599* PowerPC Options:: 7600* RS/6000 and PowerPC Options:: 7601* S/390 and zSeries Options:: 7602* Score Options:: 7603* SH Options:: 7604* SPARC Options:: 7605* System V Options:: 7606* TMS320C3x/C4x Options:: 7607* V850 Options:: 7608* VAX Options:: 7609* x86-64 Options:: 7610* Xstormy16 Options:: 7611* Xtensa Options:: 7612* zSeries Options:: 7613 7614 7615File: gcc.info, Node: ARC Options, Next: ARM Options, Up: Submodel Options 7616 76173.17.1 ARC Options 7618------------------ 7619 7620These options are defined for ARC implementations: 7621 7622`-EL' 7623 Compile code for little endian mode. This is the default. 7624 7625`-EB' 7626 Compile code for big endian mode. 7627 7628`-mmangle-cpu' 7629 Prepend the name of the cpu to all public symbol names. In 7630 multiple-processor systems, there are many ARC variants with 7631 different instruction and register set characteristics. This flag 7632 prevents code compiled for one cpu to be linked with code compiled 7633 for another. No facility exists for handling variants that are 7634 "almost identical". This is an all or nothing option. 7635 7636`-mcpu=CPU' 7637 Compile code for ARC variant CPU. Which variants are supported 7638 depend on the configuration. All variants support `-mcpu=base', 7639 this is the default. 7640 7641`-mtext=TEXT-SECTION' 7642`-mdata=DATA-SECTION' 7643`-mrodata=READONLY-DATA-SECTION' 7644 Put functions, data, and readonly data in TEXT-SECTION, 7645 DATA-SECTION, and READONLY-DATA-SECTION respectively by default. 7646 This can be overridden with the `section' attribute. *Note 7647 Variable Attributes::. 7648 7649 7650 7651File: gcc.info, Node: ARM Options, Next: AVR Options, Prev: ARC Options, Up: Submodel Options 7652 76533.17.2 ARM Options 7654------------------ 7655 7656These `-m' options are defined for Advanced RISC Machines (ARM) 7657architectures: 7658 7659`-mabi=NAME' 7660 Generate code for the specified ABI. Permissible values are: 7661 `apcs-gnu', `atpcs', `aapcs', `aapcs-linux' and `iwmmxt'. 7662 7663`-mapcs-frame' 7664 Generate a stack frame that is compliant with the ARM Procedure 7665 Call Standard for all functions, even if this is not strictly 7666 necessary for correct execution of the code. Specifying 7667 `-fomit-frame-pointer' with this option will cause the stack 7668 frames not to be generated for leaf functions. The default is 7669 `-mno-apcs-frame'. 7670 7671`-mapcs' 7672 This is a synonym for `-mapcs-frame'. 7673 7674`-mthumb-interwork' 7675 Generate code which supports calling between the ARM and Thumb 7676 instruction sets. Without this option the two instruction sets 7677 cannot be reliably used inside one program. The default is 7678 `-mno-thumb-interwork', since slightly larger code is generated 7679 when `-mthumb-interwork' is specified. 7680 7681`-mno-sched-prolog' 7682 Prevent the reordering of instructions in the function prolog, or 7683 the merging of those instruction with the instructions in the 7684 function's body. This means that all functions will start with a 7685 recognizable set of instructions (or in fact one of a choice from 7686 a small set of different function prologues), and this information 7687 can be used to locate the start if functions inside an executable 7688 piece of code. The default is `-msched-prolog'. 7689 7690`-mhard-float' 7691 Generate output containing floating point instructions. This is 7692 the default. 7693 7694`-msoft-float' 7695 Generate output containing library calls for floating point. 7696 *Warning:* the requisite libraries are not available for all ARM 7697 targets. Normally the facilities of the machine's usual C 7698 compiler are used, but this cannot be done directly in 7699 cross-compilation. You must make your own arrangements to provide 7700 suitable library functions for cross-compilation. 7701 7702 `-msoft-float' changes the calling convention in the output file; 7703 therefore, it is only useful if you compile _all_ of a program with 7704 this option. In particular, you need to compile `libgcc.a', the 7705 library that comes with GCC, with `-msoft-float' in order for this 7706 to work. 7707 7708`-mfloat-abi=NAME' 7709 Specifies which ABI to use for floating point values. Permissible 7710 values are: `soft', `softfp' and `hard'. 7711 7712 `soft' and `hard' are equivalent to `-msoft-float' and 7713 `-mhard-float' respectively. `softfp' allows the generation of 7714 floating point instructions, but still uses the soft-float calling 7715 conventions. 7716 7717`-mlittle-endian' 7718 Generate code for a processor running in little-endian mode. This 7719 is the default for all standard configurations. 7720 7721`-mbig-endian' 7722 Generate code for a processor running in big-endian mode; the 7723 default is to compile code for a little-endian processor. 7724 7725`-mwords-little-endian' 7726 This option only applies when generating code for big-endian 7727 processors. Generate code for a little-endian word order but a 7728 big-endian byte order. That is, a byte order of the form 7729 `32107654'. Note: this option should only be used if you require 7730 compatibility with code for big-endian ARM processors generated by 7731 versions of the compiler prior to 2.8. 7732 7733`-mcpu=NAME' 7734 This specifies the name of the target ARM processor. GCC uses 7735 this name to determine what kind of instructions it can emit when 7736 generating assembly code. Permissible names are: `arm2', `arm250', 7737 `arm3', `arm6', `arm60', `arm600', `arm610', `arm620', `arm7', 7738 `arm7m', `arm7d', `arm7dm', `arm7di', `arm7dmi', `arm70', `arm700', 7739 `arm700i', `arm710', `arm710c', `arm7100', `arm7500', `arm7500fe', 7740 `arm7tdmi', `arm7tdmi-s', `arm8', `strongarm', `strongarm110', 7741 `strongarm1100', `arm8', `arm810', `arm9', `arm9e', `arm920', 7742 `arm920t', `arm922t', `arm946e-s', `arm966e-s', `arm968e-s', 7743 `arm926ej-s', `arm940t', `arm9tdmi', `arm10tdmi', `arm1020t', 7744 `arm1026ej-s', `arm10e', `arm1020e', `arm1022e', `arm1136j-s', 7745 `arm1136jf-s', `mpcore', `mpcorenovfp', `arm1176jz-s', 7746 `arm1176jzf-s', `xscale', `iwmmxt', `ep9312'. 7747 7748`-mtune=NAME' 7749 This option is very similar to the `-mcpu=' option, except that 7750 instead of specifying the actual target processor type, and hence 7751 restricting which instructions can be used, it specifies that GCC 7752 should tune the performance of the code as if the target were of 7753 the type specified in this option, but still choosing the 7754 instructions that it will generate based on the cpu specified by a 7755 `-mcpu=' option. For some ARM implementations better performance 7756 can be obtained by using this option. 7757 7758`-march=NAME' 7759 This specifies the name of the target ARM architecture. GCC uses 7760 this name to determine what kind of instructions it can emit when 7761 generating assembly code. This option can be used in conjunction 7762 with or instead of the `-mcpu=' option. Permissible names are: 7763 `armv2', `armv2a', `armv3', `armv3m', `armv4', `armv4t', `armv5', 7764 `armv5t', `armv5te', `armv6', `armv6j', `iwmmxt', `ep9312'. 7765 7766`-mfpu=NAME' 7767`-mfpe=NUMBER' 7768`-mfp=NUMBER' 7769 This specifies what floating point hardware (or hardware 7770 emulation) is available on the target. Permissible names are: 7771 `fpa', `fpe2', `fpe3', `maverick', `vfp'. `-mfp' and `-mfpe' are 7772 synonyms for `-mfpu'=`fpe'NUMBER, for compatibility with older 7773 versions of GCC. 7774 7775 If `-msoft-float' is specified this specifies the format of 7776 floating point values. 7777 7778`-mstructure-size-boundary=N' 7779 The size of all structures and unions will be rounded up to a 7780 multiple of the number of bits set by this option. Permissible 7781 values are 8, 32 and 64. The default value varies for different 7782 toolchains. For the COFF targeted toolchain the default value is 7783 8. A value of 64 is only allowed if the underlying ABI supports 7784 it. 7785 7786 Specifying the larger number can produce faster, more efficient 7787 code, but can also increase the size of the program. Different 7788 values are potentially incompatible. Code compiled with one value 7789 cannot necessarily expect to work with code or libraries compiled 7790 with another value, if they exchange information using structures 7791 or unions. 7792 7793`-mabort-on-noreturn' 7794 Generate a call to the function `abort' at the end of a `noreturn' 7795 function. It will be executed if the function tries to return. 7796 7797`-mlong-calls' 7798`-mno-long-calls' 7799 Tells the compiler to perform function calls by first loading the 7800 address of the function into a register and then performing a 7801 subroutine call on this register. This switch is needed if the 7802 target function will lie outside of the 64 megabyte addressing 7803 range of the offset based version of subroutine call instruction. 7804 7805 Even if this switch is enabled, not all function calls will be 7806 turned into long calls. The heuristic is that static functions, 7807 functions which have the `short-call' attribute, functions that 7808 are inside the scope of a `#pragma no_long_calls' directive and 7809 functions whose definitions have already been compiled within the 7810 current compilation unit, will not be turned into long calls. The 7811 exception to this rule is that weak function definitions, 7812 functions with the `long-call' attribute or the `section' 7813 attribute, and functions that are within the scope of a `#pragma 7814 long_calls' directive, will always be turned into long calls. 7815 7816 This feature is not enabled by default. Specifying 7817 `-mno-long-calls' will restore the default behavior, as will 7818 placing the function calls within the scope of a `#pragma 7819 long_calls_off' directive. Note these switches have no effect on 7820 how the compiler generates code to handle function calls via 7821 function pointers. 7822 7823`-mnop-fun-dllimport' 7824 Disable support for the `dllimport' attribute. 7825 7826`-msingle-pic-base' 7827 Treat the register used for PIC addressing as read-only, rather 7828 than loading it in the prologue for each function. The run-time 7829 system is responsible for initializing this register with an 7830 appropriate value before execution begins. 7831 7832`-mpic-register=REG' 7833 Specify the register to be used for PIC addressing. The default 7834 is R10 unless stack-checking is enabled, when R9 is used. 7835 7836`-mcirrus-fix-invalid-insns' 7837 Insert NOPs into the instruction stream to in order to work around 7838 problems with invalid Maverick instruction combinations. This 7839 option is only valid if the `-mcpu=ep9312' option has been used to 7840 enable generation of instructions for the Cirrus Maverick floating 7841 point co-processor. This option is not enabled by default, since 7842 the problem is only present in older Maverick implementations. 7843 The default can be re-enabled by use of the 7844 `-mno-cirrus-fix-invalid-insns' switch. 7845 7846`-mpoke-function-name' 7847 Write the name of each function into the text section, directly 7848 preceding the function prologue. The generated code is similar to 7849 this: 7850 7851 t0 7852 .ascii "arm_poke_function_name", 0 7853 .align 7854 t1 7855 .word 0xff000000 + (t1 - t0) 7856 arm_poke_function_name 7857 mov ip, sp 7858 stmfd sp!, {fp, ip, lr, pc} 7859 sub fp, ip, #4 7860 7861 When performing a stack backtrace, code can inspect the value of 7862 `pc' stored at `fp + 0'. If the trace function then looks at 7863 location `pc - 12' and the top 8 bits are set, then we know that 7864 there is a function name embedded immediately preceding this 7865 location and has length `((pc[-3]) & 0xff000000)'. 7866 7867`-mthumb' 7868 Generate code for the 16-bit Thumb instruction set. The default 7869 is to use the 32-bit ARM instruction set. 7870 7871`-mtpcs-frame' 7872 Generate a stack frame that is compliant with the Thumb Procedure 7873 Call Standard for all non-leaf functions. (A leaf function is one 7874 that does not call any other functions.) The default is 7875 `-mno-tpcs-frame'. 7876 7877`-mtpcs-leaf-frame' 7878 Generate a stack frame that is compliant with the Thumb Procedure 7879 Call Standard for all leaf functions. (A leaf function is one 7880 that does not call any other functions.) The default is 7881 `-mno-apcs-leaf-frame'. 7882 7883`-mcallee-super-interworking' 7884 Gives all externally visible functions in the file being compiled 7885 an ARM instruction set header which switches to Thumb mode before 7886 executing the rest of the function. This allows these functions 7887 to be called from non-interworking code. 7888 7889`-mcaller-super-interworking' 7890 Allows calls via function pointers (including virtual functions) to 7891 execute correctly regardless of whether the target code has been 7892 compiled for interworking or not. There is a small overhead in 7893 the cost of executing a function pointer if this option is enabled. 7894 7895`-mtp=NAME' 7896 Specify the access model for the thread local storage pointer. 7897 The valid models are `soft', which generates calls to 7898 `__aeabi_read_tp', `cp15', which fetches the thread pointer from 7899 `cp15' directly (supported in the arm6k architecture), and `auto', 7900 which uses the best available method for the selected processor. 7901 The default setting is `auto'. 7902 7903 7904 7905File: gcc.info, Node: AVR Options, Next: Blackfin Options, Prev: ARM Options, Up: Submodel Options 7906 79073.17.3 AVR Options 7908------------------ 7909 7910These options are defined for AVR implementations: 7911 7912`-mmcu=MCU' 7913 Specify ATMEL AVR instruction set or MCU type. 7914 7915 Instruction set avr1 is for the minimal AVR core, not supported by 7916 the C compiler, only for assembler programs (MCU types: at90s1200, 7917 attiny10, attiny11, attiny12, attiny15, attiny28). 7918 7919 Instruction set avr2 (default) is for the classic AVR core with up 7920 to 8K program memory space (MCU types: at90s2313, at90s2323, 7921 attiny22, at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, 7922 at90s8515, at90c8534, at90s8535). 7923 7924 Instruction set avr3 is for the classic AVR core with up to 128K 7925 program memory space (MCU types: atmega103, atmega603, at43usb320, 7926 at76c711). 7927 7928 Instruction set avr4 is for the enhanced AVR core with up to 8K 7929 program memory space (MCU types: atmega8, atmega83, atmega85). 7930 7931 Instruction set avr5 is for the enhanced AVR core with up to 128K 7932 program memory space (MCU types: atmega16, atmega161, atmega163, 7933 atmega32, atmega323, atmega64, atmega128, at43usb355, at94k). 7934 7935`-msize' 7936 Output instruction sizes to the asm file. 7937 7938`-minit-stack=N' 7939 Specify the initial stack address, which may be a symbol or 7940 numeric value, `__stack' is the default. 7941 7942`-mno-interrupts' 7943 Generated code is not compatible with hardware interrupts. Code 7944 size will be smaller. 7945 7946`-mcall-prologues' 7947 Functions prologues/epilogues expanded as call to appropriate 7948 subroutines. Code size will be smaller. 7949 7950`-mno-tablejump' 7951 Do not generate tablejump insns which sometimes increase code size. 7952 7953`-mtiny-stack' 7954 Change only the low 8 bits of the stack pointer. 7955 7956`-mint8' 7957 Assume int to be 8 bit integer. This affects the sizes of all 7958 types: A char will be 1 byte, an int will be 1 byte, an long will 7959 be 2 bytes and long long will be 4 bytes. Please note that this 7960 option does not comply to the C standards, but it will provide you 7961 with smaller code size. 7962 7963 7964File: gcc.info, Node: Blackfin Options, Next: CRIS Options, Prev: AVR Options, Up: Submodel Options 7965 79663.17.4 Blackfin Options 7967----------------------- 7968 7969`-momit-leaf-frame-pointer' 7970 Don't keep the frame pointer in a register for leaf functions. 7971 This avoids the instructions to save, set up and restore frame 7972 pointers and makes an extra register available in leaf functions. 7973 The option `-fomit-frame-pointer' removes the frame pointer for 7974 all functions which might make debugging harder. 7975 7976`-mspecld-anomaly' 7977 When enabled, the compiler will ensure that the generated code 7978 does not contain speculative loads after jump instructions. This 7979 option is enabled by default. 7980 7981`-mno-specld-anomaly' 7982 Don't generate extra code to prevent speculative loads from 7983 occurring. 7984 7985`-mcsync-anomaly' 7986 When enabled, the compiler will ensure that the generated code 7987 does not contain CSYNC or SSYNC instructions too soon after 7988 conditional branches. This option is enabled by default. 7989 7990`-mno-csync-anomaly' 7991 Don't generate extra code to prevent CSYNC or SSYNC instructions 7992 from occurring too soon after a conditional branch. 7993 7994`-mlow-64k' 7995 When enabled, the compiler is free to take advantage of the 7996 knowledge that the entire program fits into the low 64k of memory. 7997 7998`-mno-low-64k' 7999 Assume that the program is arbitrarily large. This is the default. 8000 8001`-mid-shared-library' 8002 Generate code that supports shared libraries via the library ID 8003 method. This allows for execute in place and shared libraries in 8004 an environment without virtual memory management. This option 8005 implies `-fPIC'. 8006 8007`-mno-id-shared-library' 8008 Generate code that doesn't assume ID based shared libraries are 8009 being used. This is the default. 8010 8011`-mshared-library-id=n' 8012 Specified the identification number of the ID based shared library 8013 being compiled. Specifying a value of 0 will generate more 8014 compact code, specifying other values will force the allocation of 8015 that number to the current library but is no more space or time 8016 efficient than omitting this option. 8017 8018`-mlong-calls' 8019`-mno-long-calls' 8020 Tells the compiler to perform function calls by first loading the 8021 address of the function into a register and then performing a 8022 subroutine call on this register. This switch is needed if the 8023 target function will lie outside of the 24 bit addressing range of 8024 the offset based version of subroutine call instruction. 8025 8026 This feature is not enabled by default. Specifying 8027 `-mno-long-calls' will restore the default behavior. Note these 8028 switches have no effect on how the compiler generates code to 8029 handle function calls via function pointers. 8030 8031 8032File: gcc.info, Node: CRIS Options, Next: CRX Options, Prev: Blackfin Options, Up: Submodel Options 8033 80343.17.5 CRIS Options 8035------------------- 8036 8037These options are defined specifically for the CRIS ports. 8038 8039`-march=ARCHITECTURE-TYPE' 8040`-mcpu=ARCHITECTURE-TYPE' 8041 Generate code for the specified architecture. The choices for 8042 ARCHITECTURE-TYPE are `v3', `v8' and `v10' for respectively 8043 ETRAX 4, ETRAX 100, and ETRAX 100 LX. Default is `v0' except for 8044 cris-axis-linux-gnu, where the default is `v10'. 8045 8046`-mtune=ARCHITECTURE-TYPE' 8047 Tune to ARCHITECTURE-TYPE everything applicable about the generated 8048 code, except for the ABI and the set of available instructions. 8049 The choices for ARCHITECTURE-TYPE are the same as for 8050 `-march=ARCHITECTURE-TYPE'. 8051 8052`-mmax-stack-frame=N' 8053 Warn when the stack frame of a function exceeds N bytes. 8054 8055`-melinux-stacksize=N' 8056 Only available with the `cris-axis-aout' target. Arranges for 8057 indications in the program to the kernel loader that the stack of 8058 the program should be set to N bytes. 8059 8060`-metrax4' 8061`-metrax100' 8062 The options `-metrax4' and `-metrax100' are synonyms for 8063 `-march=v3' and `-march=v8' respectively. 8064 8065`-mmul-bug-workaround' 8066`-mno-mul-bug-workaround' 8067 Work around a bug in the `muls' and `mulu' instructions for CPU 8068 models where it applies. This option is active by default. 8069 8070`-mpdebug' 8071 Enable CRIS-specific verbose debug-related information in the 8072 assembly code. This option also has the effect to turn off the 8073 `#NO_APP' formatted-code indicator to the assembler at the 8074 beginning of the assembly file. 8075 8076`-mcc-init' 8077 Do not use condition-code results from previous instruction; 8078 always emit compare and test instructions before use of condition 8079 codes. 8080 8081`-mno-side-effects' 8082 Do not emit instructions with side-effects in addressing modes 8083 other than post-increment. 8084 8085`-mstack-align' 8086`-mno-stack-align' 8087`-mdata-align' 8088`-mno-data-align' 8089`-mconst-align' 8090`-mno-const-align' 8091 These options (no-options) arranges (eliminate arrangements) for 8092 the stack-frame, individual data and constants to be aligned for 8093 the maximum single data access size for the chosen CPU model. The 8094 default is to arrange for 32-bit alignment. ABI details such as 8095 structure layout are not affected by these options. 8096 8097`-m32-bit' 8098`-m16-bit' 8099`-m8-bit' 8100 Similar to the stack- data- and const-align options above, these 8101 options arrange for stack-frame, writable data and constants to 8102 all be 32-bit, 16-bit or 8-bit aligned. The default is 32-bit 8103 alignment. 8104 8105`-mno-prologue-epilogue' 8106`-mprologue-epilogue' 8107 With `-mno-prologue-epilogue', the normal function prologue and 8108 epilogue that sets up the stack-frame are omitted and no return 8109 instructions or return sequences are generated in the code. Use 8110 this option only together with visual inspection of the compiled 8111 code: no warnings or errors are generated when call-saved 8112 registers must be saved, or storage for local variable needs to be 8113 allocated. 8114 8115`-mno-gotplt' 8116`-mgotplt' 8117 With `-fpic' and `-fPIC', don't generate (do generate) instruction 8118 sequences that load addresses for functions from the PLT part of 8119 the GOT rather than (traditional on other architectures) calls to 8120 the PLT. The default is `-mgotplt'. 8121 8122`-maout' 8123 Legacy no-op option only recognized with the cris-axis-aout target. 8124 8125`-melf' 8126 Legacy no-op option only recognized with the cris-axis-elf and 8127 cris-axis-linux-gnu targets. 8128 8129`-melinux' 8130 Only recognized with the cris-axis-aout target, where it selects a 8131 GNU/linux-like multilib, include files and instruction set for 8132 `-march=v8'. 8133 8134`-mlinux' 8135 Legacy no-op option only recognized with the cris-axis-linux-gnu 8136 target. 8137 8138`-sim' 8139 This option, recognized for the cris-axis-aout and cris-axis-elf 8140 arranges to link with input-output functions from a simulator 8141 library. Code, initialized data and zero-initialized data are 8142 allocated consecutively. 8143 8144`-sim2' 8145 Like `-sim', but pass linker options to locate initialized data at 8146 0x40000000 and zero-initialized data at 0x80000000. 8147 8148 8149File: gcc.info, Node: CRX Options, Next: Darwin Options, Prev: CRIS Options, Up: Submodel Options 8150 81513.17.6 CRX Options 8152------------------ 8153 8154These options are defined specifically for the CRX ports. 8155 8156`-mmac' 8157 Enable the use of multiply-accumulate instructions. Disabled by 8158 default. 8159 8160`-mpush-args' 8161 Push instructions will be used to pass outgoing arguments when 8162 functions are called. Enabled by default. 8163 8164 8165File: gcc.info, Node: Darwin Options, Next: DEC Alpha Options, Prev: CRX Options, Up: Submodel Options 8166 81673.17.7 Darwin Options 8168--------------------- 8169 8170These options are defined for all architectures running the Darwin 8171operating system. 8172 8173 FSF GCC on Darwin does not create "fat" object files; it will create 8174an object file for the single architecture that it was built to target. 8175Apple's GCC on Darwin does create "fat" files if multiple `-arch' 8176options are used; it does so by running the compiler or linker multiple 8177times and joining the results together with `lipo'. 8178 8179 The subtype of the file created (like `ppc7400' or `ppc970' or `i686') 8180is determined by the flags that specify the ISA that GCC is targetting, 8181like `-mcpu' or `-march'. The `-force_cpusubtype_ALL' option can be 8182used to override this. 8183 8184 The Darwin tools vary in their behavior when presented with an ISA 8185mismatch. The assembler, `as', will only permit instructions to be 8186used that are valid for the subtype of the file it is generating, so 8187you cannot put 64-bit instructions in an `ppc750' object file. The 8188linker for shared libraries, `/usr/bin/libtool', will fail and print an 8189error if asked to create a shared library with a less restrictive 8190subtype than its input files (for instance, trying to put a `ppc970' 8191object file in a `ppc7400' library). The linker for executables, `ld', 8192will quietly give the executable the most restrictive subtype of any of 8193its input files. 8194 8195`-FDIR' 8196 Add the framework directory DIR to the head of the list of 8197 directories to be searched for header files. These directories are 8198 interleaved with those specified by `-I' options and are scanned 8199 in a left-to-right order. 8200 8201 A framework directory is a directory with frameworks in it. A 8202 framework is a directory with a `"Headers"' and/or 8203 `"PrivateHeaders"' directory contained directly in it that ends in 8204 `".framework"'. The name of a framework is the name of this 8205 directory excluding the `".framework"'. Headers associated with 8206 the framework are found in one of those two directories, with 8207 `"Headers"' being searched first. A subframework is a framework 8208 directory that is in a framework's `"Frameworks"' directory. 8209 Includes of subframework headers can only appear in a header of a 8210 framework that contains the subframework, or in a sibling 8211 subframework header. Two subframeworks are siblings if they occur 8212 in the same framework. A subframework should not have the same 8213 name as a framework, a warning will be issued if this is violated. 8214 Currently a subframework cannot have subframeworks, in the 8215 future, the mechanism may be extended to support this. The 8216 standard frameworks can be found in `"/System/Library/Frameworks"' 8217 and `"/Library/Frameworks"'. An example include looks like 8218 `#include <Framework/header.h>', where `Framework' denotes the 8219 name of the framework and header.h is found in the 8220 `"PrivateHeaders"' or `"Headers"' directory. 8221 8222`-gused' 8223 Emit debugging information for symbols that are used. For STABS 8224 debugging format, this enables `-feliminate-unused-debug-symbols'. 8225 This is by default ON. 8226 8227`-gfull' 8228 Emit debugging information for all symbols and types. 8229 8230`-mmacosx-version-min=VERSION' 8231 The earliest version of MacOS X that this executable will run on 8232 is VERSION. Typical values of VERSION include `10.1', `10.2', and 8233 `10.3.9'. 8234 8235 The default for this option is to make choices that seem to be most 8236 useful. 8237 8238`-mkernel' 8239 Enable kernel development mode. The `-mkernel' option sets 8240 `-static', `-fno-common', `-fno-cxa-atexit', `-fno-exceptions', 8241 `-fno-non-call-exceptions', `-fapple-kext', `-fno-weak' and 8242 `-fno-rtti' where applicable. This mode also sets `-mno-altivec', 8243 `-msoft-float', `-fno-builtin' and `-mlong-branch' for PowerPC 8244 targets. 8245 8246`-mone-byte-bool' 8247 Override the defaults for `bool' so that `sizeof(bool)==1'. By 8248 default `sizeof(bool)' is `4' when compiling for Darwin/PowerPC 8249 and `1' when compiling for Darwin/x86, so this option has no 8250 effect on x86. 8251 8252 *Warning:* The `-mone-byte-bool' switch causes GCC to generate 8253 code that is not binary compatible with code generated without 8254 that switch. Using this switch may require recompiling all other 8255 modules in a program, including system libraries. Use this switch 8256 to conform to a non-default data model. 8257 8258`-mfix-and-continue' 8259`-ffix-and-continue' 8260`-findirect-data' 8261 Generate code suitable for fast turn around development. Needed to 8262 enable gdb to dynamically load `.o' files into already running 8263 programs. `-findirect-data' and `-ffix-and-continue' are provided 8264 for backwards compatibility. 8265 8266`-all_load' 8267 Loads all members of static archive libraries. See man ld(1) for 8268 more information. 8269 8270`-arch_errors_fatal' 8271 Cause the errors having to do with files that have the wrong 8272 architecture to be fatal. 8273 8274`-bind_at_load' 8275 Causes the output file to be marked such that the dynamic linker 8276 will bind all undefined references when the file is loaded or 8277 launched. 8278 8279`-bundle' 8280 Produce a Mach-o bundle format file. See man ld(1) for more 8281 information. 8282 8283`-bundle_loader EXECUTABLE' 8284 This option specifies the EXECUTABLE that will be loading the build 8285 output file being linked. See man ld(1) for more information. 8286 8287`-dynamiclib' 8288 When passed this option, GCC will produce a dynamic library 8289 instead of an executable when linking, using the Darwin `libtool' 8290 command. 8291 8292`-force_cpusubtype_ALL' 8293 This causes GCC's output file to have the ALL subtype, instead of 8294 one controlled by the `-mcpu' or `-march' option. 8295 8296`-allowable_client CLIENT_NAME' 8297`-client_name' 8298`-compatibility_version' 8299`-current_version' 8300`-dead_strip' 8301`-dependency-file' 8302`-dylib_file' 8303`-dylinker_install_name' 8304`-dynamic' 8305`-exported_symbols_list' 8306`-filelist' 8307`-flat_namespace' 8308`-force_flat_namespace' 8309`-headerpad_max_install_names' 8310`-image_base' 8311`-init' 8312`-install_name' 8313`-keep_private_externs' 8314`-multi_module' 8315`-multiply_defined' 8316`-multiply_defined_unused' 8317`-noall_load' 8318`-no_dead_strip_inits_and_terms' 8319`-nofixprebinding' 8320`-nomultidefs' 8321`-noprebind' 8322`-noseglinkedit' 8323`-pagezero_size' 8324`-prebind' 8325`-prebind_all_twolevel_modules' 8326`-private_bundle' 8327`-read_only_relocs' 8328`-sectalign' 8329`-sectobjectsymbols' 8330`-whyload' 8331`-seg1addr' 8332`-sectcreate' 8333`-sectobjectsymbols' 8334`-sectorder' 8335`-segaddr' 8336`-segs_read_only_addr' 8337`-segs_read_write_addr' 8338`-seg_addr_table' 8339`-seg_addr_table_filename' 8340`-seglinkedit' 8341`-segprot' 8342`-segs_read_only_addr' 8343`-segs_read_write_addr' 8344`-single_module' 8345`-static' 8346`-sub_library' 8347`-sub_umbrella' 8348`-twolevel_namespace' 8349`-umbrella' 8350`-undefined' 8351`-unexported_symbols_list' 8352`-weak_reference_mismatches' 8353`-whatsloaded' 8354 These options are passed to the Darwin linker. The Darwin linker 8355 man page describes them in detail. 8356 8357 8358File: gcc.info, Node: DEC Alpha Options, Next: DEC Alpha/VMS Options, Prev: Darwin Options, Up: Submodel Options 8359 83603.17.8 DEC Alpha Options 8361------------------------ 8362 8363These `-m' options are defined for the DEC Alpha implementations: 8364 8365`-mno-soft-float' 8366`-msoft-float' 8367 Use (do not use) the hardware floating-point instructions for 8368 floating-point operations. When `-msoft-float' is specified, 8369 functions in `libgcc.a' will be used to perform floating-point 8370 operations. Unless they are replaced by routines that emulate the 8371 floating-point operations, or compiled in such a way as to call 8372 such emulations routines, these routines will issue floating-point 8373 operations. If you are compiling for an Alpha without 8374 floating-point operations, you must ensure that the library is 8375 built so as not to call them. 8376 8377 Note that Alpha implementations without floating-point operations 8378 are required to have floating-point registers. 8379 8380`-mfp-reg' 8381`-mno-fp-regs' 8382 Generate code that uses (does not use) the floating-point register 8383 set. `-mno-fp-regs' implies `-msoft-float'. If the floating-point 8384 register set is not used, floating point operands are passed in 8385 integer registers as if they were integers and floating-point 8386 results are passed in `$0' instead of `$f0'. This is a 8387 non-standard calling sequence, so any function with a 8388 floating-point argument or return value called by code compiled 8389 with `-mno-fp-regs' must also be compiled with that option. 8390 8391 A typical use of this option is building a kernel that does not 8392 use, and hence need not save and restore, any floating-point 8393 registers. 8394 8395`-mieee' 8396 The Alpha architecture implements floating-point hardware 8397 optimized for maximum performance. It is mostly compliant with 8398 the IEEE floating point standard. However, for full compliance, 8399 software assistance is required. This option generates code fully 8400 IEEE compliant code _except_ that the INEXACT-FLAG is not 8401 maintained (see below). If this option is turned on, the 8402 preprocessor macro `_IEEE_FP' is defined during compilation. The 8403 resulting code is less efficient but is able to correctly support 8404 denormalized numbers and exceptional IEEE values such as 8405 not-a-number and plus/minus infinity. Other Alpha compilers call 8406 this option `-ieee_with_no_inexact'. 8407 8408`-mieee-with-inexact' 8409 This is like `-mieee' except the generated code also maintains the 8410 IEEE INEXACT-FLAG. Turning on this option causes the generated 8411 code to implement fully-compliant IEEE math. In addition to 8412 `_IEEE_FP', `_IEEE_FP_EXACT' is defined as a preprocessor macro. 8413 On some Alpha implementations the resulting code may execute 8414 significantly slower than the code generated by default. Since 8415 there is very little code that depends on the INEXACT-FLAG, you 8416 should normally not specify this option. Other Alpha compilers 8417 call this option `-ieee_with_inexact'. 8418 8419`-mfp-trap-mode=TRAP-MODE' 8420 This option controls what floating-point related traps are enabled. 8421 Other Alpha compilers call this option `-fptm TRAP-MODE'. The 8422 trap mode can be set to one of four values: 8423 8424 `n' 8425 This is the default (normal) setting. The only traps that 8426 are enabled are the ones that cannot be disabled in software 8427 (e.g., division by zero trap). 8428 8429 `u' 8430 In addition to the traps enabled by `n', underflow traps are 8431 enabled as well. 8432 8433 `su' 8434 Like `u', but the instructions are marked to be safe for 8435 software completion (see Alpha architecture manual for 8436 details). 8437 8438 `sui' 8439 Like `su', but inexact traps are enabled as well. 8440 8441`-mfp-rounding-mode=ROUNDING-MODE' 8442 Selects the IEEE rounding mode. Other Alpha compilers call this 8443 option `-fprm ROUNDING-MODE'. The ROUNDING-MODE can be one of: 8444 8445 `n' 8446 Normal IEEE rounding mode. Floating point numbers are 8447 rounded towards the nearest machine number or towards the 8448 even machine number in case of a tie. 8449 8450 `m' 8451 Round towards minus infinity. 8452 8453 `c' 8454 Chopped rounding mode. Floating point numbers are rounded 8455 towards zero. 8456 8457 `d' 8458 Dynamic rounding mode. A field in the floating point control 8459 register (FPCR, see Alpha architecture reference manual) 8460 controls the rounding mode in effect. The C library 8461 initializes this register for rounding towards plus infinity. 8462 Thus, unless your program modifies the FPCR, `d' corresponds 8463 to round towards plus infinity. 8464 8465`-mtrap-precision=TRAP-PRECISION' 8466 In the Alpha architecture, floating point traps are imprecise. 8467 This means without software assistance it is impossible to recover 8468 from a floating trap and program execution normally needs to be 8469 terminated. GCC can generate code that can assist operating 8470 system trap handlers in determining the exact location that caused 8471 a floating point trap. Depending on the requirements of an 8472 application, different levels of precisions can be selected: 8473 8474 `p' 8475 Program precision. This option is the default and means a 8476 trap handler can only identify which program caused a 8477 floating point exception. 8478 8479 `f' 8480 Function precision. The trap handler can determine the 8481 function that caused a floating point exception. 8482 8483 `i' 8484 Instruction precision. The trap handler can determine the 8485 exact instruction that caused a floating point exception. 8486 8487 Other Alpha compilers provide the equivalent options called 8488 `-scope_safe' and `-resumption_safe'. 8489 8490`-mieee-conformant' 8491 This option marks the generated code as IEEE conformant. You must 8492 not use this option unless you also specify `-mtrap-precision=i' 8493 and either `-mfp-trap-mode=su' or `-mfp-trap-mode=sui'. Its only 8494 effect is to emit the line `.eflag 48' in the function prologue of 8495 the generated assembly file. Under DEC Unix, this has the effect 8496 that IEEE-conformant math library routines will be linked in. 8497 8498`-mbuild-constants' 8499 Normally GCC examines a 32- or 64-bit integer constant to see if 8500 it can construct it from smaller constants in two or three 8501 instructions. If it cannot, it will output the constant as a 8502 literal and generate code to load it from the data segment at 8503 runtime. 8504 8505 Use this option to require GCC to construct _all_ integer constants 8506 using code, even if it takes more instructions (the maximum is 8507 six). 8508 8509 You would typically use this option to build a shared library 8510 dynamic loader. Itself a shared library, it must relocate itself 8511 in memory before it can find the variables and constants in its 8512 own data segment. 8513 8514`-malpha-as' 8515`-mgas' 8516 Select whether to generate code to be assembled by the 8517 vendor-supplied assembler (`-malpha-as') or by the GNU assembler 8518 `-mgas'. 8519 8520`-mbwx' 8521`-mno-bwx' 8522`-mcix' 8523`-mno-cix' 8524`-mfix' 8525`-mno-fix' 8526`-mmax' 8527`-mno-max' 8528 Indicate whether GCC should generate code to use the optional BWX, 8529 CIX, FIX and MAX instruction sets. The default is to use the 8530 instruction sets supported by the CPU type specified via `-mcpu=' 8531 option or that of the CPU on which GCC was built if none was 8532 specified. 8533 8534`-mfloat-vax' 8535`-mfloat-ieee' 8536 Generate code that uses (does not use) VAX F and G floating point 8537 arithmetic instead of IEEE single and double precision. 8538 8539`-mexplicit-relocs' 8540`-mno-explicit-relocs' 8541 Older Alpha assemblers provided no way to generate symbol 8542 relocations except via assembler macros. Use of these macros does 8543 not allow optimal instruction scheduling. GNU binutils as of 8544 version 2.12 supports a new syntax that allows the compiler to 8545 explicitly mark which relocations should apply to which 8546 instructions. This option is mostly useful for debugging, as GCC 8547 detects the capabilities of the assembler when it is built and 8548 sets the default accordingly. 8549 8550`-msmall-data' 8551`-mlarge-data' 8552 When `-mexplicit-relocs' is in effect, static data is accessed via 8553 "gp-relative" relocations. When `-msmall-data' is used, objects 8 8554 bytes long or smaller are placed in a "small data area" (the 8555 `.sdata' and `.sbss' sections) and are accessed via 16-bit 8556 relocations off of the `$gp' register. This limits the size of 8557 the small data area to 64KB, but allows the variables to be 8558 directly accessed via a single instruction. 8559 8560 The default is `-mlarge-data'. With this option the data area is 8561 limited to just below 2GB. Programs that require more than 2GB of 8562 data must use `malloc' or `mmap' to allocate the data in the heap 8563 instead of in the program's data segment. 8564 8565 When generating code for shared libraries, `-fpic' implies 8566 `-msmall-data' and `-fPIC' implies `-mlarge-data'. 8567 8568`-msmall-text' 8569`-mlarge-text' 8570 When `-msmall-text' is used, the compiler assumes that the code of 8571 the entire program (or shared library) fits in 4MB, and is thus 8572 reachable with a branch instruction. When `-msmall-data' is used, 8573 the compiler can assume that all local symbols share the same 8574 `$gp' value, and thus reduce the number of instructions required 8575 for a function call from 4 to 1. 8576 8577 The default is `-mlarge-text'. 8578 8579`-mcpu=CPU_TYPE' 8580 Set the instruction set and instruction scheduling parameters for 8581 machine type CPU_TYPE. You can specify either the `EV' style name 8582 or the corresponding chip number. GCC supports scheduling 8583 parameters for the EV4, EV5 and EV6 family of processors and will 8584 choose the default values for the instruction set from the 8585 processor you specify. If you do not specify a processor type, 8586 GCC will default to the processor on which the compiler was built. 8587 8588 Supported values for CPU_TYPE are 8589 8590 `ev4' 8591 `ev45' 8592 `21064' 8593 Schedules as an EV4 and has no instruction set extensions. 8594 8595 `ev5' 8596 `21164' 8597 Schedules as an EV5 and has no instruction set extensions. 8598 8599 `ev56' 8600 `21164a' 8601 Schedules as an EV5 and supports the BWX extension. 8602 8603 `pca56' 8604 `21164pc' 8605 `21164PC' 8606 Schedules as an EV5 and supports the BWX and MAX extensions. 8607 8608 `ev6' 8609 `21264' 8610 Schedules as an EV6 and supports the BWX, FIX, and MAX 8611 extensions. 8612 8613 `ev67' 8614 `21264a' 8615 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX 8616 extensions. 8617 8618`-mtune=CPU_TYPE' 8619 Set only the instruction scheduling parameters for machine type 8620 CPU_TYPE. The instruction set is not changed. 8621 8622`-mmemory-latency=TIME' 8623 Sets the latency the scheduler should assume for typical memory 8624 references as seen by the application. This number is highly 8625 dependent on the memory access patterns used by the application 8626 and the size of the external cache on the machine. 8627 8628 Valid options for TIME are 8629 8630 `NUMBER' 8631 A decimal number representing clock cycles. 8632 8633 `L1' 8634 `L2' 8635 `L3' 8636 `main' 8637 The compiler contains estimates of the number of clock cycles 8638 for "typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches 8639 (also called Dcache, Scache, and Bcache), as well as to main 8640 memory. Note that L3 is only valid for EV5. 8641 8642 8643 8644File: gcc.info, Node: DEC Alpha/VMS Options, Next: FRV Options, Prev: DEC Alpha Options, Up: Submodel Options 8645 86463.17.9 DEC Alpha/VMS Options 8647---------------------------- 8648 8649These `-m' options are defined for the DEC Alpha/VMS implementations: 8650 8651`-mvms-return-codes' 8652 Return VMS condition codes from main. The default is to return 8653 POSIX style condition (e.g. error) codes. 8654 8655 8656File: gcc.info, Node: FRV Options, Next: GNU/Linux Options, Prev: DEC Alpha/VMS Options, Up: Submodel Options 8657 86583.17.10 FRV Options 8659------------------- 8660 8661`-mgpr-32' 8662 Only use the first 32 general purpose registers. 8663 8664`-mgpr-64' 8665 Use all 64 general purpose registers. 8666 8667`-mfpr-32' 8668 Use only the first 32 floating point registers. 8669 8670`-mfpr-64' 8671 Use all 64 floating point registers 8672 8673`-mhard-float' 8674 Use hardware instructions for floating point operations. 8675 8676`-msoft-float' 8677 Use library routines for floating point operations. 8678 8679`-malloc-cc' 8680 Dynamically allocate condition code registers. 8681 8682`-mfixed-cc' 8683 Do not try to dynamically allocate condition code registers, only 8684 use `icc0' and `fcc0'. 8685 8686`-mdword' 8687 Change ABI to use double word insns. 8688 8689`-mno-dword' 8690 Do not use double word instructions. 8691 8692`-mdouble' 8693 Use floating point double instructions. 8694 8695`-mno-double' 8696 Do not use floating point double instructions. 8697 8698`-mmedia' 8699 Use media instructions. 8700 8701`-mno-media' 8702 Do not use media instructions. 8703 8704`-mmuladd' 8705 Use multiply and add/subtract instructions. 8706 8707`-mno-muladd' 8708 Do not use multiply and add/subtract instructions. 8709 8710`-mfdpic' 8711 Select the FDPIC ABI, that uses function descriptors to represent 8712 pointers to functions. Without any PIC/PIE-related options, it 8713 implies `-fPIE'. With `-fpic' or `-fpie', it assumes GOT entries 8714 and small data are within a 12-bit range from the GOT base 8715 address; with `-fPIC' or `-fPIE', GOT offsets are computed with 32 8716 bits. 8717 8718`-minline-plt' 8719 Enable inlining of PLT entries in function calls to functions that 8720 are not known to bind locally. It has no effect without `-mfdpic'. 8721 It's enabled by default if optimizing for speed and compiling for 8722 shared libraries (i.e., `-fPIC' or `-fpic'), or when an 8723 optimization option such as `-O3' or above is present in the 8724 command line. 8725 8726`-mTLS' 8727 Assume a large TLS segment when generating thread-local code. 8728 8729`-mtls' 8730 Do not assume a large TLS segment when generating thread-local 8731 code. 8732 8733`-mgprel-ro' 8734 Enable the use of `GPREL' relocations in the FDPIC ABI for data 8735 that is known to be in read-only sections. It's enabled by 8736 default, except for `-fpic' or `-fpie': even though it may help 8737 make the global offset table smaller, it trades 1 instruction for 8738 4. With `-fPIC' or `-fPIE', it trades 3 instructions for 4, one 8739 of which may be shared by multiple symbols, and it avoids the need 8740 for a GOT entry for the referenced symbol, so it's more likely to 8741 be a win. If it is not, `-mno-gprel-ro' can be used to disable it. 8742 8743`-multilib-library-pic' 8744 Link with the (library, not FD) pic libraries. It's implied by 8745 `-mlibrary-pic', as well as by `-fPIC' and `-fpic' without 8746 `-mfdpic'. You should never have to use it explicitly. 8747 8748`-mlinked-fp' 8749 Follow the EABI requirement of always creating a frame pointer 8750 whenever a stack frame is allocated. This option is enabled by 8751 default and can be disabled with `-mno-linked-fp'. 8752 8753`-mlong-calls' 8754 Use indirect addressing to call functions outside the current 8755 compilation unit. This allows the functions to be placed anywhere 8756 within the 32-bit address space. 8757 8758`-malign-labels' 8759 Try to align labels to an 8-byte boundary by inserting nops into 8760 the previous packet. This option only has an effect when VLIW 8761 packing is enabled. It doesn't create new packets; it merely adds 8762 nops to existing ones. 8763 8764`-mlibrary-pic' 8765 Generate position-independent EABI code. 8766 8767`-macc-4' 8768 Use only the first four media accumulator registers. 8769 8770`-macc-8' 8771 Use all eight media accumulator registers. 8772 8773`-mpack' 8774 Pack VLIW instructions. 8775 8776`-mno-pack' 8777 Do not pack VLIW instructions. 8778 8779`-mno-eflags' 8780 Do not mark ABI switches in e_flags. 8781 8782`-mcond-move' 8783 Enable the use of conditional-move instructions (default). 8784 8785 This switch is mainly for debugging the compiler and will likely 8786 be removed in a future version. 8787 8788`-mno-cond-move' 8789 Disable the use of conditional-move instructions. 8790 8791 This switch is mainly for debugging the compiler and will likely 8792 be removed in a future version. 8793 8794`-mscc' 8795 Enable the use of conditional set instructions (default). 8796 8797 This switch is mainly for debugging the compiler and will likely 8798 be removed in a future version. 8799 8800`-mno-scc' 8801 Disable the use of conditional set instructions. 8802 8803 This switch is mainly for debugging the compiler and will likely 8804 be removed in a future version. 8805 8806`-mcond-exec' 8807 Enable the use of conditional execution (default). 8808 8809 This switch is mainly for debugging the compiler and will likely 8810 be removed in a future version. 8811 8812`-mno-cond-exec' 8813 Disable the use of conditional execution. 8814 8815 This switch is mainly for debugging the compiler and will likely 8816 be removed in a future version. 8817 8818`-mvliw-branch' 8819 Run a pass to pack branches into VLIW instructions (default). 8820 8821 This switch is mainly for debugging the compiler and will likely 8822 be removed in a future version. 8823 8824`-mno-vliw-branch' 8825 Do not run a pass to pack branches into VLIW instructions. 8826 8827 This switch is mainly for debugging the compiler and will likely 8828 be removed in a future version. 8829 8830`-mmulti-cond-exec' 8831 Enable optimization of `&&' and `||' in conditional execution 8832 (default). 8833 8834 This switch is mainly for debugging the compiler and will likely 8835 be removed in a future version. 8836 8837`-mno-multi-cond-exec' 8838 Disable optimization of `&&' and `||' in conditional execution. 8839 8840 This switch is mainly for debugging the compiler and will likely 8841 be removed in a future version. 8842 8843`-mnested-cond-exec' 8844 Enable nested conditional execution optimizations (default). 8845 8846 This switch is mainly for debugging the compiler and will likely 8847 be removed in a future version. 8848 8849`-mno-nested-cond-exec' 8850 Disable nested conditional execution optimizations. 8851 8852 This switch is mainly for debugging the compiler and will likely 8853 be removed in a future version. 8854 8855`-moptimize-membar' 8856 This switch removes redundant `membar' instructions from the 8857 compiler generated code. It is enabled by default. 8858 8859`-mno-optimize-membar' 8860 This switch disables the automatic removal of redundant `membar' 8861 instructions from the generated code. 8862 8863`-mtomcat-stats' 8864 Cause gas to print out tomcat statistics. 8865 8866`-mcpu=CPU' 8867 Select the processor type for which to generate code. Possible 8868 values are `frv', `fr550', `tomcat', `fr500', `fr450', `fr405', 8869 `fr400', `fr300' and `simple'. 8870 8871 8872 8873File: gcc.info, Node: GNU/Linux Options, Next: H8/300 Options, Prev: FRV Options, Up: Submodel Options 8874 88753.17.11 GNU/Linux Options 8876------------------------- 8877 8878These `-m' options are defined for GNU/Linux targets: 8879 8880`-mglibc' 8881 Use the GNU C library instead of uClibc. This is the default 8882 except on `*-*-linux-*uclibc*' targets. 8883 8884`-muclibc' 8885 Use uClibc instead of the GNU C library. This is the default on 8886 `*-*-linux-*uclibc*' targets. 8887 8888 8889File: gcc.info, Node: H8/300 Options, Next: HPPA Options, Prev: GNU/Linux Options, Up: Submodel Options 8890 88913.17.12 H8/300 Options 8892---------------------- 8893 8894These `-m' options are defined for the H8/300 implementations: 8895 8896`-mrelax' 8897 Shorten some address references at link time, when possible; uses 8898 the linker option `-relax'. *Note `ld' and the H8/300: 8899 (ld)H8/300, for a fuller description. 8900 8901`-mh' 8902 Generate code for the H8/300H. 8903 8904`-ms' 8905 Generate code for the H8S. 8906 8907`-mn' 8908 Generate code for the H8S and H8/300H in the normal mode. This 8909 switch must be used either with `-mh' or `-ms'. 8910 8911`-ms2600' 8912 Generate code for the H8S/2600. This switch must be used with 8913 `-ms'. 8914 8915`-mint32' 8916 Make `int' data 32 bits by default. 8917 8918`-malign-300' 8919 On the H8/300H and H8S, use the same alignment rules as for the 8920 H8/300. The default for the H8/300H and H8S is to align longs and 8921 floats on 4 byte boundaries. `-malign-300' causes them to be 8922 aligned on 2 byte boundaries. This option has no effect on the 8923 H8/300. 8924 8925 8926File: gcc.info, Node: HPPA Options, Next: i386 and x86-64 Options, Prev: H8/300 Options, Up: Submodel Options 8927 89283.17.13 HPPA Options 8929-------------------- 8930 8931These `-m' options are defined for the HPPA family of computers: 8932 8933`-march=ARCHITECTURE-TYPE' 8934 Generate code for the specified architecture. The choices for 8935 ARCHITECTURE-TYPE are `1.0' for PA 1.0, `1.1' for PA 1.1, and 8936 `2.0' for PA 2.0 processors. Refer to `/usr/lib/sched.models' on 8937 an HP-UX system to determine the proper architecture option for 8938 your machine. Code compiled for lower numbered architectures will 8939 run on higher numbered architectures, but not the other way around. 8940 8941`-mpa-risc-1-0' 8942`-mpa-risc-1-1' 8943`-mpa-risc-2-0' 8944 Synonyms for `-march=1.0', `-march=1.1', and `-march=2.0' 8945 respectively. 8946 8947`-mbig-switch' 8948 Generate code suitable for big switch tables. Use this option 8949 only if the assembler/linker complain about out of range branches 8950 within a switch table. 8951 8952`-mjump-in-delay' 8953 Fill delay slots of function calls with unconditional jump 8954 instructions by modifying the return pointer for the function call 8955 to be the target of the conditional jump. 8956 8957`-mdisable-fpregs' 8958 Prevent floating point registers from being used in any manner. 8959 This is necessary for compiling kernels which perform lazy context 8960 switching of floating point registers. If you use this option and 8961 attempt to perform floating point operations, the compiler will 8962 abort. 8963 8964`-mdisable-indexing' 8965 Prevent the compiler from using indexing address modes. This 8966 avoids some rather obscure problems when compiling MIG generated 8967 code under MACH. 8968 8969`-mno-space-regs' 8970 Generate code that assumes the target has no space registers. 8971 This allows GCC to generate faster indirect calls and use unscaled 8972 index address modes. 8973 8974 Such code is suitable for level 0 PA systems and kernels. 8975 8976`-mfast-indirect-calls' 8977 Generate code that assumes calls never cross space boundaries. 8978 This allows GCC to emit code which performs faster indirect calls. 8979 8980 This option will not work in the presence of shared libraries or 8981 nested functions. 8982 8983`-mfixed-range=REGISTER-RANGE' 8984 Generate code treating the given register range as fixed registers. 8985 A fixed register is one that the register allocator can not use. 8986 This is useful when compiling kernel code. A register range is 8987 specified as two registers separated by a dash. Multiple register 8988 ranges can be specified separated by a comma. 8989 8990`-mlong-load-store' 8991 Generate 3-instruction load and store sequences as sometimes 8992 required by the HP-UX 10 linker. This is equivalent to the `+k' 8993 option to the HP compilers. 8994 8995`-mportable-runtime' 8996 Use the portable calling conventions proposed by HP for ELF 8997 systems. 8998 8999`-mgas' 9000 Enable the use of assembler directives only GAS understands. 9001 9002`-mschedule=CPU-TYPE' 9003 Schedule code according to the constraints for the machine type 9004 CPU-TYPE. The choices for CPU-TYPE are `700' `7100', `7100LC', 9005 `7200', `7300' and `8000'. Refer to `/usr/lib/sched.models' on an 9006 HP-UX system to determine the proper scheduling option for your 9007 machine. The default scheduling is `8000'. 9008 9009`-mlinker-opt' 9010 Enable the optimization pass in the HP-UX linker. Note this makes 9011 symbolic debugging impossible. It also triggers a bug in the 9012 HP-UX 8 and HP-UX 9 linkers in which they give bogus error 9013 messages when linking some programs. 9014 9015`-msoft-float' 9016 Generate output containing library calls for floating point. 9017 *Warning:* the requisite libraries are not available for all HPPA 9018 targets. Normally the facilities of the machine's usual C 9019 compiler are used, but this cannot be done directly in 9020 cross-compilation. You must make your own arrangements to provide 9021 suitable library functions for cross-compilation. The embedded 9022 target `hppa1.1-*-pro' does provide software floating point 9023 support. 9024 9025 `-msoft-float' changes the calling convention in the output file; 9026 therefore, it is only useful if you compile _all_ of a program with 9027 this option. In particular, you need to compile `libgcc.a', the 9028 library that comes with GCC, with `-msoft-float' in order for this 9029 to work. 9030 9031`-msio' 9032 Generate the predefine, `_SIO', for server IO. The default is 9033 `-mwsio'. This generates the predefines, `__hp9000s700', 9034 `__hp9000s700__' and `_WSIO', for workstation IO. These options 9035 are available under HP-UX and HI-UX. 9036 9037`-mgnu-ld' 9038 Use GNU ld specific options. This passes `-shared' to ld when 9039 building a shared library. It is the default when GCC is 9040 configured, explicitly or implicitly, with the GNU linker. This 9041 option does not have any affect on which ld is called, it only 9042 changes what parameters are passed to that ld. The ld that is 9043 called is determined by the `--with-ld' configure option, GCC's 9044 program search path, and finally by the user's `PATH'. The linker 9045 used by GCC can be printed using `which `gcc 9046 -print-prog-name=ld`'. This option is only available on the 64 9047 bit HP-UX GCC, i.e. configured with `hppa*64*-*-hpux*'. 9048 9049`-mhp-ld' 9050 Use HP ld specific options. This passes `-b' to ld when building 9051 a shared library and passes `+Accept TypeMismatch' to ld on all 9052 links. It is the default when GCC is configured, explicitly or 9053 implicitly, with the HP linker. This option does not have any 9054 affect on which ld is called, it only changes what parameters are 9055 passed to that ld. The ld that is called is determined by the 9056 `--with-ld' configure option, GCC's program search path, and 9057 finally by the user's `PATH'. The linker used by GCC can be 9058 printed using `which `gcc -print-prog-name=ld`'. This option is 9059 only available on the 64 bit HP-UX GCC, i.e. configured with 9060 `hppa*64*-*-hpux*'. 9061 9062`-mlong-calls' 9063 Generate code that uses long call sequences. This ensures that a 9064 call is always able to reach linker generated stubs. The default 9065 is to generate long calls only when the distance from the call 9066 site to the beginning of the function or translation unit, as the 9067 case may be, exceeds a predefined limit set by the branch type 9068 being used. The limits for normal calls are 7,600,000 and 240,000 9069 bytes, respectively for the PA 2.0 and PA 1.X architectures. 9070 Sibcalls are always limited at 240,000 bytes. 9071 9072 Distances are measured from the beginning of functions when using 9073 the `-ffunction-sections' option, or when using the `-mgas' and 9074 `-mno-portable-runtime' options together under HP-UX with the SOM 9075 linker. 9076 9077 It is normally not desirable to use this option as it will degrade 9078 performance. However, it may be useful in large applications, 9079 particularly when partial linking is used to build the application. 9080 9081 The types of long calls used depends on the capabilities of the 9082 assembler and linker, and the type of code being generated. The 9083 impact on systems that support long absolute calls, and long pic 9084 symbol-difference or pc-relative calls should be relatively small. 9085 However, an indirect call is used on 32-bit ELF systems in pic code 9086 and it is quite long. 9087 9088`-munix=UNIX-STD' 9089 Generate compiler predefines and select a startfile for the 9090 specified UNIX standard. The choices for UNIX-STD are `93', `95' 9091 and `98'. `93' is supported on all HP-UX versions. `95' is 9092 available on HP-UX 10.10 and later. `98' is available on HP-UX 9093 11.11 and later. The default values are `93' for HP-UX 10.00, 9094 `95' for HP-UX 10.10 though to 11.00, and `98' for HP-UX 11.11 and 9095 later. 9096 9097 `-munix=93' provides the same predefines as GCC 3.3 and 3.4. 9098 `-munix=95' provides additional predefines for `XOPEN_UNIX' and 9099 `_XOPEN_SOURCE_EXTENDED', and the startfile `unix95.o'. 9100 `-munix=98' provides additional predefines for `_XOPEN_UNIX', 9101 `_XOPEN_SOURCE_EXTENDED', `_INCLUDE__STDC_A1_SOURCE' and 9102 `_INCLUDE_XOPEN_SOURCE_500', and the startfile `unix98.o'. 9103 9104 It is _important_ to note that this option changes the interfaces 9105 for various library routines. It also affects the operational 9106 behavior of the C library. Thus, _extreme_ care is needed in 9107 using this option. 9108 9109 Library code that is intended to operate with more than one UNIX 9110 standard must test, set and restore the variable 9111 __XPG4_EXTENDED_MASK as appropriate. Most GNU software doesn't 9112 provide this capability. 9113 9114`-nolibdld' 9115 Suppress the generation of link options to search libdld.sl when 9116 the `-static' option is specified on HP-UX 10 and later. 9117 9118`-static' 9119 The HP-UX implementation of setlocale in libc has a dependency on 9120 libdld.sl. There isn't an archive version of libdld.sl. Thus, 9121 when the `-static' option is specified, special link options are 9122 needed to resolve this dependency. 9123 9124 On HP-UX 10 and later, the GCC driver adds the necessary options to 9125 link with libdld.sl when the `-static' option is specified. This 9126 causes the resulting binary to be dynamic. On the 64-bit port, 9127 the linkers generate dynamic binaries by default in any case. The 9128 `-nolibdld' option can be used to prevent the GCC driver from 9129 adding these link options. 9130 9131`-threads' 9132 Add support for multithreading with the "dce thread" library under 9133 HP-UX. This option sets flags for both the preprocessor and 9134 linker. 9135 9136 9137File: gcc.info, Node: i386 and x86-64 Options, Next: IA-64 Options, Prev: HPPA Options, Up: Submodel Options 9138 91393.17.14 Intel 386 and AMD x86-64 Options 9140---------------------------------------- 9141 9142These `-m' options are defined for the i386 and x86-64 family of 9143computers: 9144 9145`-mtune=CPU-TYPE' 9146 Tune to CPU-TYPE everything applicable about the generated code, 9147 except for the ABI and the set of available instructions. The 9148 choices for CPU-TYPE are: 9149 _generic_ 9150 Produce code optimized for the most common IA32/AMD64/EM64T 9151 processors. If you know the CPU on which your code will run, 9152 then you should use the corresponding `-mtune' option instead 9153 of `-mtune=generic'. But, if you do not know exactly what 9154 CPU users of your application will have, then you should use 9155 this option. 9156 9157 As new processors are deployed in the marketplace, the 9158 behavior of this option will change. Therefore, if you 9159 upgrade to a newer version of GCC, the code generated option 9160 will change to reflect the processors that were most common 9161 when that version of GCC was released. 9162 9163 There is no `-march=generic' option because `-march' 9164 indicates the instruction set the compiler can use, and there 9165 is no generic instruction set applicable to all processors. 9166 In contrast, `-mtune' indicates the processor (or, in this 9167 case, collection of processors) for which the code is 9168 optimized. 9169 9170 _native_ 9171 This selects the CPU to tune for at compilation time by 9172 determining the processor type of the compiling machine. 9173 Using `-mtune=native' will produce code optimized for the 9174 local machine under the constraints of the selected 9175 instruction set. Using `-march=native' will enable all 9176 instruction subsets supported by the local machine (hence the 9177 result might not run on different machines). 9178 9179 _i386_ 9180 Original Intel's i386 CPU. 9181 9182 _i486_ 9183 Intel's i486 CPU. (No scheduling is implemented for this 9184 chip.) 9185 9186 _i586, pentium_ 9187 Intel Pentium CPU with no MMX support. 9188 9189 _pentium-mmx_ 9190 Intel PentiumMMX CPU based on Pentium core with MMX 9191 instruction set support. 9192 9193 _pentiumpro_ 9194 Intel PentiumPro CPU. 9195 9196 _i686_ 9197 Same as `generic', but when used as `march' option, PentiumPro 9198 instruction set will be used, so the code will run on all 9199 i686 family chips. 9200 9201 _pentium2_ 9202 Intel Pentium2 CPU based on PentiumPro core with MMX 9203 instruction set support. 9204 9205 _pentium3, pentium3m_ 9206 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE 9207 instruction set support. 9208 9209 _pentium-m_ 9210 Low power version of Intel Pentium3 CPU with MMX, SSE and 9211 SSE2 instruction set support. Used by Centrino notebooks. 9212 9213 _pentium4, pentium4m_ 9214 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set 9215 support. 9216 9217 _prescott_ 9218 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 9219 and SSE3 instruction set support. 9220 9221 _nocona_ 9222 Improved version of Intel Pentium4 CPU with 64-bit 9223 extensions, MMX, SSE, SSE2 and SSE3 instruction set support. 9224 9225 _k6_ 9226 AMD K6 CPU with MMX instruction set support. 9227 9228 _k6-2, k6-3_ 9229 Improved versions of AMD K6 CPU with MMX and 3dNOW! 9230 instruction set support. 9231 9232 _athlon, athlon-tbird_ 9233 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE 9234 prefetch instructions support. 9235 9236 _athlon-4, athlon-xp, athlon-mp_ 9237 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and 9238 full SSE instruction set support. 9239 9240 _k8, opteron, athlon64, athlon-fx_ 9241 AMD K8 core based CPUs with x86-64 instruction set support. 9242 (This supersets MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 9243 64-bit instruction set extensions.) 9244 9245 _winchip-c6_ 9246 IDT Winchip C6 CPU, dealt in same way as i486 with additional 9247 MMX instruction set support. 9248 9249 _winchip2_ 9250 IDT Winchip2 CPU, dealt in same way as i486 with additional 9251 MMX and 3dNOW! instruction set support. 9252 9253 _c3_ 9254 Via C3 CPU with MMX and 3dNOW! instruction set support. (No 9255 scheduling is implemented for this chip.) 9256 9257 _c3-2_ 9258 Via C3-2 CPU with MMX and SSE instruction set support. (No 9259 scheduling is implemented for this chip.) 9260 9261 While picking a specific CPU-TYPE will schedule things 9262 appropriately for that particular chip, the compiler will not 9263 generate any code that does not run on the i386 without the 9264 `-march=CPU-TYPE' option being used. 9265 9266`-march=CPU-TYPE' 9267 Generate instructions for the machine type CPU-TYPE. The choices 9268 for CPU-TYPE are the same as for `-mtune'. Moreover, specifying 9269 `-march=CPU-TYPE' implies `-mtune=CPU-TYPE'. 9270 9271`-mcpu=CPU-TYPE' 9272 A deprecated synonym for `-mtune'. 9273 9274`-m386' 9275`-m486' 9276`-mpentium' 9277`-mpentiumpro' 9278 These options are synonyms for `-mtune=i386', `-mtune=i486', 9279 `-mtune=pentium', and `-mtune=pentiumpro' respectively. These 9280 synonyms are deprecated. 9281 9282`-mfpmath=UNIT' 9283 Generate floating point arithmetics for selected unit UNIT. The 9284 choices for UNIT are: 9285 9286 `387' 9287 Use the standard 387 floating point coprocessor present 9288 majority of chips and emulated otherwise. Code compiled with 9289 this option will run almost everywhere. The temporary 9290 results are computed in 80bit precision instead of precision 9291 specified by the type resulting in slightly different results 9292 compared to most of other chips. See `-ffloat-store' for 9293 more detailed description. 9294 9295 This is the default choice for i386 compiler. 9296 9297 `sse' 9298 Use scalar floating point instructions present in the SSE 9299 instruction set. This instruction set is supported by 9300 Pentium3 and newer chips, in the AMD line by Athlon-4, 9301 Athlon-xp and Athlon-mp chips. The earlier version of SSE 9302 instruction set supports only single precision arithmetics, 9303 thus the double and extended precision arithmetics is still 9304 done using 387. Later version, present only in Pentium4 and 9305 the future AMD x86-64 chips supports double precision 9306 arithmetics too. 9307 9308 For the i386 compiler, you need to use `-march=CPU-TYPE', 9309 `-msse' or `-msse2' switches to enable SSE extensions and 9310 make this option effective. For the x86-64 compiler, these 9311 extensions are enabled by default. 9312 9313 The resulting code should be considerably faster in the 9314 majority of cases and avoid the numerical instability 9315 problems of 387 code, but may break some existing code that 9316 expects temporaries to be 80bit. 9317 9318 This is the default choice for the x86-64 compiler. 9319 9320 `sse,387' 9321 Attempt to utilize both instruction sets at once. This 9322 effectively double the amount of available registers and on 9323 chips with separate execution units for 387 and SSE the 9324 execution resources too. Use this option with care, as it is 9325 still experimental, because the GCC register allocator does 9326 not model separate functional units well resulting in 9327 instable performance. 9328 9329`-masm=DIALECT' 9330 Output asm instructions using selected DIALECT. Supported choices 9331 are `intel' or `att' (the default one). Darwin does not support 9332 `intel'. 9333 9334`-mieee-fp' 9335`-mno-ieee-fp' 9336 Control whether or not the compiler uses IEEE floating point 9337 comparisons. These handle correctly the case where the result of a 9338 comparison is unordered. 9339 9340`-msoft-float' 9341 Generate output containing library calls for floating point. 9342 *Warning:* the requisite libraries are not part of GCC. Normally 9343 the facilities of the machine's usual C compiler are used, but 9344 this can't be done directly in cross-compilation. You must make 9345 your own arrangements to provide suitable library functions for 9346 cross-compilation. 9347 9348 On machines where a function returns floating point results in the 9349 80387 register stack, some floating point opcodes may be emitted 9350 even if `-msoft-float' is used. 9351 9352`-mno-fp-ret-in-387' 9353 Do not use the FPU registers for return values of functions. 9354 9355 The usual calling convention has functions return values of types 9356 `float' and `double' in an FPU register, even if there is no FPU. 9357 The idea is that the operating system should emulate an FPU. 9358 9359 The option `-mno-fp-ret-in-387' causes such values to be returned 9360 in ordinary CPU registers instead. 9361 9362`-mno-fancy-math-387' 9363 Some 387 emulators do not support the `sin', `cos' and `sqrt' 9364 instructions for the 387. Specify this option to avoid generating 9365 those instructions. This option is the default on FreeBSD, 9366 OpenBSD and NetBSD. This option is overridden when `-march' 9367 indicates that the target cpu will always have an FPU and so the 9368 instruction will not need emulation. As of revision 2.6.1, these 9369 instructions are not generated unless you also use the 9370 `-funsafe-math-optimizations' switch. 9371 9372`-malign-double' 9373`-mno-align-double' 9374 Control whether GCC aligns `double', `long double', and `long 9375 long' variables on a two word boundary or a one word boundary. 9376 Aligning `double' variables on a two word boundary will produce 9377 code that runs somewhat faster on a `Pentium' at the expense of 9378 more memory. 9379 9380 On x86-64, `-malign-double' is enabled by default. 9381 9382 *Warning:* if you use the `-malign-double' switch, structures 9383 containing the above types will be aligned differently than the 9384 published application binary interface specifications for the 386 9385 and will not be binary compatible with structures in code compiled 9386 without that switch. 9387 9388`-m96bit-long-double' 9389`-m128bit-long-double' 9390 These switches control the size of `long double' type. The i386 9391 application binary interface specifies the size to be 96 bits, so 9392 `-m96bit-long-double' is the default in 32 bit mode. 9393 9394 Modern architectures (Pentium and newer) would prefer `long double' 9395 to be aligned to an 8 or 16 byte boundary. In arrays or structures 9396 conforming to the ABI, this would not be possible. So specifying a 9397 `-m128bit-long-double' will align `long double' to a 16 byte 9398 boundary by padding the `long double' with an additional 32 bit 9399 zero. 9400 9401 In the x86-64 compiler, `-m128bit-long-double' is the default 9402 choice as its ABI specifies that `long double' is to be aligned on 9403 16 byte boundary. 9404 9405 Notice that neither of these options enable any extra precision 9406 over the x87 standard of 80 bits for a `long double'. 9407 9408 *Warning:* if you override the default value for your target ABI, 9409 the structures and arrays containing `long double' variables will 9410 change their size as well as function calling convention for 9411 function taking `long double' will be modified. Hence they will 9412 not be binary compatible with arrays or structures in code 9413 compiled without that switch. 9414 9415`-mmlarge-data-threshold=NUMBER' 9416 When `-mcmodel=medium' is specified, the data greater than 9417 THRESHOLD are placed in large data section. This value must be the 9418 same across all object linked into the binary and defaults to 9419 65535. 9420 9421`-msvr3-shlib' 9422`-mno-svr3-shlib' 9423 Control whether GCC places uninitialized local variables into the 9424 `bss' or `data' segments. `-msvr3-shlib' places them into `bss'. 9425 These options are meaningful only on System V Release 3. 9426 9427`-mrtd' 9428 Use a different function-calling convention, in which functions 9429 that take a fixed number of arguments return with the `ret' NUM 9430 instruction, which pops their arguments while returning. This 9431 saves one instruction in the caller since there is no need to pop 9432 the arguments there. 9433 9434 You can specify that an individual function is called with this 9435 calling sequence with the function attribute `stdcall'. You can 9436 also override the `-mrtd' option by using the function attribute 9437 `cdecl'. *Note Function Attributes::. 9438 9439 *Warning:* this calling convention is incompatible with the one 9440 normally used on Unix, so you cannot use it if you need to call 9441 libraries compiled with the Unix compiler. 9442 9443 Also, you must provide function prototypes for all functions that 9444 take variable numbers of arguments (including `printf'); otherwise 9445 incorrect code will be generated for calls to those functions. 9446 9447 In addition, seriously incorrect code will result if you call a 9448 function with too many arguments. (Normally, extra arguments are 9449 harmlessly ignored.) 9450 9451`-mregparm=NUM' 9452 Control how many registers are used to pass integer arguments. By 9453 default, no registers are used to pass arguments, and at most 3 9454 registers can be used. You can control this behavior for a 9455 specific function by using the function attribute `regparm'. 9456 *Note Function Attributes::. 9457 9458 *Warning:* if you use this switch, and NUM is nonzero, then you 9459 must build all modules with the same value, including any 9460 libraries. This includes the system libraries and startup modules. 9461 9462`-msseregparm' 9463 Use SSE register passing conventions for float and double arguments 9464 and return values. You can control this behavior for a specific 9465 function by using the function attribute `sseregparm'. *Note 9466 Function Attributes::. 9467 9468 *Warning:* if you use this switch then you must build all modules 9469 with the same value, including any libraries. This includes the 9470 system libraries and startup modules. 9471 9472`-mstackrealign' 9473 Realign the stack at entry. On the Intel x86, the 9474 `-mstackrealign' option will generate an alternate prologue and 9475 epilogue that realigns the runtime stack. This supports mixing 9476 legacy codes that keep a 4-byte aligned stack with modern codes 9477 that keep a 16-byte stack for SSE compatibility. The alternate 9478 prologue and epilogue are slower and bigger than the regular ones, 9479 and the alternate prologue requires an extra scratch register; 9480 this lowers the number of registers available if used in 9481 conjunction with the `regparm' attribute. The `-mstackrealign' 9482 option is incompatible with the nested function prologue; this is 9483 considered a hard error. See also the attribute 9484 `force_align_arg_pointer', applicable to individual functions. 9485 9486`-mpreferred-stack-boundary=NUM' 9487 Attempt to keep the stack boundary aligned to a 2 raised to NUM 9488 byte boundary. If `-mpreferred-stack-boundary' is not specified, 9489 the default is 4 (16 bytes or 128 bits). 9490 9491 On Pentium and PentiumPro, `double' and `long double' values 9492 should be aligned to an 8 byte boundary (see `-malign-double') or 9493 suffer significant run time performance penalties. On Pentium 9494 III, the Streaming SIMD Extension (SSE) data type `__m128' may not 9495 work properly if it is not 16 byte aligned. 9496 9497 To ensure proper alignment of this values on the stack, the stack 9498 boundary must be as aligned as that required by any value stored 9499 on the stack. Further, every function must be generated such that 9500 it keeps the stack aligned. Thus calling a function compiled with 9501 a higher preferred stack boundary from a function compiled with a 9502 lower preferred stack boundary will most likely misalign the 9503 stack. It is recommended that libraries that use callbacks always 9504 use the default setting. 9505 9506 This extra alignment does consume extra stack space, and generally 9507 increases code size. Code that is sensitive to stack space usage, 9508 such as embedded systems and operating system kernels, may want to 9509 reduce the preferred alignment to `-mpreferred-stack-boundary=2'. 9510 9511`-mmmx' 9512`-mno-mmx' 9513 9514`-msse' 9515`-mno-sse' 9516 9517`-msse2' 9518`-mno-sse2' 9519 9520`-msse3' 9521`-mno-sse3' 9522 9523`-m3dnow' 9524`-mno-3dnow' 9525 These switches enable or disable the use of instructions in the 9526 MMX, SSE, SSE2 or 3DNow! extended instruction sets. These 9527 extensions are also available as built-in functions: see *Note X86 9528 Built-in Functions::, for details of the functions enabled and 9529 disabled by these switches. 9530 9531 To have SSE/SSE2 instructions generated automatically from 9532 floating-point code (as opposed to 387 instructions), see 9533 `-mfpmath=sse'. 9534 9535 These options will enable GCC to use these extended instructions in 9536 generated code, even without `-mfpmath=sse'. Applications which 9537 perform runtime CPU detection must compile separate files for each 9538 supported architecture, using the appropriate flags. In 9539 particular, the file containing the CPU detection code should be 9540 compiled without these options. 9541 9542`-mpush-args' 9543`-mno-push-args' 9544 Use PUSH operations to store outgoing parameters. This method is 9545 shorter and usually equally fast as method using SUB/MOV 9546 operations and is enabled by default. In some cases disabling it 9547 may improve performance because of improved scheduling and reduced 9548 dependencies. 9549 9550`-maccumulate-outgoing-args' 9551 If enabled, the maximum amount of space required for outgoing 9552 arguments will be computed in the function prologue. This is 9553 faster on most modern CPUs because of reduced dependencies, 9554 improved scheduling and reduced stack usage when preferred stack 9555 boundary is not equal to 2. The drawback is a notable increase in 9556 code size. This switch implies `-mno-push-args'. 9557 9558`-mthreads' 9559 Support thread-safe exception handling on `Mingw32'. Code that 9560 relies on thread-safe exception handling must compile and link all 9561 code with the `-mthreads' option. When compiling, `-mthreads' 9562 defines `-D_MT'; when linking, it links in a special thread helper 9563 library `-lmingwthrd' which cleans up per thread exception 9564 handling data. 9565 9566`-mno-align-stringops' 9567 Do not align destination of inlined string operations. This 9568 switch reduces code size and improves performance in case the 9569 destination is already aligned, but GCC doesn't know about it. 9570 9571`-minline-all-stringops' 9572 By default GCC inlines string operations only when destination is 9573 known to be aligned at least to 4 byte boundary. This enables 9574 more inlining, increase code size, but may improve performance of 9575 code that depends on fast memcpy, strlen and memset for short 9576 lengths. 9577 9578`-momit-leaf-frame-pointer' 9579 Don't keep the frame pointer in a register for leaf functions. 9580 This avoids the instructions to save, set up and restore frame 9581 pointers and makes an extra register available in leaf functions. 9582 The option `-fomit-frame-pointer' removes the frame pointer for 9583 all functions which might make debugging harder. 9584 9585`-mtls-direct-seg-refs' 9586`-mno-tls-direct-seg-refs' 9587 Controls whether TLS variables may be accessed with offsets from 9588 the TLS segment register (`%gs' for 32-bit, `%fs' for 64-bit), or 9589 whether the thread base pointer must be added. Whether or not this 9590 is legal depends on the operating system, and whether it maps the 9591 segment to cover the entire TLS area. 9592 9593 For systems that use GNU libc, the default is on. 9594 9595 These `-m' switches are supported in addition to the above on AMD 9596x86-64 processors in 64-bit environments. 9597 9598`-m32' 9599`-m64' 9600 Generate code for a 32-bit or 64-bit environment. The 32-bit 9601 environment sets int, long and pointer to 32 bits and generates 9602 code that runs on any i386 system. The 64-bit environment sets 9603 int to 32 bits and long and pointer to 64 bits and generates code 9604 for AMD's x86-64 architecture. For darwin only the -m64 option 9605 turns off the `-fno-pic' and `-mdynamic-no-pic' options. 9606 9607`-mno-red-zone' 9608 Do not use a so called red zone for x86-64 code. The red zone is 9609 mandated by the x86-64 ABI, it is a 128-byte area beyond the 9610 location of the stack pointer that will not be modified by signal 9611 or interrupt handlers and therefore can be used for temporary data 9612 without adjusting the stack pointer. The flag `-mno-red-zone' 9613 disables this red zone. 9614 9615`-mcmodel=small' 9616 Generate code for the small code model: the program and its 9617 symbols must be linked in the lower 2 GB of the address space. 9618 Pointers are 64 bits. Programs can be statically or dynamically 9619 linked. This is the default code model. 9620 9621`-mcmodel=kernel' 9622 Generate code for the kernel code model. The kernel runs in the 9623 negative 2 GB of the address space. This model has to be used for 9624 Linux kernel code. 9625 9626`-mcmodel=medium' 9627 Generate code for the medium model: The program is linked in the 9628 lower 2 GB of the address space but symbols can be located 9629 anywhere in the address space. Programs can be statically or 9630 dynamically linked, but building of shared libraries are not 9631 supported with the medium model. 9632 9633`-mcmodel=large' 9634 Generate code for the large model: This model makes no assumptions 9635 about addresses and sizes of sections. Currently GCC does not 9636 implement this model. 9637 9638 9639File: gcc.info, Node: IA-64 Options, Next: M32C Options, Prev: i386 and x86-64 Options, Up: Submodel Options 9640 96413.17.15 IA-64 Options 9642--------------------- 9643 9644These are the `-m' options defined for the Intel IA-64 architecture. 9645 9646`-mbig-endian' 9647 Generate code for a big endian target. This is the default for 9648 HP-UX. 9649 9650`-mlittle-endian' 9651 Generate code for a little endian target. This is the default for 9652 AIX5 and GNU/Linux. 9653 9654`-mgnu-as' 9655`-mno-gnu-as' 9656 Generate (or don't) code for the GNU assembler. This is the 9657 default. 9658 9659`-mgnu-ld' 9660`-mno-gnu-ld' 9661 Generate (or don't) code for the GNU linker. This is the default. 9662 9663`-mno-pic' 9664 Generate code that does not use a global pointer register. The 9665 result is not position independent code, and violates the IA-64 9666 ABI. 9667 9668`-mvolatile-asm-stop' 9669`-mno-volatile-asm-stop' 9670 Generate (or don't) a stop bit immediately before and after 9671 volatile asm statements. 9672 9673`-mregister-names' 9674`-mno-register-names' 9675 Generate (or don't) `in', `loc', and `out' register names for the 9676 stacked registers. This may make assembler output more readable. 9677 9678`-mno-sdata' 9679`-msdata' 9680 Disable (or enable) optimizations that use the small data section. 9681 This may be useful for working around optimizer bugs. 9682 9683`-mconstant-gp' 9684 Generate code that uses a single constant global pointer value. 9685 This is useful when compiling kernel code. 9686 9687`-mauto-pic' 9688 Generate code that is self-relocatable. This implies 9689 `-mconstant-gp'. This is useful when compiling firmware code. 9690 9691`-minline-float-divide-min-latency' 9692 Generate code for inline divides of floating point values using 9693 the minimum latency algorithm. 9694 9695`-minline-float-divide-max-throughput' 9696 Generate code for inline divides of floating point values using 9697 the maximum throughput algorithm. 9698 9699`-minline-int-divide-min-latency' 9700 Generate code for inline divides of integer values using the 9701 minimum latency algorithm. 9702 9703`-minline-int-divide-max-throughput' 9704 Generate code for inline divides of integer values using the 9705 maximum throughput algorithm. 9706 9707`-minline-sqrt-min-latency' 9708 Generate code for inline square roots using the minimum latency 9709 algorithm. 9710 9711`-minline-sqrt-max-throughput' 9712 Generate code for inline square roots using the maximum throughput 9713 algorithm. 9714 9715`-mno-dwarf2-asm' 9716`-mdwarf2-asm' 9717 Don't (or do) generate assembler code for the DWARF2 line number 9718 debugging info. This may be useful when not using the GNU 9719 assembler. 9720 9721`-mearly-stop-bits' 9722`-mno-early-stop-bits' 9723 Allow stop bits to be placed earlier than immediately preceding the 9724 instruction that triggered the stop bit. This can improve 9725 instruction scheduling, but does not always do so. 9726 9727`-mfixed-range=REGISTER-RANGE' 9728 Generate code treating the given register range as fixed registers. 9729 A fixed register is one that the register allocator can not use. 9730 This is useful when compiling kernel code. A register range is 9731 specified as two registers separated by a dash. Multiple register 9732 ranges can be specified separated by a comma. 9733 9734`-mtls-size=TLS-SIZE' 9735 Specify bit size of immediate TLS offsets. Valid values are 14, 9736 22, and 64. 9737 9738`-mtune=CPU-TYPE' 9739 Tune the instruction scheduling for a particular CPU, Valid values 9740 are itanium, itanium1, merced, itanium2, and mckinley. 9741 9742`-mt' 9743`-pthread' 9744 Add support for multithreading using the POSIX threads library. 9745 This option sets flags for both the preprocessor and linker. It 9746 does not affect the thread safety of object code produced by the 9747 compiler or that of libraries supplied with it. These are HP-UX 9748 specific flags. 9749 9750`-milp32' 9751`-mlp64' 9752 Generate code for a 32-bit or 64-bit environment. The 32-bit 9753 environment sets int, long and pointer to 32 bits. The 64-bit 9754 environment sets int to 32 bits and long and pointer to 64 bits. 9755 These are HP-UX specific flags. 9756 9757`-mno-sched-br-data-spec' 9758`-msched-br-data-spec' 9759 (Dis/En)able data speculative scheduling before reload. This will 9760 result in generation of the ld.a instructions and the 9761 corresponding check instructions (ld.c / chk.a). The default is 9762 'disable'. 9763 9764`-msched-ar-data-spec' 9765`-mno-sched-ar-data-spec' 9766 (En/Dis)able data speculative scheduling after reload. This will 9767 result in generation of the ld.a instructions and the 9768 corresponding check instructions (ld.c / chk.a). The default is 9769 'enable'. 9770 9771`-mno-sched-control-spec' 9772`-msched-control-spec' 9773 (Dis/En)able control speculative scheduling. This feature is 9774 available only during region scheduling (i.e. before reload). 9775 This will result in generation of the ld.s instructions and the 9776 corresponding check instructions chk.s . The default is 'disable'. 9777 9778`-msched-br-in-data-spec' 9779`-mno-sched-br-in-data-spec' 9780 (En/Dis)able speculative scheduling of the instructions that are 9781 dependent on the data speculative loads before reload. This is 9782 effective only with `-msched-br-data-spec' enabled. The default 9783 is 'enable'. 9784 9785`-msched-ar-in-data-spec' 9786`-mno-sched-ar-in-data-spec' 9787 (En/Dis)able speculative scheduling of the instructions that are 9788 dependent on the data speculative loads after reload. This is 9789 effective only with `-msched-ar-data-spec' enabled. The default 9790 is 'enable'. 9791 9792`-msched-in-control-spec' 9793`-mno-sched-in-control-spec' 9794 (En/Dis)able speculative scheduling of the instructions that are 9795 dependent on the control speculative loads. This is effective 9796 only with `-msched-control-spec' enabled. The default is 'enable'. 9797 9798`-msched-ldc' 9799`-mno-sched-ldc' 9800 (En/Dis)able use of simple data speculation checks ld.c . If 9801 disabled, only chk.a instructions will be emitted to check data 9802 speculative loads. The default is 'enable'. 9803 9804`-mno-sched-control-ldc' 9805`-msched-control-ldc' 9806 (Dis/En)able use of ld.c instructions to check control speculative 9807 loads. If enabled, in case of control speculative load with no 9808 speculatively scheduled dependent instructions this load will be 9809 emitted as ld.sa and ld.c will be used to check it. The default 9810 is 'disable'. 9811 9812`-mno-sched-spec-verbose' 9813`-msched-spec-verbose' 9814 (Dis/En)able printing of the information about speculative motions. 9815 9816`-mno-sched-prefer-non-data-spec-insns' 9817`-msched-prefer-non-data-spec-insns' 9818 If enabled, data speculative instructions will be chosen for 9819 schedule only if there are no other choices at the moment. This 9820 will make the use of the data speculation much more conservative. 9821 The default is 'disable'. 9822 9823`-mno-sched-prefer-non-control-spec-insns' 9824`-msched-prefer-non-control-spec-insns' 9825 If enabled, control speculative instructions will be chosen for 9826 schedule only if there are no other choices at the moment. This 9827 will make the use of the control speculation much more 9828 conservative. The default is 'disable'. 9829 9830`-mno-sched-count-spec-in-critical-path' 9831`-msched-count-spec-in-critical-path' 9832 If enabled, speculative dependencies will be considered during 9833 computation of the instructions priorities. This will make the 9834 use of the speculation a bit more conservative. The default is 9835 'disable'. 9836 9837 9838 9839File: gcc.info, Node: M32C Options, Next: M32R/D Options, Prev: IA-64 Options, Up: Submodel Options 9840 98413.17.16 M32C Options 9842-------------------- 9843 9844`-mcpu=NAME' 9845 Select the CPU for which code is generated. NAME may be one of 9846 `r8c' for the R8C/Tiny series, `m16c' for the M16C (up to /60) 9847 series, `m32cm' for the M16C/80 series, or `m32c' for the M32C/80 9848 series. 9849 9850`-msim' 9851 Specifies that the program will be run on the simulator. This 9852 causes an alternate runtime library to be linked in which 9853 supports, for example, file I/O. You must not use this option 9854 when generating programs that will run on real hardware; you must 9855 provide your own runtime library for whatever I/O functions are 9856 needed. 9857 9858`-memregs=NUMBER' 9859 Specifies the number of memory-based pseudo-registers GCC will use 9860 during code generation. These pseudo-registers will be used like 9861 real registers, so there is a tradeoff between GCC's ability to 9862 fit the code into available registers, and the performance penalty 9863 of using memory instead of registers. Note that all modules in a 9864 program must be compiled with the same value for this option. 9865 Because of that, you must not use this option with the default 9866 runtime libraries gcc builds. 9867 9868 9869 9870File: gcc.info, Node: M32R/D Options, Next: M680x0 Options, Prev: M32C Options, Up: Submodel Options 9871 98723.17.17 M32R/D Options 9873---------------------- 9874 9875These `-m' options are defined for Renesas M32R/D architectures: 9876 9877`-m32r2' 9878 Generate code for the M32R/2. 9879 9880`-m32rx' 9881 Generate code for the M32R/X. 9882 9883`-m32r' 9884 Generate code for the M32R. This is the default. 9885 9886`-mmodel=small' 9887 Assume all objects live in the lower 16MB of memory (so that their 9888 addresses can be loaded with the `ld24' instruction), and assume 9889 all subroutines are reachable with the `bl' instruction. This is 9890 the default. 9891 9892 The addressability of a particular object can be set with the 9893 `model' attribute. 9894 9895`-mmodel=medium' 9896 Assume objects may be anywhere in the 32-bit address space (the 9897 compiler will generate `seth/add3' instructions to load their 9898 addresses), and assume all subroutines are reachable with the `bl' 9899 instruction. 9900 9901`-mmodel=large' 9902 Assume objects may be anywhere in the 32-bit address space (the 9903 compiler will generate `seth/add3' instructions to load their 9904 addresses), and assume subroutines may not be reachable with the 9905 `bl' instruction (the compiler will generate the much slower 9906 `seth/add3/jl' instruction sequence). 9907 9908`-msdata=none' 9909 Disable use of the small data area. Variables will be put into 9910 one of `.data', `bss', or `.rodata' (unless the `section' 9911 attribute has been specified). This is the default. 9912 9913 The small data area consists of sections `.sdata' and `.sbss'. 9914 Objects may be explicitly put in the small data area with the 9915 `section' attribute using one of these sections. 9916 9917`-msdata=sdata' 9918 Put small global and static data in the small data area, but do not 9919 generate special code to reference them. 9920 9921`-msdata=use' 9922 Put small global and static data in the small data area, and 9923 generate special instructions to reference them. 9924 9925`-G NUM' 9926 Put global and static objects less than or equal to NUM bytes into 9927 the small data or bss sections instead of the normal data or bss 9928 sections. The default value of NUM is 8. The `-msdata' option 9929 must be set to one of `sdata' or `use' for this option to have any 9930 effect. 9931 9932 All modules should be compiled with the same `-G NUM' value. 9933 Compiling with different values of NUM may or may not work; if it 9934 doesn't the linker will give an error message--incorrect code will 9935 not be generated. 9936 9937`-mdebug' 9938 Makes the M32R specific code in the compiler display some 9939 statistics that might help in debugging programs. 9940 9941`-malign-loops' 9942 Align all loops to a 32-byte boundary. 9943 9944`-mno-align-loops' 9945 Do not enforce a 32-byte alignment for loops. This is the default. 9946 9947`-missue-rate=NUMBER' 9948 Issue NUMBER instructions per cycle. NUMBER can only be 1 or 2. 9949 9950`-mbranch-cost=NUMBER' 9951 NUMBER can only be 1 or 2. If it is 1 then branches will be 9952 preferred over conditional code, if it is 2, then the opposite will 9953 apply. 9954 9955`-mflush-trap=NUMBER' 9956 Specifies the trap number to use to flush the cache. The default 9957 is 12. Valid numbers are between 0 and 15 inclusive. 9958 9959`-mno-flush-trap' 9960 Specifies that the cache cannot be flushed by using a trap. 9961 9962`-mflush-func=NAME' 9963 Specifies the name of the operating system function to call to 9964 flush the cache. The default is __flush_cache_, but a function 9965 call will only be used if a trap is not available. 9966 9967`-mno-flush-func' 9968 Indicates that there is no OS function for flushing the cache. 9969 9970 9971 9972File: gcc.info, Node: M680x0 Options, Next: M68hc1x Options, Prev: M32R/D Options, Up: Submodel Options 9973 99743.17.18 M680x0 Options 9975---------------------- 9976 9977These are the `-m' options defined for the 68000 series. The default 9978values for these options depends on which style of 68000 was selected 9979when the compiler was configured; the defaults for the most common 9980choices are given below. 9981 9982`-m68000' 9983`-mc68000' 9984 Generate output for a 68000. This is the default when the 9985 compiler is configured for 68000-based systems. 9986 9987 Use this option for microcontrollers with a 68000 or EC000 core, 9988 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356. 9989 9990`-m68020' 9991`-mc68020' 9992 Generate output for a 68020. This is the default when the 9993 compiler is configured for 68020-based systems. 9994 9995`-m68881' 9996 Generate output containing 68881 instructions for floating point. 9997 This is the default for most 68020 systems unless `--nfp' was 9998 specified when the compiler was configured. 9999 10000`-m68030' 10001 Generate output for a 68030. This is the default when the 10002 compiler is configured for 68030-based systems. 10003 10004`-m68040' 10005 Generate output for a 68040. This is the default when the 10006 compiler is configured for 68040-based systems. 10007 10008 This option inhibits the use of 68881/68882 instructions that have 10009 to be emulated by software on the 68040. Use this option if your 10010 68040 does not have code to emulate those instructions. 10011 10012`-m68060' 10013 Generate output for a 68060. This is the default when the 10014 compiler is configured for 68060-based systems. 10015 10016 This option inhibits the use of 68020 and 68881/68882 instructions 10017 that have to be emulated by software on the 68060. Use this 10018 option if your 68060 does not have code to emulate those 10019 instructions. 10020 10021`-mcpu32' 10022 Generate output for a CPU32. This is the default when the 10023 compiler is configured for CPU32-based systems. 10024 10025 Use this option for microcontrollers with a CPU32 or CPU32+ core, 10026 including the 68330, 68331, 68332, 68333, 68334, 68336, 68340, 10027 68341, 68349 and 68360. 10028 10029`-m5200' 10030 Generate output for a 520X "coldfire" family cpu. This is the 10031 default when the compiler is configured for 520X-based systems. 10032 10033 Use this option for microcontroller with a 5200 core, including 10034 the MCF5202, MCF5203, MCF5204 and MCF5202. 10035 10036`-mcfv4e' 10037 Generate output for a ColdFire V4e family cpu (e.g. 547x/548x). 10038 This includes use of hardware floating point instructions. 10039 10040`-m68020-40' 10041 Generate output for a 68040, without using any of the new 10042 instructions. This results in code which can run relatively 10043 efficiently on either a 68020/68881 or a 68030 or a 68040. The 10044 generated code does use the 68881 instructions that are emulated 10045 on the 68040. 10046 10047`-m68020-60' 10048 Generate output for a 68060, without using any of the new 10049 instructions. This results in code which can run relatively 10050 efficiently on either a 68020/68881 or a 68030 or a 68040. The 10051 generated code does use the 68881 instructions that are emulated 10052 on the 68060. 10053 10054`-msoft-float' 10055 Generate output containing library calls for floating point. 10056 *Warning:* the requisite libraries are not available for all m68k 10057 targets. Normally the facilities of the machine's usual C 10058 compiler are used, but this can't be done directly in 10059 cross-compilation. You must make your own arrangements to provide 10060 suitable library functions for cross-compilation. The embedded 10061 targets `m68k-*-aout' and `m68k-*-coff' do provide software 10062 floating point support. 10063 10064`-mshort' 10065 Consider type `int' to be 16 bits wide, like `short int'. 10066 Additionally, parameters passed on the stack are also aligned to a 10067 16-bit boundary even on targets whose API mandates promotion to 10068 32-bit. 10069 10070`-mnobitfield' 10071 Do not use the bit-field instructions. The `-m68000', `-mcpu32' 10072 and `-m5200' options imply `-mnobitfield'. 10073 10074`-mbitfield' 10075 Do use the bit-field instructions. The `-m68020' option implies 10076 `-mbitfield'. This is the default if you use a configuration 10077 designed for a 68020. 10078 10079`-mrtd' 10080 Use a different function-calling convention, in which functions 10081 that take a fixed number of arguments return with the `rtd' 10082 instruction, which pops their arguments while returning. This 10083 saves one instruction in the caller since there is no need to pop 10084 the arguments there. 10085 10086 This calling convention is incompatible with the one normally used 10087 on Unix, so you cannot use it if you need to call libraries 10088 compiled with the Unix compiler. 10089 10090 Also, you must provide function prototypes for all functions that 10091 take variable numbers of arguments (including `printf'); otherwise 10092 incorrect code will be generated for calls to those functions. 10093 10094 In addition, seriously incorrect code will result if you call a 10095 function with too many arguments. (Normally, extra arguments are 10096 harmlessly ignored.) 10097 10098 The `rtd' instruction is supported by the 68010, 68020, 68030, 10099 68040, 68060 and CPU32 processors, but not by the 68000 or 5200. 10100 10101`-malign-int' 10102`-mno-align-int' 10103 Control whether GCC aligns `int', `long', `long long', `float', 10104 `double', and `long double' variables on a 32-bit boundary 10105 (`-malign-int') or a 16-bit boundary (`-mno-align-int'). Aligning 10106 variables on 32-bit boundaries produces code that runs somewhat 10107 faster on processors with 32-bit busses at the expense of more 10108 memory. 10109 10110 *Warning:* if you use the `-malign-int' switch, GCC will align 10111 structures containing the above types differently than most 10112 published application binary interface specifications for the m68k. 10113 10114`-mpcrel' 10115 Use the pc-relative addressing mode of the 68000 directly, instead 10116 of using a global offset table. At present, this option implies 10117 `-fpic', allowing at most a 16-bit offset for pc-relative 10118 addressing. `-fPIC' is not presently supported with `-mpcrel', 10119 though this could be supported for 68020 and higher processors. 10120 10121`-mno-strict-align' 10122`-mstrict-align' 10123 Do not (do) assume that unaligned memory references will be 10124 handled by the system. 10125 10126`-msep-data' 10127 Generate code that allows the data segment to be located in a 10128 different area of memory from the text segment. This allows for 10129 execute in place in an environment without virtual memory 10130 management. This option implies `-fPIC'. 10131 10132`-mno-sep-data' 10133 Generate code that assumes that the data segment follows the text 10134 segment. This is the default. 10135 10136`-mid-shared-library' 10137 Generate code that supports shared libraries via the library ID 10138 method. This allows for execute in place and shared libraries in 10139 an environment without virtual memory management. This option 10140 implies `-fPIC'. 10141 10142`-mno-id-shared-library' 10143 Generate code that doesn't assume ID based shared libraries are 10144 being used. This is the default. 10145 10146`-mshared-library-id=n' 10147 Specified the identification number of the ID based shared library 10148 being compiled. Specifying a value of 0 will generate more 10149 compact code, specifying other values will force the allocation of 10150 that number to the current library but is no more space or time 10151 efficient than omitting this option. 10152 10153 10154 10155File: gcc.info, Node: M68hc1x Options, Next: MCore Options, Prev: M680x0 Options, Up: Submodel Options 10156 101573.17.19 M68hc1x Options 10158----------------------- 10159 10160These are the `-m' options defined for the 68hc11 and 68hc12 10161microcontrollers. The default values for these options depends on 10162which style of microcontroller was selected when the compiler was 10163configured; the defaults for the most common choices are given below. 10164 10165`-m6811' 10166`-m68hc11' 10167 Generate output for a 68HC11. This is the default when the 10168 compiler is configured for 68HC11-based systems. 10169 10170`-m6812' 10171`-m68hc12' 10172 Generate output for a 68HC12. This is the default when the 10173 compiler is configured for 68HC12-based systems. 10174 10175`-m68S12' 10176`-m68hcs12' 10177 Generate output for a 68HCS12. 10178 10179`-mauto-incdec' 10180 Enable the use of 68HC12 pre and post auto-increment and 10181 auto-decrement addressing modes. 10182 10183`-minmax' 10184`-nominmax' 10185 Enable the use of 68HC12 min and max instructions. 10186 10187`-mlong-calls' 10188`-mno-long-calls' 10189 Treat all calls as being far away (near). If calls are assumed to 10190 be far away, the compiler will use the `call' instruction to call 10191 a function and the `rtc' instruction for returning. 10192 10193`-mshort' 10194 Consider type `int' to be 16 bits wide, like `short int'. 10195 10196`-msoft-reg-count=COUNT' 10197 Specify the number of pseudo-soft registers which are used for the 10198 code generation. The maximum number is 32. Using more pseudo-soft 10199 register may or may not result in better code depending on the 10200 program. The default is 4 for 68HC11 and 2 for 68HC12. 10201 10202 10203 10204File: gcc.info, Node: MCore Options, Next: MIPS Options, Prev: M68hc1x Options, Up: Submodel Options 10205 102063.17.20 MCore Options 10207--------------------- 10208 10209These are the `-m' options defined for the Motorola M*Core processors. 10210 10211`-mhardlit' 10212`-mno-hardlit' 10213 Inline constants into the code stream if it can be done in two 10214 instructions or less. 10215 10216`-mdiv' 10217`-mno-div' 10218 Use the divide instruction. (Enabled by default). 10219 10220`-mrelax-immediate' 10221`-mno-relax-immediate' 10222 Allow arbitrary sized immediates in bit operations. 10223 10224`-mwide-bitfields' 10225`-mno-wide-bitfields' 10226 Always treat bit-fields as int-sized. 10227 10228`-m4byte-functions' 10229`-mno-4byte-functions' 10230 Force all functions to be aligned to a four byte boundary. 10231 10232`-mcallgraph-data' 10233`-mno-callgraph-data' 10234 Emit callgraph information. 10235 10236`-mslow-bytes' 10237`-mno-slow-bytes' 10238 Prefer word access when reading byte quantities. 10239 10240`-mlittle-endian' 10241`-mbig-endian' 10242 Generate code for a little endian target. 10243 10244`-m210' 10245`-m340' 10246 Generate code for the 210 processor. 10247 10248 10249File: gcc.info, Node: MIPS Options, Next: MMIX Options, Prev: MCore Options, Up: Submodel Options 10250 102513.17.21 MIPS Options 10252-------------------- 10253 10254`-EB' 10255 Generate big-endian code. 10256 10257`-EL' 10258 Generate little-endian code. This is the default for `mips*el-*-*' 10259 configurations. 10260 10261`-march=ARCH' 10262 Generate code that will run on ARCH, which can be the name of a 10263 generic MIPS ISA, or the name of a particular processor. The ISA 10264 names are: `mips1', `mips2', `mips3', `mips4', `mips32', 10265 `mips32r2', and `mips64'. The processor names are: `4kc', `4km', 10266 `4kp', `5kc', `5kf', `20kc', `24k', `24kc', `24kf', `24kx', `m4k', 10267 `orion', `r2000', `r3000', `r3900', `r4000', `r4400', `r4600', 10268 `r4650', `r6000', `r8000', `rm7000', `rm9000', `sb1', `sr71000', 10269 `vr4100', `vr4111', `vr4120', `vr4130', `vr4300', `vr5000', 10270 `vr5400' and `vr5500'. The special value `from-abi' selects the 10271 most compatible architecture for the selected ABI (that is, 10272 `mips1' for 32-bit ABIs and `mips3' for 64-bit ABIs). 10273 10274 In processor names, a final `000' can be abbreviated as `k' (for 10275 example, `-march=r2k'). Prefixes are optional, and `vr' may be 10276 written `r'. 10277 10278 GCC defines two macros based on the value of this option. The 10279 first is `_MIPS_ARCH', which gives the name of target 10280 architecture, as a string. The second has the form 10281 `_MIPS_ARCH_FOO', where FOO is the capitalized value of 10282 `_MIPS_ARCH'. For example, `-march=r2000' will set `_MIPS_ARCH' 10283 to `"r2000"' and define the macro `_MIPS_ARCH_R2000'. 10284 10285 Note that the `_MIPS_ARCH' macro uses the processor names given 10286 above. In other words, it will have the full prefix and will not 10287 abbreviate `000' as `k'. In the case of `from-abi', the macro 10288 names the resolved architecture (either `"mips1"' or `"mips3"'). 10289 It names the default architecture when no `-march' option is given. 10290 10291`-mtune=ARCH' 10292 Optimize for ARCH. Among other things, this option controls the 10293 way instructions are scheduled, and the perceived cost of 10294 arithmetic operations. The list of ARCH values is the same as for 10295 `-march'. 10296 10297 When this option is not used, GCC will optimize for the processor 10298 specified by `-march'. By using `-march' and `-mtune' together, 10299 it is possible to generate code that will run on a family of 10300 processors, but optimize the code for one particular member of 10301 that family. 10302 10303 `-mtune' defines the macros `_MIPS_TUNE' and `_MIPS_TUNE_FOO', 10304 which work in the same way as the `-march' ones described above. 10305 10306`-mips1' 10307 Equivalent to `-march=mips1'. 10308 10309`-mips2' 10310 Equivalent to `-march=mips2'. 10311 10312`-mips3' 10313 Equivalent to `-march=mips3'. 10314 10315`-mips4' 10316 Equivalent to `-march=mips4'. 10317 10318`-mips32' 10319 Equivalent to `-march=mips32'. 10320 10321`-mips32r2' 10322 Equivalent to `-march=mips32r2'. 10323 10324`-mips64' 10325 Equivalent to `-march=mips64'. 10326 10327`-mips16' 10328`-mno-mips16' 10329 Generate (do not generate) MIPS16 code. If GCC is targetting a 10330 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE. 10331 10332`-mabi=32' 10333`-mabi=o64' 10334`-mabi=n32' 10335`-mabi=64' 10336`-mabi=eabi' 10337 Generate code for the given ABI. 10338 10339 Note that the EABI has a 32-bit and a 64-bit variant. GCC normally 10340 generates 64-bit code when you select a 64-bit architecture, but 10341 you can use `-mgp32' to get 32-bit code instead. 10342 10343 For information about the O64 ABI, see 10344 `http://gcc.gnu.org/projects/mipso64-abi.html'. 10345 10346`-mabicalls' 10347`-mno-abicalls' 10348 Generate (do not generate) code that is suitable for SVR4-style 10349 dynamic objects. `-mabicalls' is the default for SVR4-based 10350 systems. 10351 10352`-mshared' 10353`-mno-shared' 10354 Generate (do not generate) code that is fully position-independent, 10355 and that can therefore be linked into shared libraries. This 10356 option only affects `-mabicalls'. 10357 10358 All `-mabicalls' code has traditionally been position-independent, 10359 regardless of options like `-fPIC' and `-fpic'. However, as an 10360 extension, the GNU toolchain allows executables to use absolute 10361 accesses for locally-binding symbols. It can also use shorter GP 10362 initialization sequences and generate direct calls to 10363 locally-defined functions. This mode is selected by `-mno-shared'. 10364 10365 `-mno-shared' depends on binutils 2.16 or higher and generates 10366 objects that can only be linked by the GNU linker. However, the 10367 option does not affect the ABI of the final executable; it only 10368 affects the ABI of relocatable objects. Using `-mno-shared' will 10369 generally make executables both smaller and quicker. 10370 10371 `-mshared' is the default. 10372 10373`-mxgot' 10374`-mno-xgot' 10375 Lift (do not lift) the usual restrictions on the size of the global 10376 offset table. 10377 10378 GCC normally uses a single instruction to load values from the GOT. 10379 While this is relatively efficient, it will only work if the GOT 10380 is smaller than about 64k. Anything larger will cause the linker 10381 to report an error such as: 10382 10383 relocation truncated to fit: R_MIPS_GOT16 foobar 10384 10385 If this happens, you should recompile your code with `-mxgot'. It 10386 should then work with very large GOTs, although it will also be 10387 less efficient, since it will take three instructions to fetch the 10388 value of a global symbol. 10389 10390 Note that some linkers can create multiple GOTs. If you have such 10391 a linker, you should only need to use `-mxgot' when a single object 10392 file accesses more than 64k's worth of GOT entries. Very few do. 10393 10394 These options have no effect unless GCC is generating position 10395 independent code. 10396 10397`-mgp32' 10398 Assume that general-purpose registers are 32 bits wide. 10399 10400`-mgp64' 10401 Assume that general-purpose registers are 64 bits wide. 10402 10403`-mfp32' 10404 Assume that floating-point registers are 32 bits wide. 10405 10406`-mfp64' 10407 Assume that floating-point registers are 64 bits wide. 10408 10409`-mhard-float' 10410 Use floating-point coprocessor instructions. 10411 10412`-msoft-float' 10413 Do not use floating-point coprocessor instructions. Implement 10414 floating-point calculations using library calls instead. 10415 10416`-msingle-float' 10417 Assume that the floating-point coprocessor only supports 10418 single-precision operations. 10419 10420`-mdouble-float' 10421 Assume that the floating-point coprocessor supports 10422 double-precision operations. This is the default. 10423 10424`-mdsp' 10425`-mno-dsp' 10426 Use (do not use) the MIPS DSP ASE. *Note MIPS DSP Built-in 10427 Functions::. 10428 10429`-mpaired-single' 10430`-mno-paired-single' 10431 Use (do not use) paired-single floating-point instructions. *Note 10432 MIPS Paired-Single Support::. This option can only be used when 10433 generating 64-bit code and requires hardware floating-point 10434 support to be enabled. 10435 10436`-mips3d' 10437`-mno-mips3d' 10438 Use (do not use) the MIPS-3D ASE. *Note MIPS-3D Built-in 10439 Functions::. The option `-mips3d' implies `-mpaired-single'. 10440 10441`-mlong64' 10442 Force `long' types to be 64 bits wide. See `-mlong32' for an 10443 explanation of the default and the way that the pointer size is 10444 determined. 10445 10446`-mlong32' 10447 Force `long', `int', and pointer types to be 32 bits wide. 10448 10449 The default size of `int's, `long's and pointers depends on the 10450 ABI. All the supported ABIs use 32-bit `int's. The n64 ABI uses 10451 64-bit `long's, as does the 64-bit EABI; the others use 32-bit 10452 `long's. Pointers are the same size as `long's, or the same size 10453 as integer registers, whichever is smaller. 10454 10455`-msym32' 10456`-mno-sym32' 10457 Assume (do not assume) that all symbols have 32-bit values, 10458 regardless of the selected ABI. This option is useful in 10459 combination with `-mabi=64' and `-mno-abicalls' because it allows 10460 GCC to generate shorter and faster references to symbolic 10461 addresses. 10462 10463`-G NUM' 10464 Put global and static items less than or equal to NUM bytes into 10465 the small data or bss section instead of the normal data or bss 10466 section. This allows the data to be accessed using a single 10467 instruction. 10468 10469 All modules should be compiled with the same `-G NUM' value. 10470 10471`-membedded-data' 10472`-mno-embedded-data' 10473 Allocate variables to the read-only data section first if 10474 possible, then next in the small data section if possible, 10475 otherwise in data. This gives slightly slower code than the 10476 default, but reduces the amount of RAM required when executing, 10477 and thus may be preferred for some embedded systems. 10478 10479`-muninit-const-in-rodata' 10480`-mno-uninit-const-in-rodata' 10481 Put uninitialized `const' variables in the read-only data section. 10482 This option is only meaningful in conjunction with 10483 `-membedded-data'. 10484 10485`-msplit-addresses' 10486`-mno-split-addresses' 10487 Enable (disable) use of the `%hi()' and `%lo()' assembler 10488 relocation operators. This option has been superseded by 10489 `-mexplicit-relocs' but is retained for backwards compatibility. 10490 10491`-mexplicit-relocs' 10492`-mno-explicit-relocs' 10493 Use (do not use) assembler relocation operators when dealing with 10494 symbolic addresses. The alternative, selected by 10495 `-mno-explicit-relocs', is to use assembler macros instead. 10496 10497 `-mexplicit-relocs' is the default if GCC was configured to use an 10498 assembler that supports relocation operators. 10499 10500`-mcheck-zero-division' 10501`-mno-check-zero-division' 10502 Trap (do not trap) on integer division by zero. The default is 10503 `-mcheck-zero-division'. 10504 10505`-mdivide-traps' 10506`-mdivide-breaks' 10507 MIPS systems check for division by zero by generating either a 10508 conditional trap or a break instruction. Using traps results in 10509 smaller code, but is only supported on MIPS II and later. Also, 10510 some versions of the Linux kernel have a bug that prevents trap 10511 from generating the proper signal (`SIGFPE'). Use 10512 `-mdivide-traps' to allow conditional traps on architectures that 10513 support them and `-mdivide-breaks' to force the use of breaks. 10514 10515 The default is usually `-mdivide-traps', but this can be 10516 overridden at configure time using `--with-divide=breaks'. 10517 Divide-by-zero checks can be completely disabled using 10518 `-mno-check-zero-division'. 10519 10520`-mmemcpy' 10521`-mno-memcpy' 10522 Force (do not force) the use of `memcpy()' for non-trivial block 10523 moves. The default is `-mno-memcpy', which allows GCC to inline 10524 most constant-sized copies. 10525 10526`-mlong-calls' 10527`-mno-long-calls' 10528 Disable (do not disable) use of the `jal' instruction. Calling 10529 functions using `jal' is more efficient but requires the caller 10530 and callee to be in the same 256 megabyte segment. 10531 10532 This option has no effect on abicalls code. The default is 10533 `-mno-long-calls'. 10534 10535`-mmad' 10536`-mno-mad' 10537 Enable (disable) use of the `mad', `madu' and `mul' instructions, 10538 as provided by the R4650 ISA. 10539 10540`-mfused-madd' 10541`-mno-fused-madd' 10542 Enable (disable) use of the floating point multiply-accumulate 10543 instructions, when they are available. The default is 10544 `-mfused-madd'. 10545 10546 When multiply-accumulate instructions are used, the intermediate 10547 product is calculated to infinite precision and is not subject to 10548 the FCSR Flush to Zero bit. This may be undesirable in some 10549 circumstances. 10550 10551`-nocpp' 10552 Tell the MIPS assembler to not run its preprocessor over user 10553 assembler files (with a `.s' suffix) when assembling them. 10554 10555`-mfix-r4000' 10556`-mno-fix-r4000' 10557 Work around certain R4000 CPU errata: 10558 - A double-word or a variable shift may give an incorrect 10559 result if executed immediately after starting an integer 10560 division. 10561 10562 - A double-word or a variable shift may give an incorrect 10563 result if executed while an integer multiplication is in 10564 progress. 10565 10566 - An integer division may give an incorrect result if started 10567 in a delay slot of a taken branch or a jump. 10568 10569`-mfix-r4400' 10570`-mno-fix-r4400' 10571 Work around certain R4400 CPU errata: 10572 - A double-word or a variable shift may give an incorrect 10573 result if executed immediately after starting an integer 10574 division. 10575 10576`-mfix-vr4120' 10577`-mno-fix-vr4120' 10578 Work around certain VR4120 errata: 10579 - `dmultu' does not always produce the correct result. 10580 10581 - `div' and `ddiv' do not always produce the correct result if 10582 one of the operands is negative. 10583 The workarounds for the division errata rely on special functions 10584 in `libgcc.a'. At present, these functions are only provided by 10585 the `mips64vr*-elf' configurations. 10586 10587 Other VR4120 errata require a nop to be inserted between certain 10588 pairs of instructions. These errata are handled by the assembler, 10589 not by GCC itself. 10590 10591`-mfix-vr4130' 10592 Work around the VR4130 `mflo'/`mfhi' errata. The workarounds are 10593 implemented by the assembler rather than by GCC, although GCC will 10594 avoid using `mflo' and `mfhi' if the VR4130 `macc', `macchi', 10595 `dmacc' and `dmacchi' instructions are available instead. 10596 10597`-mfix-sb1' 10598`-mno-fix-sb1' 10599 Work around certain SB-1 CPU core errata. (This flag currently 10600 works around the SB-1 revision 2 "F1" and "F2" floating point 10601 errata.) 10602 10603`-mflush-func=FUNC' 10604`-mno-flush-func' 10605 Specifies the function to call to flush the I and D caches, or to 10606 not call any such function. If called, the function must take the 10607 same arguments as the common `_flush_func()', that is, the address 10608 of the memory range for which the cache is being flushed, the size 10609 of the memory range, and the number 3 (to flush both caches). The 10610 default depends on the target GCC was configured for, but commonly 10611 is either `_flush_func' or `__cpu_flush'. 10612 10613`-mbranch-likely' 10614`-mno-branch-likely' 10615 Enable or disable use of Branch Likely instructions, regardless of 10616 the default for the selected architecture. By default, Branch 10617 Likely instructions may be generated if they are supported by the 10618 selected architecture. An exception is for the MIPS32 and MIPS64 10619 architectures and processors which implement those architectures; 10620 for those, Branch Likely instructions will not be generated by 10621 default because the MIPS32 and MIPS64 architectures specifically 10622 deprecate their use. 10623 10624`-mfp-exceptions' 10625`-mno-fp-exceptions' 10626 Specifies whether FP exceptions are enabled. This affects how we 10627 schedule FP instructions for some processors. The default is that 10628 FP exceptions are enabled. 10629 10630 For instance, on the SB-1, if FP exceptions are disabled, and we 10631 are emitting 64-bit code, then we can use both FP pipes. 10632 Otherwise, we can only use one FP pipe. 10633 10634`-mvr4130-align' 10635`-mno-vr4130-align' 10636 The VR4130 pipeline is two-way superscalar, but can only issue two 10637 instructions together if the first one is 8-byte aligned. When 10638 this option is enabled, GCC will align pairs of instructions that 10639 it thinks should execute in parallel. 10640 10641 This option only has an effect when optimizing for the VR4130. It 10642 normally makes code faster, but at the expense of making it bigger. 10643 It is enabled by default at optimization level `-O3'. 10644 10645 10646File: gcc.info, Node: MMIX Options, Next: MN10300 Options, Prev: MIPS Options, Up: Submodel Options 10647 106483.17.22 MMIX Options 10649-------------------- 10650 10651These options are defined for the MMIX: 10652 10653`-mlibfuncs' 10654`-mno-libfuncs' 10655 Specify that intrinsic library functions are being compiled, 10656 passing all values in registers, no matter the size. 10657 10658`-mepsilon' 10659`-mno-epsilon' 10660 Generate floating-point comparison instructions that compare with 10661 respect to the `rE' epsilon register. 10662 10663`-mabi=mmixware' 10664`-mabi=gnu' 10665 Generate code that passes function parameters and return values 10666 that (in the called function) are seen as registers `$0' and up, 10667 as opposed to the GNU ABI which uses global registers `$231' and 10668 up. 10669 10670`-mzero-extend' 10671`-mno-zero-extend' 10672 When reading data from memory in sizes shorter than 64 bits, use 10673 (do not use) zero-extending load instructions by default, rather 10674 than sign-extending ones. 10675 10676`-mknuthdiv' 10677`-mno-knuthdiv' 10678 Make the result of a division yielding a remainder have the same 10679 sign as the divisor. With the default, `-mno-knuthdiv', the sign 10680 of the remainder follows the sign of the dividend. Both methods 10681 are arithmetically valid, the latter being almost exclusively used. 10682 10683`-mtoplevel-symbols' 10684`-mno-toplevel-symbols' 10685 Prepend (do not prepend) a `:' to all global symbols, so the 10686 assembly code can be used with the `PREFIX' assembly directive. 10687 10688`-melf' 10689 Generate an executable in the ELF format, rather than the default 10690 `mmo' format used by the `mmix' simulator. 10691 10692`-mbranch-predict' 10693`-mno-branch-predict' 10694 Use (do not use) the probable-branch instructions, when static 10695 branch prediction indicates a probable branch. 10696 10697`-mbase-addresses' 10698`-mno-base-addresses' 10699 Generate (do not generate) code that uses _base addresses_. Using 10700 a base address automatically generates a request (handled by the 10701 assembler and the linker) for a constant to be set up in a global 10702 register. The register is used for one or more base address 10703 requests within the range 0 to 255 from the value held in the 10704 register. The generally leads to short and fast code, but the 10705 number of different data items that can be addressed is limited. 10706 This means that a program that uses lots of static data may 10707 require `-mno-base-addresses'. 10708 10709`-msingle-exit' 10710`-mno-single-exit' 10711 Force (do not force) generated code to have a single exit point in 10712 each function. 10713 10714 10715File: gcc.info, Node: MN10300 Options, Next: MT Options, Prev: MMIX Options, Up: Submodel Options 10716 107173.17.23 MN10300 Options 10718----------------------- 10719 10720These `-m' options are defined for Matsushita MN10300 architectures: 10721 10722`-mmult-bug' 10723 Generate code to avoid bugs in the multiply instructions for the 10724 MN10300 processors. This is the default. 10725 10726`-mno-mult-bug' 10727 Do not generate code to avoid bugs in the multiply instructions 10728 for the MN10300 processors. 10729 10730`-mam33' 10731 Generate code which uses features specific to the AM33 processor. 10732 10733`-mno-am33' 10734 Do not generate code which uses features specific to the AM33 10735 processor. This is the default. 10736 10737`-mreturn-pointer-on-d0' 10738 When generating a function which returns a pointer, return the 10739 pointer in both `a0' and `d0'. Otherwise, the pointer is returned 10740 only in a0, and attempts to call such functions without a prototype 10741 would result in errors. Note that this option is on by default; 10742 use `-mno-return-pointer-on-d0' to disable it. 10743 10744`-mno-crt0' 10745 Do not link in the C run-time initialization object file. 10746 10747`-mrelax' 10748 Indicate to the linker that it should perform a relaxation 10749 optimization pass to shorten branches, calls and absolute memory 10750 addresses. This option only has an effect when used on the 10751 command line for the final link step. 10752 10753 This option makes symbolic debugging impossible. 10754 10755 10756File: gcc.info, Node: MT Options, Next: PDP-11 Options, Prev: MN10300 Options, Up: Submodel Options 10757 107583.17.24 MT Options 10759------------------ 10760 10761These `-m' options are defined for Morpho MT architectures: 10762 10763`-march=CPU-TYPE' 10764 Generate code that will run on CPU-TYPE, which is the name of a 10765 system representing a certain processor type. Possible values for 10766 CPU-TYPE are `ms1-64-001', `ms1-16-002', `ms1-16-003' and `ms2'. 10767 10768 When this option is not used, the default is `-march=ms1-16-002'. 10769 10770`-mbacc' 10771 Use byte loads and stores when generating code. 10772 10773`-mno-bacc' 10774 Do not use byte loads and stores when generating code. 10775 10776`-msim' 10777 Use simulator runtime 10778 10779`-mno-crt0' 10780 Do not link in the C run-time initialization object file `crti.o'. 10781 Other run-time initialization and termination files such as 10782 `startup.o' and `exit.o' are still included on the linker command 10783 line. 10784 10785 10786 10787File: gcc.info, Node: PDP-11 Options, Next: PowerPC Options, Prev: MT Options, Up: Submodel Options 10788 107893.17.25 PDP-11 Options 10790---------------------- 10791 10792These options are defined for the PDP-11: 10793 10794`-mfpu' 10795 Use hardware FPP floating point. This is the default. (FIS 10796 floating point on the PDP-11/40 is not supported.) 10797 10798`-msoft-float' 10799 Do not use hardware floating point. 10800 10801`-mac0' 10802 Return floating-point results in ac0 (fr0 in Unix assembler 10803 syntax). 10804 10805`-mno-ac0' 10806 Return floating-point results in memory. This is the default. 10807 10808`-m40' 10809 Generate code for a PDP-11/40. 10810 10811`-m45' 10812 Generate code for a PDP-11/45. This is the default. 10813 10814`-m10' 10815 Generate code for a PDP-11/10. 10816 10817`-mbcopy-builtin' 10818 Use inline `movmemhi' patterns for copying memory. This is the 10819 default. 10820 10821`-mbcopy' 10822 Do not use inline `movmemhi' patterns for copying memory. 10823 10824`-mint16' 10825`-mno-int32' 10826 Use 16-bit `int'. This is the default. 10827 10828`-mint32' 10829`-mno-int16' 10830 Use 32-bit `int'. 10831 10832`-mfloat64' 10833`-mno-float32' 10834 Use 64-bit `float'. This is the default. 10835 10836`-mfloat32' 10837`-mno-float64' 10838 Use 32-bit `float'. 10839 10840`-mabshi' 10841 Use `abshi2' pattern. This is the default. 10842 10843`-mno-abshi' 10844 Do not use `abshi2' pattern. 10845 10846`-mbranch-expensive' 10847 Pretend that branches are expensive. This is for experimenting 10848 with code generation only. 10849 10850`-mbranch-cheap' 10851 Do not pretend that branches are expensive. This is the default. 10852 10853`-msplit' 10854 Generate code for a system with split I&D. 10855 10856`-mno-split' 10857 Generate code for a system without split I&D. This is the default. 10858 10859`-munix-asm' 10860 Use Unix assembler syntax. This is the default when configured for 10861 `pdp11-*-bsd'. 10862 10863`-mdec-asm' 10864 Use DEC assembler syntax. This is the default when configured for 10865 any PDP-11 target other than `pdp11-*-bsd'. 10866 10867 10868File: gcc.info, Node: PowerPC Options, Next: RS/6000 and PowerPC Options, Prev: PDP-11 Options, Up: Submodel Options 10869 108703.17.26 PowerPC Options 10871----------------------- 10872 10873These are listed under *Note RS/6000 and PowerPC Options::. 10874 10875 10876File: gcc.info, Node: RS/6000 and PowerPC Options, Next: S/390 and zSeries Options, Prev: PowerPC Options, Up: Submodel Options 10877 108783.17.27 IBM RS/6000 and PowerPC Options 10879--------------------------------------- 10880 10881These `-m' options are defined for the IBM RS/6000 and PowerPC: 10882`-mpower' 10883`-mno-power' 10884`-mpower2' 10885`-mno-power2' 10886`-mpowerpc' 10887`-mno-powerpc' 10888`-mpowerpc-gpopt' 10889`-mno-powerpc-gpopt' 10890`-mpowerpc-gfxopt' 10891`-mno-powerpc-gfxopt' 10892`-mpowerpc64' 10893`-mno-powerpc64' 10894`-mmfcrf' 10895`-mno-mfcrf' 10896`-mpopcntb' 10897`-mno-popcntb' 10898`-mfprnd' 10899`-mno-fprnd' 10900 GCC supports two related instruction set architectures for the 10901 RS/6000 and PowerPC. The "POWER" instruction set are those 10902 instructions supported by the `rios' chip set used in the original 10903 RS/6000 systems and the "PowerPC" instruction set is the 10904 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx 10905 microprocessors, and the IBM 4xx, 6xx, and follow-on 10906 microprocessors. 10907 10908 Neither architecture is a subset of the other. However there is a 10909 large common subset of instructions supported by both. An MQ 10910 register is included in processors supporting the POWER 10911 architecture. 10912 10913 You use these options to specify which instructions are available 10914 on the processor you are using. The default value of these 10915 options is determined when configuring GCC. Specifying the 10916 `-mcpu=CPU_TYPE' overrides the specification of these options. We 10917 recommend you use the `-mcpu=CPU_TYPE' option rather than the 10918 options listed above. 10919 10920 The `-mpower' option allows GCC to generate instructions that are 10921 found only in the POWER architecture and to use the MQ register. 10922 Specifying `-mpower2' implies `-power' and also allows GCC to 10923 generate instructions that are present in the POWER2 architecture 10924 but not the original POWER architecture. 10925 10926 The `-mpowerpc' option allows GCC to generate instructions that 10927 are found only in the 32-bit subset of the PowerPC architecture. 10928 Specifying `-mpowerpc-gpopt' implies `-mpowerpc' and also allows 10929 GCC to use the optional PowerPC architecture instructions in the 10930 General Purpose group, including floating-point square root. 10931 Specifying `-mpowerpc-gfxopt' implies `-mpowerpc' and also allows 10932 GCC to use the optional PowerPC architecture instructions in the 10933 Graphics group, including floating-point select. 10934 10935 The `-mmfcrf' option allows GCC to generate the move from 10936 condition register field instruction implemented on the POWER4 10937 processor and other processors that support the PowerPC V2.01 10938 architecture. The `-mpopcntb' option allows GCC to generate the 10939 popcount and double precision FP reciprocal estimate instruction 10940 implemented on the POWER5 processor and other processors that 10941 support the PowerPC V2.02 architecture. The `-mfprnd' option 10942 allows GCC to generate the FP round to integer instructions 10943 implemented on the POWER5+ processor and other processors that 10944 support the PowerPC V2.03 architecture. 10945 10946 The `-mpowerpc64' option allows GCC to generate the additional 10947 64-bit instructions that are found in the full PowerPC64 10948 architecture and to treat GPRs as 64-bit, doubleword quantities. 10949 GCC defaults to `-mno-powerpc64'. 10950 10951 If you specify both `-mno-power' and `-mno-powerpc', GCC will use 10952 only the instructions in the common subset of both architectures 10953 plus some special AIX common-mode calls, and will not use the MQ 10954 register. Specifying both `-mpower' and `-mpowerpc' permits GCC 10955 to use any instruction from either architecture and to allow use 10956 of the MQ register; specify this for the Motorola MPC601. 10957 10958`-mnew-mnemonics' 10959`-mold-mnemonics' 10960 Select which mnemonics to use in the generated assembler code. 10961 With `-mnew-mnemonics', GCC uses the assembler mnemonics defined 10962 for the PowerPC architecture. With `-mold-mnemonics' it uses the 10963 assembler mnemonics defined for the POWER architecture. 10964 Instructions defined in only one architecture have only one 10965 mnemonic; GCC uses that mnemonic irrespective of which of these 10966 options is specified. 10967 10968 GCC defaults to the mnemonics appropriate for the architecture in 10969 use. Specifying `-mcpu=CPU_TYPE' sometimes overrides the value of 10970 these option. Unless you are building a cross-compiler, you 10971 should normally not specify either `-mnew-mnemonics' or 10972 `-mold-mnemonics', but should instead accept the default. 10973 10974`-mcpu=CPU_TYPE' 10975 Set architecture type, register usage, choice of mnemonics, and 10976 instruction scheduling parameters for machine type CPU_TYPE. 10977 Supported values for CPU_TYPE are `401', `403', `405', `405fp', 10978 `440', `440fp', `505', `601', `602', `603', `603e', `604', `604e', 10979 `620', `630', `740', `7400', `7450', `750', `801', `821', `823', 10980 `860', `970', `8540', `ec603e', `G3', `G4', `G5', `power', 10981 `power2', `power3', `power4', `power5', `power5+', `power6', 10982 `common', `powerpc', `powerpc64', `rios', `rios1', `rios2', `rsc', 10983 and `rs64'. 10984 10985 `-mcpu=common' selects a completely generic processor. Code 10986 generated under this option will run on any POWER or PowerPC 10987 processor. GCC will use only the instructions in the common 10988 subset of both architectures, and will not use the MQ register. 10989 GCC assumes a generic processor model for scheduling purposes. 10990 10991 `-mcpu=power', `-mcpu=power2', `-mcpu=powerpc', and 10992 `-mcpu=powerpc64' specify generic POWER, POWER2, pure 32-bit 10993 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine 10994 types, with an appropriate, generic processor model assumed for 10995 scheduling purposes. 10996 10997 The other options specify a specific processor. Code generated 10998 under those options will run best on that processor, and may not 10999 run at all on others. 11000 11001 The `-mcpu' options automatically enable or disable the following 11002 options: `-maltivec', `-mfprnd', `-mhard-float', `-mmfcrf', 11003 `-mmultiple', `-mnew-mnemonics', `-mpopcntb', `-mpower', 11004 `-mpower2', `-mpowerpc64', `-mpowerpc-gpopt', `-mpowerpc-gfxopt', 11005 `-mstring', `-mmulhw', `-mdlmzb'. The particular options set for 11006 any particular CPU will vary between compiler versions, depending 11007 on what setting seems to produce optimal code for that CPU; it 11008 doesn't necessarily reflect the actual hardware's capabilities. If 11009 you wish to set an individual option to a particular value, you may 11010 specify it after the `-mcpu' option, like `-mcpu=970 -mno-altivec'. 11011 11012 On AIX, the `-maltivec' and `-mpowerpc64' options are not enabled 11013 or disabled by the `-mcpu' option at present because AIX does not 11014 have full support for these options. You may still enable or 11015 disable them individually if you're sure it'll work in your 11016 environment. 11017 11018`-mtune=CPU_TYPE' 11019 Set the instruction scheduling parameters for machine type 11020 CPU_TYPE, but do not set the architecture type, register usage, or 11021 choice of mnemonics, as `-mcpu=CPU_TYPE' would. The same values 11022 for CPU_TYPE are used for `-mtune' as for `-mcpu'. If both are 11023 specified, the code generated will use the architecture, 11024 registers, and mnemonics set by `-mcpu', but the scheduling 11025 parameters set by `-mtune'. 11026 11027`-mswdiv' 11028`-mno-swdiv' 11029 Generate code to compute division as reciprocal estimate and 11030 iterative refinement, creating opportunities for increased 11031 throughput. This feature requires: optional PowerPC Graphics 11032 instruction set for single precision and FRE instruction for 11033 double precision, assuming divides cannot generate user-visible 11034 traps, and the domain values not include Infinities, denormals or 11035 zero denominator. 11036 11037`-maltivec' 11038`-mno-altivec' 11039 Generate code that uses (does not use) AltiVec instructions, and 11040 also enable the use of built-in functions that allow more direct 11041 access to the AltiVec instruction set. You may also need to set 11042 `-mabi=altivec' to adjust the current ABI with AltiVec ABI 11043 enhancements. 11044 11045`-mvrsave' 11046 11047`-mno-vrsave' 11048 Generate VRSAVE instructions when generating AltiVec code. 11049 11050`-msecure-plt' 11051 Generate code that allows ld and ld.so to build executables and 11052 shared libraries with non-exec .plt and .got sections. This is a 11053 PowerPC 32-bit SYSV ABI option. 11054 11055`-mbss-plt' 11056 Generate code that uses a BSS .plt section that ld.so fills in, and 11057 requires .plt and .got sections that are both writable and 11058 executable. This is a PowerPC 32-bit SYSV ABI option. 11059 11060`-misel' 11061`-mno-isel' 11062 This switch enables or disables the generation of ISEL 11063 instructions. 11064 11065`-misel=YES/NO' 11066 This switch has been deprecated. Use `-misel' and `-mno-isel' 11067 instead. 11068 11069`-mspe' 11070`-mno-spe' 11071 This switch enables or disables the generation of SPE simd 11072 instructions. 11073 11074`-mspe=YES/NO' 11075 This option has been deprecated. Use `-mspe' and `-mno-spe' 11076 instead. 11077 11078`-mfloat-gprs=YES/SINGLE/DOUBLE/NO' 11079`-mfloat-gprs' 11080 This switch enables or disables the generation of floating point 11081 operations on the general purpose registers for architectures that 11082 support it. 11083 11084 The argument YES or SINGLE enables the use of single-precision 11085 floating point operations. 11086 11087 The argument DOUBLE enables the use of single and double-precision 11088 floating point operations. 11089 11090 The argument NO disables floating point operations on the general 11091 purpose registers. 11092 11093 This option is currently only available on the MPC854x. 11094 11095`-m32' 11096`-m64' 11097 Generate code for 32-bit or 64-bit environments of Darwin and SVR4 11098 targets (including GNU/Linux). The 32-bit environment sets int, 11099 long and pointer to 32 bits and generates code that runs on any 11100 PowerPC variant. The 64-bit environment sets int to 32 bits and 11101 long and pointer to 64 bits, and generates code for PowerPC64, as 11102 for `-mpowerpc64'. 11103 11104`-mfull-toc' 11105`-mno-fp-in-toc' 11106`-mno-sum-in-toc' 11107`-mminimal-toc' 11108 Modify generation of the TOC (Table Of Contents), which is created 11109 for every executable file. The `-mfull-toc' option is selected by 11110 default. In that case, GCC will allocate at least one TOC entry 11111 for each unique non-automatic variable reference in your program. 11112 GCC will also place floating-point constants in the TOC. However, 11113 only 16,384 entries are available in the TOC. 11114 11115 If you receive a linker error message that saying you have 11116 overflowed the available TOC space, you can reduce the amount of 11117 TOC space used with the `-mno-fp-in-toc' and `-mno-sum-in-toc' 11118 options. `-mno-fp-in-toc' prevents GCC from putting floating-point 11119 constants in the TOC and `-mno-sum-in-toc' forces GCC to generate 11120 code to calculate the sum of an address and a constant at run-time 11121 instead of putting that sum into the TOC. You may specify one or 11122 both of these options. Each causes GCC to produce very slightly 11123 slower and larger code at the expense of conserving TOC space. 11124 11125 If you still run out of space in the TOC even when you specify 11126 both of these options, specify `-mminimal-toc' instead. This 11127 option causes GCC to make only one TOC entry for every file. When 11128 you specify this option, GCC will produce code that is slower and 11129 larger but which uses extremely little TOC space. You may wish to 11130 use this option only on files that contain less frequently 11131 executed code. 11132 11133`-maix64' 11134`-maix32' 11135 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 11136 64-bit `long' type, and the infrastructure needed to support them. 11137 Specifying `-maix64' implies `-mpowerpc64' and `-mpowerpc', while 11138 `-maix32' disables the 64-bit ABI and implies `-mno-powerpc64'. 11139 GCC defaults to `-maix32'. 11140 11141`-mxl-compat' 11142`-mno-xl-compat' 11143 Produce code that conforms more closely to IBM XL compiler 11144 semantics when using AIX-compatible ABI. Pass floating-point 11145 arguments to prototyped functions beyond the register save area 11146 (RSA) on the stack in addition to argument FPRs. Do not assume 11147 that most significant double in 128-bit long double value is 11148 properly rounded when comparing values and converting to double. 11149 Use XL symbol names for long double support routines. 11150 11151 The AIX calling convention was extended but not initially 11152 documented to handle an obscure K&R C case of calling a function 11153 that takes the address of its arguments with fewer arguments than 11154 declared. IBM XL compilers access floating point arguments which 11155 do not fit in the RSA from the stack when a subroutine is compiled 11156 without optimization. Because always storing floating-point 11157 arguments on the stack is inefficient and rarely needed, this 11158 option is not enabled by default and only is necessary when 11159 calling subroutines compiled by IBM XL compilers without 11160 optimization. 11161 11162`-mpe' 11163 Support "IBM RS/6000 SP" "Parallel Environment" (PE). Link an 11164 application written to use message passing with special startup 11165 code to enable the application to run. The system must have PE 11166 installed in the standard location (`/usr/lpp/ppe.poe/'), or the 11167 `specs' file must be overridden with the `-specs=' option to 11168 specify the appropriate directory location. The Parallel 11169 Environment does not support threads, so the `-mpe' option and the 11170 `-pthread' option are incompatible. 11171 11172`-malign-natural' 11173`-malign-power' 11174 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option 11175 `-malign-natural' overrides the ABI-defined alignment of larger 11176 types, such as floating-point doubles, on their natural size-based 11177 boundary. The option `-malign-power' instructs GCC to follow the 11178 ABI-specified alignment rules. GCC defaults to the standard 11179 alignment defined in the ABI. 11180 11181 On 64-bit Darwin, natural alignment is the default, and 11182 `-malign-power' is not supported. 11183 11184`-msoft-float' 11185`-mhard-float' 11186 Generate code that does not use (uses) the floating-point register 11187 set. Software floating point emulation is provided if you use the 11188 `-msoft-float' option, and pass the option to GCC when linking. 11189 11190`-mmultiple' 11191`-mno-multiple' 11192 Generate code that uses (does not use) the load multiple word 11193 instructions and the store multiple word instructions. These 11194 instructions are generated by default on POWER systems, and not 11195 generated on PowerPC systems. Do not use `-mmultiple' on little 11196 endian PowerPC systems, since those instructions do not work when 11197 the processor is in little endian mode. The exceptions are PPC740 11198 and PPC750 which permit the instructions usage in little endian 11199 mode. 11200 11201`-mstring' 11202`-mno-string' 11203 Generate code that uses (does not use) the load string instructions 11204 and the store string word instructions to save multiple registers 11205 and do small block moves. These instructions are generated by 11206 default on POWER systems, and not generated on PowerPC systems. 11207 Do not use `-mstring' on little endian PowerPC systems, since those 11208 instructions do not work when the processor is in little endian 11209 mode. The exceptions are PPC740 and PPC750 which permit the 11210 instructions usage in little endian mode. 11211 11212`-mupdate' 11213`-mno-update' 11214 Generate code that uses (does not use) the load or store 11215 instructions that update the base register to the address of the 11216 calculated memory location. These instructions are generated by 11217 default. If you use `-mno-update', there is a small window 11218 between the time that the stack pointer is updated and the address 11219 of the previous frame is stored, which means code that walks the 11220 stack frame across interrupts or signals may get corrupted data. 11221 11222`-mfused-madd' 11223`-mno-fused-madd' 11224 Generate code that uses (does not use) the floating point multiply 11225 and accumulate instructions. These instructions are generated by 11226 default if hardware floating is used. 11227 11228`-mmulhw' 11229`-mno-mulhw' 11230 Generate code that uses (does not use) the half-word multiply and 11231 multiply-accumulate instructions on the IBM 405 and 440 processors. 11232 These instructions are generated by default when targetting those 11233 processors. 11234 11235`-mdlmzb' 11236`-mno-dlmzb' 11237 Generate code that uses (does not use) the string-search `dlmzb' 11238 instruction on the IBM 405 and 440 processors. This instruction is 11239 generated by default when targetting those processors. 11240 11241`-mno-bit-align' 11242`-mbit-align' 11243 On System V.4 and embedded PowerPC systems do not (do) force 11244 structures and unions that contain bit-fields to be aligned to the 11245 base type of the bit-field. 11246 11247 For example, by default a structure containing nothing but 8 11248 `unsigned' bit-fields of length 1 would be aligned to a 4 byte 11249 boundary and have a size of 4 bytes. By using `-mno-bit-align', 11250 the structure would be aligned to a 1 byte boundary and be one 11251 byte in size. 11252 11253`-mno-strict-align' 11254`-mstrict-align' 11255 On System V.4 and embedded PowerPC systems do not (do) assume that 11256 unaligned memory references will be handled by the system. 11257 11258`-mrelocatable' 11259`-mno-relocatable' 11260 On embedded PowerPC systems generate code that allows (does not 11261 allow) the program to be relocated to a different address at 11262 runtime. If you use `-mrelocatable' on any module, all objects 11263 linked together must be compiled with `-mrelocatable' or 11264 `-mrelocatable-lib'. 11265 11266`-mrelocatable-lib' 11267`-mno-relocatable-lib' 11268 On embedded PowerPC systems generate code that allows (does not 11269 allow) the program to be relocated to a different address at 11270 runtime. Modules compiled with `-mrelocatable-lib' can be linked 11271 with either modules compiled without `-mrelocatable' and 11272 `-mrelocatable-lib' or with modules compiled with the 11273 `-mrelocatable' options. 11274 11275`-mno-toc' 11276`-mtoc' 11277 On System V.4 and embedded PowerPC systems do not (do) assume that 11278 register 2 contains a pointer to a global area pointing to the 11279 addresses used in the program. 11280 11281`-mlittle' 11282`-mlittle-endian' 11283 On System V.4 and embedded PowerPC systems compile code for the 11284 processor in little endian mode. The `-mlittle-endian' option is 11285 the same as `-mlittle'. 11286 11287`-mbig' 11288`-mbig-endian' 11289 On System V.4 and embedded PowerPC systems compile code for the 11290 processor in big endian mode. The `-mbig-endian' option is the 11291 same as `-mbig'. 11292 11293`-mdynamic-no-pic' 11294 On Darwin and Mac OS X systems, compile code so that it is not 11295 relocatable, but that its external references are relocatable. The 11296 resulting code is suitable for applications, but not shared 11297 libraries. 11298 11299`-mprioritize-restricted-insns=PRIORITY' 11300 This option controls the priority that is assigned to 11301 dispatch-slot restricted instructions during the second scheduling 11302 pass. The argument PRIORITY takes the value 0/1/2 to assign 11303 NO/HIGHEST/SECOND-HIGHEST priority to dispatch slot restricted 11304 instructions. 11305 11306`-msched-costly-dep=DEPENDENCE_TYPE' 11307 This option controls which dependences are considered costly by 11308 the target during instruction scheduling. The argument 11309 DEPENDENCE_TYPE takes one of the following values: NO: no 11310 dependence is costly, ALL: all dependences are costly, 11311 TRUE_STORE_TO_LOAD: a true dependence from store to load is costly, 11312 STORE_TO_LOAD: any dependence from store to load is costly, 11313 NUMBER: any dependence which latency >= NUMBER is costly. 11314 11315`-minsert-sched-nops=SCHEME' 11316 This option controls which nop insertion scheme will be used during 11317 the second scheduling pass. The argument SCHEME takes one of the 11318 following values: NO: Don't insert nops. PAD: Pad with nops any 11319 dispatch group which has vacant issue slots, according to the 11320 scheduler's grouping. REGROUP_EXACT: Insert nops to force costly 11321 dependent insns into separate groups. Insert exactly as many nops 11322 as needed to force an insn to a new group, according to the 11323 estimated processor grouping. NUMBER: Insert nops to force costly 11324 dependent insns into separate groups. Insert NUMBER nops to force 11325 an insn to a new group. 11326 11327`-mcall-sysv' 11328 On System V.4 and embedded PowerPC systems compile code using 11329 calling conventions that adheres to the March 1995 draft of the 11330 System V Application Binary Interface, PowerPC processor 11331 supplement. This is the default unless you configured GCC using 11332 `powerpc-*-eabiaix'. 11333 11334`-mcall-sysv-eabi' 11335 Specify both `-mcall-sysv' and `-meabi' options. 11336 11337`-mcall-sysv-noeabi' 11338 Specify both `-mcall-sysv' and `-mno-eabi' options. 11339 11340`-mcall-solaris' 11341 On System V.4 and embedded PowerPC systems compile code for the 11342 Solaris operating system. 11343 11344`-mcall-linux' 11345 On System V.4 and embedded PowerPC systems compile code for the 11346 Linux-based GNU system. 11347 11348`-mcall-gnu' 11349 On System V.4 and embedded PowerPC systems compile code for the 11350 Hurd-based GNU system. 11351 11352`-mcall-netbsd' 11353 On System V.4 and embedded PowerPC systems compile code for the 11354 NetBSD operating system. 11355 11356`-maix-struct-return' 11357 Return all structures in memory (as specified by the AIX ABI). 11358 11359`-msvr4-struct-return' 11360 Return structures smaller than 8 bytes in registers (as specified 11361 by the SVR4 ABI). 11362 11363`-mabi=ABI-TYPE' 11364 Extend the current ABI with a particular extension, or remove such 11365 extension. Valid values are ALTIVEC, NO-ALTIVEC, SPE, NO-SPE, 11366 IBMLONGDOUBLE, IEEELONGDOUBLE. 11367 11368`-mabi=spe' 11369 Extend the current ABI with SPE ABI extensions. This does not 11370 change the default ABI, instead it adds the SPE ABI extensions to 11371 the current ABI. 11372 11373`-mabi=no-spe' 11374 Disable Booke SPE ABI extensions for the current ABI. 11375 11376`-mabi=ibmlongdouble' 11377 Change the current ABI to use IBM extended precision long double. 11378 This is a PowerPC 32-bit SYSV ABI option. 11379 11380`-mabi=ieeelongdouble' 11381 Change the current ABI to use IEEE extended precision long double. 11382 This is a PowerPC 32-bit Linux ABI option. 11383 11384`-mprototype' 11385`-mno-prototype' 11386 On System V.4 and embedded PowerPC systems assume that all calls to 11387 variable argument functions are properly prototyped. Otherwise, 11388 the compiler must insert an instruction before every non 11389 prototyped call to set or clear bit 6 of the condition code 11390 register (CR) to indicate whether floating point values were 11391 passed in the floating point registers in case the function takes 11392 a variable arguments. With `-mprototype', only calls to 11393 prototyped variable argument functions will set or clear the bit. 11394 11395`-msim' 11396 On embedded PowerPC systems, assume that the startup module is 11397 called `sim-crt0.o' and that the standard C libraries are 11398 `libsim.a' and `libc.a'. This is the default for 11399 `powerpc-*-eabisim'. configurations. 11400 11401`-mmvme' 11402 On embedded PowerPC systems, assume that the startup module is 11403 called `crt0.o' and the standard C libraries are `libmvme.a' and 11404 `libc.a'. 11405 11406`-mads' 11407 On embedded PowerPC systems, assume that the startup module is 11408 called `crt0.o' and the standard C libraries are `libads.a' and 11409 `libc.a'. 11410 11411`-myellowknife' 11412 On embedded PowerPC systems, assume that the startup module is 11413 called `crt0.o' and the standard C libraries are `libyk.a' and 11414 `libc.a'. 11415 11416`-mvxworks' 11417 On System V.4 and embedded PowerPC systems, specify that you are 11418 compiling for a VxWorks system. 11419 11420`-mwindiss' 11421 Specify that you are compiling for the WindISS simulation 11422 environment. 11423 11424`-memb' 11425 On embedded PowerPC systems, set the PPC_EMB bit in the ELF flags 11426 header to indicate that `eabi' extended relocations are used. 11427 11428`-meabi' 11429`-mno-eabi' 11430 On System V.4 and embedded PowerPC systems do (do not) adhere to 11431 the Embedded Applications Binary Interface (eabi) which is a set of 11432 modifications to the System V.4 specifications. Selecting `-meabi' 11433 means that the stack is aligned to an 8 byte boundary, a function 11434 `__eabi' is called to from `main' to set up the eabi environment, 11435 and the `-msdata' option can use both `r2' and `r13' to point to 11436 two separate small data areas. Selecting `-mno-eabi' means that 11437 the stack is aligned to a 16 byte boundary, do not call an 11438 initialization function from `main', and the `-msdata' option will 11439 only use `r13' to point to a single small data area. The `-meabi' 11440 option is on by default if you configured GCC using one of the 11441 `powerpc*-*-eabi*' options. 11442 11443`-msdata=eabi' 11444 On System V.4 and embedded PowerPC systems, put small initialized 11445 `const' global and static data in the `.sdata2' section, which is 11446 pointed to by register `r2'. Put small initialized non-`const' 11447 global and static data in the `.sdata' section, which is pointed 11448 to by register `r13'. Put small uninitialized global and static 11449 data in the `.sbss' section, which is adjacent to the `.sdata' 11450 section. The `-msdata=eabi' option is incompatible with the 11451 `-mrelocatable' option. The `-msdata=eabi' option also sets the 11452 `-memb' option. 11453 11454`-msdata=sysv' 11455 On System V.4 and embedded PowerPC systems, put small global and 11456 static data in the `.sdata' section, which is pointed to by 11457 register `r13'. Put small uninitialized global and static data in 11458 the `.sbss' section, which is adjacent to the `.sdata' section. 11459 The `-msdata=sysv' option is incompatible with the `-mrelocatable' 11460 option. 11461 11462`-msdata=default' 11463`-msdata' 11464 On System V.4 and embedded PowerPC systems, if `-meabi' is used, 11465 compile code the same as `-msdata=eabi', otherwise compile code the 11466 same as `-msdata=sysv'. 11467 11468`-msdata-data' 11469 On System V.4 and embedded PowerPC systems, put small global data 11470 in the `.sdata' section. Put small uninitialized global data in 11471 the `.sbss' section. Do not use register `r13' to address small 11472 data however. This is the default behavior unless other `-msdata' 11473 options are used. 11474 11475`-msdata=none' 11476`-mno-sdata' 11477 On embedded PowerPC systems, put all initialized global and static 11478 data in the `.data' section, and all uninitialized data in the 11479 `.bss' section. 11480 11481`-G NUM' 11482 On embedded PowerPC systems, put global and static items less than 11483 or equal to NUM bytes into the small data or bss sections instead 11484 of the normal data or bss section. By default, NUM is 8. The `-G 11485 NUM' switch is also passed to the linker. All modules should be 11486 compiled with the same `-G NUM' value. 11487 11488`-mregnames' 11489`-mno-regnames' 11490 On System V.4 and embedded PowerPC systems do (do not) emit 11491 register names in the assembly language output using symbolic 11492 forms. 11493 11494`-mlongcall' 11495`-mno-longcall' 11496 By default assume that all calls are far away so that a longer more 11497 expensive calling sequence is required. This is required for calls 11498 further than 32 megabytes (33,554,432 bytes) from the current 11499 location. A short call will be generated if the compiler knows 11500 the call cannot be that far away. This setting can be overridden 11501 by the `shortcall' function attribute, or by `#pragma longcall(0)'. 11502 11503 Some linkers are capable of detecting out-of-range calls and 11504 generating glue code on the fly. On these systems, long calls are 11505 unnecessary and generate slower code. As of this writing, the AIX 11506 linker can do this, as can the GNU linker for PowerPC/64. It is 11507 planned to add this feature to the GNU linker for 32-bit PowerPC 11508 systems as well. 11509 11510 On Darwin/PPC systems, `#pragma longcall' will generate "jbsr 11511 callee, L42", plus a "branch island" (glue code). The two target 11512 addresses represent the callee and the "branch island". The 11513 Darwin/PPC linker will prefer the first address and generate a "bl 11514 callee" if the PPC "bl" instruction will reach the callee directly; 11515 otherwise, the linker will generate "bl L42" to call the "branch 11516 island". The "branch island" is appended to the body of the 11517 calling function; it computes the full 32-bit address of the callee 11518 and jumps to it. 11519 11520 On Mach-O (Darwin) systems, this option directs the compiler emit 11521 to the glue for every direct call, and the Darwin linker decides 11522 whether to use or discard it. 11523 11524 In the future, we may cause GCC to ignore all longcall 11525 specifications when the linker is known to generate glue. 11526 11527`-pthread' 11528 Adds support for multithreading with the "pthreads" library. This 11529 option sets flags for both the preprocessor and linker. 11530 11531 11532 11533File: gcc.info, Node: S/390 and zSeries Options, Next: Score Options, Prev: RS/6000 and PowerPC Options, Up: Submodel Options 11534 115353.17.28 S/390 and zSeries Options 11536--------------------------------- 11537 11538These are the `-m' options defined for the S/390 and zSeries 11539architecture. 11540 11541`-mhard-float' 11542`-msoft-float' 11543 Use (do not use) the hardware floating-point instructions and 11544 registers for floating-point operations. When `-msoft-float' is 11545 specified, functions in `libgcc.a' will be used to perform 11546 floating-point operations. When `-mhard-float' is specified, the 11547 compiler generates IEEE floating-point instructions. This is the 11548 default. 11549 11550`-mlong-double-64' 11551`-mlong-double-128' 11552 These switches control the size of `long double' type. A size of 11553 64bit makes the `long double' type equivalent to the `double' 11554 type. This is the default. 11555 11556`-mbackchain' 11557`-mno-backchain' 11558 Store (do not store) the address of the caller's frame as 11559 backchain pointer into the callee's stack frame. A backchain may 11560 be needed to allow debugging using tools that do not understand 11561 DWARF-2 call frame information. When `-mno-packed-stack' is in 11562 effect, the backchain pointer is stored at the bottom of the stack 11563 frame; when `-mpacked-stack' is in effect, the backchain is placed 11564 into the topmost word of the 96/160 byte register save area. 11565 11566 In general, code compiled with `-mbackchain' is call-compatible 11567 with code compiled with `-mmo-backchain'; however, use of the 11568 backchain for debugging purposes usually requires that the whole 11569 binary is built with `-mbackchain'. Note that the combination of 11570 `-mbackchain', `-mpacked-stack' and `-mhard-float' is not 11571 supported. In order to build a linux kernel use `-msoft-float'. 11572 11573 The default is to not maintain the backchain. 11574 11575`-mpacked-stack' 11576 11577`-mno-packed-stack' 11578 Use (do not use) the packed stack layout. When 11579 `-mno-packed-stack' is specified, the compiler uses the all fields 11580 of the 96/160 byte register save area only for their default 11581 purpose; unused fields still take up stack space. When 11582 `-mpacked-stack' is specified, register save slots are densely 11583 packed at the top of the register save area; unused space is 11584 reused for other purposes, allowing for more efficient use of the 11585 available stack space. However, when `-mbackchain' is also in 11586 effect, the topmost word of the save area is always used to store 11587 the backchain, and the return address register is always saved two 11588 words below the backchain. 11589 11590 As long as the stack frame backchain is not used, code generated 11591 with `-mpacked-stack' is call-compatible with code generated with 11592 `-mno-packed-stack'. Note that some non-FSF releases of GCC 2.95 11593 for S/390 or zSeries generated code that uses the stack frame 11594 backchain at run time, not just for debugging purposes. Such code 11595 is not call-compatible with code compiled with `-mpacked-stack'. 11596 Also, note that the combination of `-mbackchain', `-mpacked-stack' 11597 and `-mhard-float' is not supported. In order to build a linux 11598 kernel use `-msoft-float'. 11599 11600 The default is to not use the packed stack layout. 11601 11602`-msmall-exec' 11603`-mno-small-exec' 11604 Generate (or do not generate) code using the `bras' instruction to 11605 do subroutine calls. This only works reliably if the total 11606 executable size does not exceed 64k. The default is to use the 11607 `basr' instruction instead, which does not have this limitation. 11608 11609`-m64' 11610`-m31' 11611 When `-m31' is specified, generate code compliant to the GNU/Linux 11612 for S/390 ABI. When `-m64' is specified, generate code compliant 11613 to the GNU/Linux for zSeries ABI. This allows GCC in particular 11614 to generate 64-bit instructions. For the `s390' targets, the 11615 default is `-m31', while the `s390x' targets default to `-m64'. 11616 11617`-mzarch' 11618`-mesa' 11619 When `-mzarch' is specified, generate code using the instructions 11620 available on z/Architecture. When `-mesa' is specified, generate 11621 code using the instructions available on ESA/390. Note that 11622 `-mesa' is not possible with `-m64'. When generating code 11623 compliant to the GNU/Linux for S/390 ABI, the default is `-mesa'. 11624 When generating code compliant to the GNU/Linux for zSeries ABI, 11625 the default is `-mzarch'. 11626 11627`-mmvcle' 11628`-mno-mvcle' 11629 Generate (or do not generate) code using the `mvcle' instruction 11630 to perform block moves. When `-mno-mvcle' is specified, use a 11631 `mvc' loop instead. This is the default unless optimizing for 11632 size. 11633 11634`-mdebug' 11635`-mno-debug' 11636 Print (or do not print) additional debug information when 11637 compiling. The default is to not print debug information. 11638 11639`-march=CPU-TYPE' 11640 Generate code that will run on CPU-TYPE, which is the name of a 11641 system representing a certain processor type. Possible values for 11642 CPU-TYPE are `g5', `g6', `z900', and `z990'. When generating code 11643 using the instructions available on z/Architecture, the default is 11644 `-march=z900'. Otherwise, the default is `-march=g5'. 11645 11646`-mtune=CPU-TYPE' 11647 Tune to CPU-TYPE everything applicable about the generated code, 11648 except for the ABI and the set of available instructions. The 11649 list of CPU-TYPE values is the same as for `-march'. The default 11650 is the value used for `-march'. 11651 11652`-mtpf-trace' 11653`-mno-tpf-trace' 11654 Generate code that adds (does not add) in TPF OS specific branches 11655 to trace routines in the operating system. This option is off by 11656 default, even when compiling for the TPF OS. 11657 11658`-mfused-madd' 11659`-mno-fused-madd' 11660 Generate code that uses (does not use) the floating point multiply 11661 and accumulate instructions. These instructions are generated by 11662 default if hardware floating point is used. 11663 11664`-mwarn-framesize=FRAMESIZE' 11665 Emit a warning if the current function exceeds the given frame 11666 size. Because this is a compile time check it doesn't need to be 11667 a real problem when the program runs. It is intended to identify 11668 functions which most probably cause a stack overflow. It is 11669 useful to be used in an environment with limited stack size e.g. 11670 the linux kernel. 11671 11672`-mwarn-dynamicstack' 11673 Emit a warning if the function calls alloca or uses dynamically 11674 sized arrays. This is generally a bad idea with a limited stack 11675 size. 11676 11677`-mstack-guard=STACK-GUARD' 11678 11679`-mstack-size=STACK-SIZE' 11680 These arguments always have to be used in conjunction. If they 11681 are present the s390 back end emits additional instructions in the 11682 function prologue which trigger a trap if the stack size is 11683 STACK-GUARD bytes above the STACK-SIZE (remember that the stack on 11684 s390 grows downward). These options are intended to be used to 11685 help debugging stack overflow problems. The additionally emitted 11686 code causes only little overhead and hence can also be used in 11687 production like systems without greater performance degradation. 11688 The given values have to be exact powers of 2 and STACK-SIZE has 11689 to be greater than STACK-GUARD without exceeding 64k. In order to 11690 be efficient the extra code makes the assumption that the stack 11691 starts at an address aligned to the value given by STACK-SIZE. 11692 11693 11694File: gcc.info, Node: Score Options, Next: SH Options, Prev: S/390 and zSeries Options, Up: Submodel Options 11695 116963.17.29 Score Options 11697--------------------- 11698 11699These options are defined for Score implementations: 11700 11701`-meb' 11702 Compile code for big endian mode. This is the default. 11703 11704`-mel' 11705 Compile code for little endian mode. 11706 11707`-mnhwloop' 11708 Disable generate bcnz instruction. 11709 11710`-muls' 11711 Enable generate unaligned load and store instruction. 11712 11713`-mmac' 11714 Enable the use of multiply-accumulate instructions. Disabled by 11715 default. 11716 11717`-mscore5' 11718 Specify the SCORE5 as the target architecture. 11719 11720`-mscore5u' 11721 Specify the SCORE5U of the target architecture. 11722 11723`-mscore7' 11724 Specify the SCORE7 as the target architecture. This is the default. 11725 11726`-mscore7d' 11727 Specify the SCORE7D as the target architecture. 11728 11729 11730File: gcc.info, Node: SH Options, Next: SPARC Options, Prev: Score Options, Up: Submodel Options 11731 117323.17.30 SH Options 11733------------------ 11734 11735These `-m' options are defined for the SH implementations: 11736 11737`-m1' 11738 Generate code for the SH1. 11739 11740`-m2' 11741 Generate code for the SH2. 11742 11743`-m2e' 11744 Generate code for the SH2e. 11745 11746`-m3' 11747 Generate code for the SH3. 11748 11749`-m3e' 11750 Generate code for the SH3e. 11751 11752`-m4-nofpu' 11753 Generate code for the SH4 without a floating-point unit. 11754 11755`-m4-single-only' 11756 Generate code for the SH4 with a floating-point unit that only 11757 supports single-precision arithmetic. 11758 11759`-m4-single' 11760 Generate code for the SH4 assuming the floating-point unit is in 11761 single-precision mode by default. 11762 11763`-m4' 11764 Generate code for the SH4. 11765 11766`-m4a-nofpu' 11767 Generate code for the SH4al-dsp, or for a SH4a in such a way that 11768 the floating-point unit is not used. 11769 11770`-m4a-single-only' 11771 Generate code for the SH4a, in such a way that no double-precision 11772 floating point operations are used. 11773 11774`-m4a-single' 11775 Generate code for the SH4a assuming the floating-point unit is in 11776 single-precision mode by default. 11777 11778`-m4a' 11779 Generate code for the SH4a. 11780 11781`-m4al' 11782 Same as `-m4a-nofpu', except that it implicitly passes `-dsp' to 11783 the assembler. GCC doesn't generate any DSP instructions at the 11784 moment. 11785 11786`-mb' 11787 Compile code for the processor in big endian mode. 11788 11789`-ml' 11790 Compile code for the processor in little endian mode. 11791 11792`-mdalign' 11793 Align doubles at 64-bit boundaries. Note that this changes the 11794 calling conventions, and thus some functions from the standard C 11795 library will not work unless you recompile it first with 11796 `-mdalign'. 11797 11798`-mrelax' 11799 Shorten some address references at link time, when possible; uses 11800 the linker option `-relax'. 11801 11802`-mbigtable' 11803 Use 32-bit offsets in `switch' tables. The default is to use 11804 16-bit offsets. 11805 11806`-mfmovd' 11807 Enable the use of the instruction `fmovd'. 11808 11809`-mhitachi' 11810 Comply with the calling conventions defined by Renesas. 11811 11812`-mrenesas' 11813 Comply with the calling conventions defined by Renesas. 11814 11815`-mno-renesas' 11816 Comply with the calling conventions defined for GCC before the 11817 Renesas conventions were available. This option is the default 11818 for all targets of the SH toolchain except for `sh-symbianelf'. 11819 11820`-mnomacsave' 11821 Mark the `MAC' register as call-clobbered, even if `-mhitachi' is 11822 given. 11823 11824`-mieee' 11825 Increase IEEE-compliance of floating-point code. At the moment, 11826 this is equivalent to `-fno-finite-math-only'. When generating 16 11827 bit SH opcodes, getting IEEE-conforming results for comparisons of 11828 NANs / infinities incurs extra overhead in every floating point 11829 comparison, therefore the default is set to `-ffinite-math-only'. 11830 11831`-misize' 11832 Dump instruction size and location in the assembly code. 11833 11834`-mpadstruct' 11835 This option is deprecated. It pads structures to multiple of 4 11836 bytes, which is incompatible with the SH ABI. 11837 11838`-mspace' 11839 Optimize for space instead of speed. Implied by `-Os'. 11840 11841`-mprefergot' 11842 When generating position-independent code, emit function calls 11843 using the Global Offset Table instead of the Procedure Linkage 11844 Table. 11845 11846`-musermode' 11847 Generate a library function call to invalidate instruction cache 11848 entries, after fixing up a trampoline. This library function call 11849 doesn't assume it can write to the whole memory address space. 11850 This is the default when the target is `sh-*-linux*'. 11851 11852`-multcost=NUMBER' 11853 Set the cost to assume for a multiply insn. 11854 11855`-mdiv=STRATEGY' 11856 Set the division strategy to use for SHmedia code. STRATEGY must 11857 be one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, 11858 inv:call, inv:call2, inv:fp . "fp" performs the operation in 11859 floating point. This has a very high latency, but needs only a 11860 few instructions, so it might be a good choice if your code has 11861 enough easily exploitable ILP to allow the compiler to schedule 11862 the floating point instructions together with other instructions. 11863 Division by zero causes a floating point exception. "inv" uses 11864 integer operations to calculate the inverse of the divisor, and 11865 then multiplies the dividend with the inverse. This strategy 11866 allows cse and hoisting of the inverse calculation. Division by 11867 zero calculates an unspecified result, but does not trap. 11868 "inv:minlat" is a variant of "inv" where if no cse / hoisting 11869 opportunities have been found, or if the entire operation has been 11870 hoisted to the same place, the last stages of the inverse 11871 calculation are intertwined with the final multiply to reduce the 11872 overall latency, at the expense of using a few more instructions, 11873 and thus offering fewer scheduling opportunities with other code. 11874 "call" calls a library function that usually implements the 11875 inv:minlat strategy. This gives high code density for 11876 m5-*media-nofpu compilations. "call2" uses a different entry 11877 point of the same library function, where it assumes that a 11878 pointer to a lookup table has already been set up, which exposes 11879 the pointer load to cse / code hoisting optimizations. 11880 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm 11881 for initial code generation, but if the code stays unoptimized, 11882 revert to the "call", "call2", or "fp" strategies, respectively. 11883 Note that the potentially-trapping side effect of division by zero 11884 is carried by a separate instruction, so it is possible that all 11885 the integer instructions are hoisted out, but the marker for the 11886 side effect stays where it is. A recombination to fp operations 11887 or a call is not possible in that case. "inv20u" and "inv20l" are 11888 variants of the "inv:minlat" strategy. In the case that the 11889 inverse calculation was nor separated from the multiply, they speed 11890 up division where the dividend fits into 20 bits (plus sign where 11891 applicable), by inserting a test to skip a number of operations in 11892 this case; this test slows down the case of larger dividends. 11893 inv20u assumes the case of a such a small dividend to be unlikely, 11894 and inv20l assumes it to be likely. 11895 11896`-mdivsi3_libfunc=NAME' 11897 Set the name of the library function used for 32 bit signed 11898 division to NAME. This only affect the name used in the call and 11899 inv:call division strategies, and the compiler will still expect 11900 the same sets of input/output/clobbered registers as if this 11901 option was not present. 11902 11903`-madjust-unroll' 11904 Throttle unrolling to avoid thrashing target registers. This 11905 option only has an effect if the gcc code base supports the 11906 TARGET_ADJUST_UNROLL_MAX target hook. 11907 11908`-mindexed-addressing' 11909 Enable the use of the indexed addressing mode for 11910 SHmedia32/SHcompact. This is only safe if the hardware and/or OS 11911 implement 32 bit wrap-around semantics for the indexed addressing 11912 mode. The architecture allows the implementation of processors 11913 with 64 bit MMU, which the OS could use to get 32 bit addressing, 11914 but since no current hardware implementation supports this or any 11915 other way to make the indexed addressing mode safe to use in the 11916 32 bit ABI, the default is -mno-indexed-addressing. 11917 11918`-mgettrcost=NUMBER' 11919 Set the cost assumed for the gettr instruction to NUMBER. The 11920 default is 2 if `-mpt-fixed' is in effect, 100 otherwise. 11921 11922`-mpt-fixed' 11923 Assume pt* instructions won't trap. This will generally generate 11924 better scheduled code, but is unsafe on current hardware. The 11925 current architecture definition says that ptabs and ptrel trap 11926 when the target anded with 3 is 3. This has the unintentional 11927 effect of making it unsafe to schedule ptabs / ptrel before a 11928 branch, or hoist it out of a loop. For example, 11929 __do_global_ctors, a part of libgcc that runs constructors at 11930 program startup, calls functions in a list which is delimited by 11931 -1. With the -mpt-fixed option, the ptabs will be done before 11932 testing against -1. That means that all the constructors will be 11933 run a bit quicker, but when the loop comes to the end of the list, 11934 the program crashes because ptabs loads -1 into a target register. 11935 Since this option is unsafe for any hardware implementing the 11936 current architecture specification, the default is -mno-pt-fixed. 11937 Unless the user specifies a specific cost with `-mgettrcost', 11938 -mno-pt-fixed also implies `-mgettrcost=100'; this deters register 11939 allocation using target registers for storing ordinary integers. 11940 11941`-minvalid-symbols' 11942 Assume symbols might be invalid. Ordinary function symbols 11943 generated by the compiler will always be valid to load with 11944 movi/shori/ptabs or movi/shori/ptrel, but with assembler and/or 11945 linker tricks it is possible to generate symbols that will cause 11946 ptabs / ptrel to trap. This option is only meaningful when 11947 `-mno-pt-fixed' is in effect. It will then prevent 11948 cross-basic-block cse, hoisting and most scheduling of symbol 11949 loads. The default is `-mno-invalid-symbols'. 11950 11951 11952File: gcc.info, Node: SPARC Options, Next: System V Options, Prev: SH Options, Up: Submodel Options 11953 119543.17.31 SPARC Options 11955--------------------- 11956 11957These `-m' options are supported on the SPARC: 11958 11959`-mno-app-regs' 11960`-mapp-regs' 11961 Specify `-mapp-regs' to generate output using the global registers 11962 2 through 4, which the SPARC SVR4 ABI reserves for applications. 11963 This is the default. 11964 11965 To be fully SVR4 ABI compliant at the cost of some performance 11966 loss, specify `-mno-app-regs'. You should compile libraries and 11967 system software with this option. 11968 11969`-mfpu' 11970`-mhard-float' 11971 Generate output containing floating point instructions. This is 11972 the default. 11973 11974`-mno-fpu' 11975`-msoft-float' 11976 Generate output containing library calls for floating point. 11977 *Warning:* the requisite libraries are not available for all SPARC 11978 targets. Normally the facilities of the machine's usual C 11979 compiler are used, but this cannot be done directly in 11980 cross-compilation. You must make your own arrangements to provide 11981 suitable library functions for cross-compilation. The embedded 11982 targets `sparc-*-aout' and `sparclite-*-*' do provide software 11983 floating point support. 11984 11985 `-msoft-float' changes the calling convention in the output file; 11986 therefore, it is only useful if you compile _all_ of a program with 11987 this option. In particular, you need to compile `libgcc.a', the 11988 library that comes with GCC, with `-msoft-float' in order for this 11989 to work. 11990 11991`-mhard-quad-float' 11992 Generate output containing quad-word (long double) floating point 11993 instructions. 11994 11995`-msoft-quad-float' 11996 Generate output containing library calls for quad-word (long 11997 double) floating point instructions. The functions called are 11998 those specified in the SPARC ABI. This is the default. 11999 12000 As of this writing, there are no SPARC implementations that have 12001 hardware support for the quad-word floating point instructions. 12002 They all invoke a trap handler for one of these instructions, and 12003 then the trap handler emulates the effect of the instruction. 12004 Because of the trap handler overhead, this is much slower than 12005 calling the ABI library routines. Thus the `-msoft-quad-float' 12006 option is the default. 12007 12008`-mno-unaligned-doubles' 12009`-munaligned-doubles' 12010 Assume that doubles have 8 byte alignment. This is the default. 12011 12012 With `-munaligned-doubles', GCC assumes that doubles have 8 byte 12013 alignment only if they are contained in another type, or if they 12014 have an absolute address. Otherwise, it assumes they have 4 byte 12015 alignment. Specifying this option avoids some rare compatibility 12016 problems with code generated by other compilers. It is not the 12017 default because it results in a performance loss, especially for 12018 floating point code. 12019 12020`-mno-faster-structs' 12021`-mfaster-structs' 12022 With `-mfaster-structs', the compiler assumes that structures 12023 should have 8 byte alignment. This enables the use of pairs of 12024 `ldd' and `std' instructions for copies in structure assignment, 12025 in place of twice as many `ld' and `st' pairs. However, the use 12026 of this changed alignment directly violates the SPARC ABI. Thus, 12027 it's intended only for use on targets where the developer 12028 acknowledges that their resulting code will not be directly in 12029 line with the rules of the ABI. 12030 12031`-mimpure-text' 12032 `-mimpure-text', used in addition to `-shared', tells the compiler 12033 to not pass `-z text' to the linker when linking a shared object. 12034 Using this option, you can link position-dependent code into a 12035 shared object. 12036 12037 `-mimpure-text' suppresses the "relocations remain against 12038 allocatable but non-writable sections" linker error message. 12039 However, the necessary relocations will trigger copy-on-write, and 12040 the shared object is not actually shared across processes. 12041 Instead of using `-mimpure-text', you should compile all source 12042 code with `-fpic' or `-fPIC'. 12043 12044 This option is only available on SunOS and Solaris. 12045 12046`-mcpu=CPU_TYPE' 12047 Set the instruction set, register set, and instruction scheduling 12048 parameters for machine type CPU_TYPE. Supported values for 12049 CPU_TYPE are `v7', `cypress', `v8', `supersparc', `sparclite', 12050 `f930', `f934', `hypersparc', `sparclite86x', `sparclet', 12051 `tsc701', `v9', `ultrasparc', `ultrasparc3', and `niagara'. 12052 12053 Default instruction scheduling parameters are used for values that 12054 select an architecture and not an implementation. These are `v7', 12055 `v8', `sparclite', `sparclet', `v9'. 12056 12057 Here is a list of each supported architecture and their supported 12058 implementations. 12059 12060 v7: cypress 12061 v8: supersparc, hypersparc 12062 sparclite: f930, f934, sparclite86x 12063 sparclet: tsc701 12064 v9: ultrasparc, ultrasparc3, niagara 12065 12066 By default (unless configured otherwise), GCC generates code for 12067 the V7 variant of the SPARC architecture. With `-mcpu=cypress', 12068 the compiler additionally optimizes it for the Cypress CY7C602 12069 chip, as used in the SPARCStation/SPARCServer 3xx series. This is 12070 also appropriate for the older SPARCStation 1, 2, IPX etc. 12071 12072 With `-mcpu=v8', GCC generates code for the V8 variant of the SPARC 12073 architecture. The only difference from V7 code is that the 12074 compiler emits the integer multiply and integer divide 12075 instructions which exist in SPARC-V8 but not in SPARC-V7. With 12076 `-mcpu=supersparc', the compiler additionally optimizes it for the 12077 SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000 12078 series. 12079 12080 With `-mcpu=sparclite', GCC generates code for the SPARClite 12081 variant of the SPARC architecture. This adds the integer 12082 multiply, integer divide step and scan (`ffs') instructions which 12083 exist in SPARClite but not in SPARC-V7. With `-mcpu=f930', the 12084 compiler additionally optimizes it for the Fujitsu MB86930 chip, 12085 which is the original SPARClite, with no FPU. With `-mcpu=f934', 12086 the compiler additionally optimizes it for the Fujitsu MB86934 12087 chip, which is the more recent SPARClite with FPU. 12088 12089 With `-mcpu=sparclet', GCC generates code for the SPARClet variant 12090 of the SPARC architecture. This adds the integer multiply, 12091 multiply/accumulate, integer divide step and scan (`ffs') 12092 instructions which exist in SPARClet but not in SPARC-V7. With 12093 `-mcpu=tsc701', the compiler additionally optimizes it for the 12094 TEMIC SPARClet chip. 12095 12096 With `-mcpu=v9', GCC generates code for the V9 variant of the SPARC 12097 architecture. This adds 64-bit integer and floating-point move 12098 instructions, 3 additional floating-point condition code registers 12099 and conditional move instructions. With `-mcpu=ultrasparc', the 12100 compiler additionally optimizes it for the Sun UltraSPARC I/II/IIi 12101 chips. With `-mcpu=ultrasparc3', the compiler additionally 12102 optimizes it for the Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ 12103 chips. With `-mcpu=niagara', the compiler additionally optimizes 12104 it for Sun UltraSPARC T1 chips. 12105 12106`-mtune=CPU_TYPE' 12107 Set the instruction scheduling parameters for machine type 12108 CPU_TYPE, but do not set the instruction set or register set that 12109 the option `-mcpu=CPU_TYPE' would. 12110 12111 The same values for `-mcpu=CPU_TYPE' can be used for 12112 `-mtune=CPU_TYPE', but the only useful values are those that 12113 select a particular cpu implementation. Those are `cypress', 12114 `supersparc', `hypersparc', `f930', `f934', `sparclite86x', 12115 `tsc701', `ultrasparc', `ultrasparc3', and `niagara'. 12116 12117`-mv8plus' 12118`-mno-v8plus' 12119 With `-mv8plus', GCC generates code for the SPARC-V8+ ABI. The 12120 difference from the V8 ABI is that the global and out registers are 12121 considered 64-bit wide. This is enabled by default on Solaris in 12122 32-bit mode for all SPARC-V9 processors. 12123 12124`-mvis' 12125`-mno-vis' 12126 With `-mvis', GCC generates code that takes advantage of the 12127 UltraSPARC Visual Instruction Set extensions. The default is 12128 `-mno-vis'. 12129 12130 These `-m' options are supported in addition to the above on SPARC-V9 12131processors in 64-bit environments: 12132 12133`-mlittle-endian' 12134 Generate code for a processor running in little-endian mode. It 12135 is only available for a few configurations and most notably not on 12136 Solaris and Linux. 12137 12138`-m32' 12139`-m64' 12140 Generate code for a 32-bit or 64-bit environment. The 32-bit 12141 environment sets int, long and pointer to 32 bits. The 64-bit 12142 environment sets int to 32 bits and long and pointer to 64 bits. 12143 12144`-mcmodel=medlow' 12145 Generate code for the Medium/Low code model: 64-bit addresses, 12146 programs must be linked in the low 32 bits of memory. Programs 12147 can be statically or dynamically linked. 12148 12149`-mcmodel=medmid' 12150 Generate code for the Medium/Middle code model: 64-bit addresses, 12151 programs must be linked in the low 44 bits of memory, the text and 12152 data segments must be less than 2GB in size and the data segment 12153 must be located within 2GB of the text segment. 12154 12155`-mcmodel=medany' 12156 Generate code for the Medium/Anywhere code model: 64-bit 12157 addresses, programs may be linked anywhere in memory, the text and 12158 data segments must be less than 2GB in size and the data segment 12159 must be located within 2GB of the text segment. 12160 12161`-mcmodel=embmedany' 12162 Generate code for the Medium/Anywhere code model for embedded 12163 systems: 64-bit addresses, the text and data segments must be less 12164 than 2GB in size, both starting anywhere in memory (determined at 12165 link time). The global register %g4 points to the base of the 12166 data segment. Programs are statically linked and PIC is not 12167 supported. 12168 12169`-mstack-bias' 12170`-mno-stack-bias' 12171 With `-mstack-bias', GCC assumes that the stack pointer, and frame 12172 pointer if present, are offset by -2047 which must be added back 12173 when making stack frame references. This is the default in 64-bit 12174 mode. Otherwise, assume no such offset is present. 12175 12176 These switches are supported in addition to the above on Solaris: 12177 12178`-threads' 12179 Add support for multithreading using the Solaris threads library. 12180 This option sets flags for both the preprocessor and linker. This 12181 option does not affect the thread safety of object code produced 12182 by the compiler or that of libraries supplied with it. 12183 12184`-pthreads' 12185 Add support for multithreading using the POSIX threads library. 12186 This option sets flags for both the preprocessor and linker. This 12187 option does not affect the thread safety of object code produced 12188 by the compiler or that of libraries supplied with it. 12189 12190`-pthread' 12191 This is a synonym for `-pthreads'. 12192 12193 12194File: gcc.info, Node: System V Options, Next: TMS320C3x/C4x Options, Prev: SPARC Options, Up: Submodel Options 12195 121963.17.32 Options for System V 12197---------------------------- 12198 12199These additional options are available on System V Release 4 for 12200compatibility with other compilers on those systems: 12201 12202`-G' 12203 Create a shared object. It is recommended that `-symbolic' or 12204 `-shared' be used instead. 12205 12206`-Qy' 12207 Identify the versions of each tool used by the compiler, in a 12208 `.ident' assembler directive in the output. 12209 12210`-Qn' 12211 Refrain from adding `.ident' directives to the output file (this is 12212 the default). 12213 12214`-YP,DIRS' 12215 Search the directories DIRS, and no others, for libraries 12216 specified with `-l'. 12217 12218`-Ym,DIR' 12219 Look in the directory DIR to find the M4 preprocessor. The 12220 assembler uses this option. 12221 12222 12223File: gcc.info, Node: TMS320C3x/C4x Options, Next: V850 Options, Prev: System V Options, Up: Submodel Options 12224 122253.17.33 TMS320C3x/C4x Options 12226----------------------------- 12227 12228These `-m' options are defined for TMS320C3x/C4x implementations: 12229 12230`-mcpu=CPU_TYPE' 12231 Set the instruction set, register set, and instruction scheduling 12232 parameters for machine type CPU_TYPE. Supported values for 12233 CPU_TYPE are `c30', `c31', `c32', `c40', and `c44'. The default 12234 is `c40' to generate code for the TMS320C40. 12235 12236`-mbig-memory' 12237`-mbig' 12238`-msmall-memory' 12239`-msmall' 12240 Generates code for the big or small memory model. The small memory 12241 model assumed that all data fits into one 64K word page. At 12242 run-time the data page (DP) register must be set to point to the 12243 64K page containing the .bss and .data program sections. The big 12244 memory model is the default and requires reloading of the DP 12245 register for every direct memory access. 12246 12247`-mbk' 12248`-mno-bk' 12249 Allow (disallow) allocation of general integer operands into the 12250 block count register BK. 12251 12252`-mdb' 12253`-mno-db' 12254 Enable (disable) generation of code using decrement and branch, 12255 DBcond(D), instructions. This is enabled by default for the C4x. 12256 To be on the safe side, this is disabled for the C3x, since the 12257 maximum iteration count on the C3x is 2^23 + 1 (but who iterates 12258 loops more than 2^23 times on the C3x?). Note that GCC will try 12259 to reverse a loop so that it can utilize the decrement and branch 12260 instruction, but will give up if there is more than one memory 12261 reference in the loop. Thus a loop where the loop counter is 12262 decremented can generate slightly more efficient code, in cases 12263 where the RPTB instruction cannot be utilized. 12264 12265`-mdp-isr-reload' 12266`-mparanoid' 12267 Force the DP register to be saved on entry to an interrupt service 12268 routine (ISR), reloaded to point to the data section, and restored 12269 on exit from the ISR. This should not be required unless someone 12270 has violated the small memory model by modifying the DP register, 12271 say within an object library. 12272 12273`-mmpyi' 12274`-mno-mpyi' 12275 For the C3x use the 24-bit MPYI instruction for integer multiplies 12276 instead of a library call to guarantee 32-bit results. Note that 12277 if one of the operands is a constant, then the multiplication will 12278 be performed using shifts and adds. If the `-mmpyi' option is not 12279 specified for the C3x, then squaring operations are performed 12280 inline instead of a library call. 12281 12282`-mfast-fix' 12283`-mno-fast-fix' 12284 The C3x/C4x FIX instruction to convert a floating point value to an 12285 integer value chooses the nearest integer less than or equal to the 12286 floating point value rather than to the nearest integer. Thus if 12287 the floating point number is negative, the result will be 12288 incorrectly truncated an additional code is necessary to detect 12289 and correct this case. This option can be used to disable 12290 generation of the additional code required to correct the result. 12291 12292`-mrptb' 12293`-mno-rptb' 12294 Enable (disable) generation of repeat block sequences using the 12295 RPTB instruction for zero overhead looping. The RPTB construct is 12296 only used for innermost loops that do not call functions or jump 12297 across the loop boundaries. There is no advantage having nested 12298 RPTB loops due to the overhead required to save and restore the 12299 RC, RS, and RE registers. This is enabled by default with `-O2'. 12300 12301`-mrpts=COUNT' 12302`-mno-rpts' 12303 Enable (disable) the use of the single instruction repeat 12304 instruction RPTS. If a repeat block contains a single 12305 instruction, and the loop count can be guaranteed to be less than 12306 the value COUNT, GCC will emit a RPTS instruction instead of a 12307 RPTB. If no value is specified, then a RPTS will be emitted even 12308 if the loop count cannot be determined at compile time. Note that 12309 the repeated instruction following RPTS does not have to be 12310 reloaded from memory each iteration, thus freeing up the CPU buses 12311 for operands. However, since interrupts are blocked by this 12312 instruction, it is disabled by default. 12313 12314`-mloop-unsigned' 12315`-mno-loop-unsigned' 12316 The maximum iteration count when using RPTS and RPTB (and DB on 12317 the C40) is 2^31 + 1 since these instructions test if the 12318 iteration count is negative to terminate the loop. If the 12319 iteration count is unsigned there is a possibility than the 2^31 + 12320 1 maximum iteration count may be exceeded. This switch allows an 12321 unsigned iteration count. 12322 12323`-mti' 12324 Try to emit an assembler syntax that the TI assembler (asm30) is 12325 happy with. This also enforces compatibility with the API 12326 employed by the TI C3x C compiler. For example, long doubles are 12327 passed as structures rather than in floating point registers. 12328 12329`-mregparm' 12330`-mmemparm' 12331 Generate code that uses registers (stack) for passing arguments to 12332 functions. By default, arguments are passed in registers where 12333 possible rather than by pushing arguments on to the stack. 12334 12335`-mparallel-insns' 12336`-mno-parallel-insns' 12337 Allow the generation of parallel instructions. This is enabled by 12338 default with `-O2'. 12339 12340`-mparallel-mpy' 12341`-mno-parallel-mpy' 12342 Allow the generation of MPY||ADD and MPY||SUB parallel 12343 instructions, provided `-mparallel-insns' is also specified. 12344 These instructions have tight register constraints which can 12345 pessimize the code generation of large functions. 12346 12347 12348 12349File: gcc.info, Node: V850 Options, Next: VAX Options, Prev: TMS320C3x/C4x Options, Up: Submodel Options 12350 123513.17.34 V850 Options 12352-------------------- 12353 12354These `-m' options are defined for V850 implementations: 12355 12356`-mlong-calls' 12357`-mno-long-calls' 12358 Treat all calls as being far away (near). If calls are assumed to 12359 be far away, the compiler will always load the functions address 12360 up into a register, and call indirect through the pointer. 12361 12362`-mno-ep' 12363`-mep' 12364 Do not optimize (do optimize) basic blocks that use the same index 12365 pointer 4 or more times to copy pointer into the `ep' register, and 12366 use the shorter `sld' and `sst' instructions. The `-mep' option 12367 is on by default if you optimize. 12368 12369`-mno-prolog-function' 12370`-mprolog-function' 12371 Do not use (do use) external functions to save and restore 12372 registers at the prologue and epilogue of a function. The 12373 external functions are slower, but use less code space if more 12374 than one function saves the same number of registers. The 12375 `-mprolog-function' option is on by default if you optimize. 12376 12377`-mspace' 12378 Try to make the code as small as possible. At present, this just 12379 turns on the `-mep' and `-mprolog-function' options. 12380 12381`-mtda=N' 12382 Put static or global variables whose size is N bytes or less into 12383 the tiny data area that register `ep' points to. The tiny data 12384 area can hold up to 256 bytes in total (128 bytes for byte 12385 references). 12386 12387`-msda=N' 12388 Put static or global variables whose size is N bytes or less into 12389 the small data area that register `gp' points to. The small data 12390 area can hold up to 64 kilobytes. 12391 12392`-mzda=N' 12393 Put static or global variables whose size is N bytes or less into 12394 the first 32 kilobytes of memory. 12395 12396`-mv850' 12397 Specify that the target processor is the V850. 12398 12399`-mbig-switch' 12400 Generate code suitable for big switch tables. Use this option 12401 only if the assembler/linker complain about out of range branches 12402 within a switch table. 12403 12404`-mapp-regs' 12405 This option will cause r2 and r5 to be used in the code generated 12406 by the compiler. This setting is the default. 12407 12408`-mno-app-regs' 12409 This option will cause r2 and r5 to be treated as fixed registers. 12410 12411`-mv850e1' 12412 Specify that the target processor is the V850E1. The preprocessor 12413 constants `__v850e1__' and `__v850e__' will be defined if this 12414 option is used. 12415 12416`-mv850e' 12417 Specify that the target processor is the V850E. The preprocessor 12418 constant `__v850e__' will be defined if this option is used. 12419 12420 If neither `-mv850' nor `-mv850e' nor `-mv850e1' are defined then 12421 a default target processor will be chosen and the relevant 12422 `__v850*__' preprocessor constant will be defined. 12423 12424 The preprocessor constants `__v850' and `__v851__' are always 12425 defined, regardless of which processor variant is the target. 12426 12427`-mdisable-callt' 12428 This option will suppress generation of the CALLT instruction for 12429 the v850e and v850e1 flavors of the v850 architecture. The 12430 default is `-mno-disable-callt' which allows the CALLT instruction 12431 to be used. 12432 12433 12434 12435File: gcc.info, Node: VAX Options, Next: x86-64 Options, Prev: V850 Options, Up: Submodel Options 12436 124373.17.35 VAX Options 12438------------------- 12439 12440These `-m' options are defined for the VAX: 12441 12442`-munix' 12443 Do not output certain jump instructions (`aobleq' and so on) that 12444 the Unix assembler for the VAX cannot handle across long ranges. 12445 12446`-mgnu' 12447 Do output those jump instructions, on the assumption that you will 12448 assemble with the GNU assembler. 12449 12450`-mg' 12451 Output code for g-format floating point numbers instead of 12452 d-format. 12453 12454 12455File: gcc.info, Node: x86-64 Options, Next: Xstormy16 Options, Prev: VAX Options, Up: Submodel Options 12456 124573.17.36 x86-64 Options 12458---------------------- 12459 12460These are listed under *Note i386 and x86-64 Options::. 12461 12462 12463File: gcc.info, Node: Xstormy16 Options, Next: Xtensa Options, Prev: x86-64 Options, Up: Submodel Options 12464 124653.17.37 Xstormy16 Options 12466------------------------- 12467 12468These options are defined for Xstormy16: 12469 12470`-msim' 12471 Choose startup files and linker script suitable for the simulator. 12472 12473 12474File: gcc.info, Node: Xtensa Options, Next: zSeries Options, Prev: Xstormy16 Options, Up: Submodel Options 12475 124763.17.38 Xtensa Options 12477---------------------- 12478 12479These options are supported for Xtensa targets: 12480 12481`-mconst16' 12482`-mno-const16' 12483 Enable or disable use of `CONST16' instructions for loading 12484 constant values. The `CONST16' instruction is currently not a 12485 standard option from Tensilica. When enabled, `CONST16' 12486 instructions are always used in place of the standard `L32R' 12487 instructions. The use of `CONST16' is enabled by default only if 12488 the `L32R' instruction is not available. 12489 12490`-mfused-madd' 12491`-mno-fused-madd' 12492 Enable or disable use of fused multiply/add and multiply/subtract 12493 instructions in the floating-point option. This has no effect if 12494 the floating-point option is not also enabled. Disabling fused 12495 multiply/add and multiply/subtract instructions forces the 12496 compiler to use separate instructions for the multiply and 12497 add/subtract operations. This may be desirable in some cases 12498 where strict IEEE 754-compliant results are required: the fused 12499 multiply add/subtract instructions do not round the intermediate 12500 result, thereby producing results with _more_ bits of precision 12501 than specified by the IEEE standard. Disabling fused multiply 12502 add/subtract instructions also ensures that the program output is 12503 not sensitive to the compiler's ability to combine multiply and 12504 add/subtract operations. 12505 12506`-mtext-section-literals' 12507`-mno-text-section-literals' 12508 Control the treatment of literal pools. The default is 12509 `-mno-text-section-literals', which places literals in a separate 12510 section in the output file. This allows the literal pool to be 12511 placed in a data RAM/ROM, and it also allows the linker to combine 12512 literal pools from separate object files to remove redundant 12513 literals and improve code size. With `-mtext-section-literals', 12514 the literals are interspersed in the text section in order to keep 12515 them as close as possible to their references. This may be 12516 necessary for large assembly files. 12517 12518`-mtarget-align' 12519`-mno-target-align' 12520 When this option is enabled, GCC instructs the assembler to 12521 automatically align instructions to reduce branch penalties at the 12522 expense of some code density. The assembler attempts to widen 12523 density instructions to align branch targets and the instructions 12524 following call instructions. If there are not enough preceding 12525 safe density instructions to align a target, no widening will be 12526 performed. The default is `-mtarget-align'. These options do not 12527 affect the treatment of auto-aligned instructions like `LOOP', 12528 which the assembler will always align, either by widening density 12529 instructions or by inserting no-op instructions. 12530 12531`-mlongcalls' 12532`-mno-longcalls' 12533 When this option is enabled, GCC instructs the assembler to 12534 translate direct calls to indirect calls unless it can determine 12535 that the target of a direct call is in the range allowed by the 12536 call instruction. This translation typically occurs for calls to 12537 functions in other source files. Specifically, the assembler 12538 translates a direct `CALL' instruction into an `L32R' followed by 12539 a `CALLX' instruction. The default is `-mno-longcalls'. This 12540 option should be used in programs where the call target can 12541 potentially be out of range. This option is implemented in the 12542 assembler, not the compiler, so the assembly code generated by GCC 12543 will still show direct call instructions--look at the disassembled 12544 object code to see the actual instructions. Note that the 12545 assembler will use an indirect call for every cross-file call, not 12546 just those that really will be out of range. 12547 12548 12549File: gcc.info, Node: zSeries Options, Prev: Xtensa Options, Up: Submodel Options 12550 125513.17.39 zSeries Options 12552----------------------- 12553 12554These are listed under *Note S/390 and zSeries Options::. 12555 12556 12557File: gcc.info, Node: Code Gen Options, Next: Environment Variables, Prev: Submodel Options, Up: Invoking GCC 12558 125593.18 Options for Code Generation Conventions 12560============================================ 12561 12562These machine-independent options control the interface conventions 12563used in code generation. 12564 12565 Most of them have both positive and negative forms; the negative form 12566of `-ffoo' would be `-fno-foo'. In the table below, only one of the 12567forms is listed--the one which is not the default. You can figure out 12568the other form by either removing `no-' or adding it. 12569 12570`-fbounds-check' 12571 For front-ends that support it, generate additional code to check 12572 that indices used to access arrays are within the declared range. 12573 This is currently only supported by the Java and Fortran 12574 front-ends, where this option defaults to true and false 12575 respectively. 12576 12577`-ftrapv' 12578 This option generates traps for signed overflow on addition, 12579 subtraction, multiplication operations. 12580 12581`-fwrapv' 12582 This option instructs the compiler to assume that signed arithmetic 12583 overflow of addition, subtraction and multiplication wraps around 12584 using twos-complement representation. This flag enables some 12585 optimizations and disables others. This option is enabled by 12586 default for the Java front-end, as required by the Java language 12587 specification. 12588 12589`-fexceptions' 12590 Enable exception handling. Generates extra code needed to 12591 propagate exceptions. For some targets, this implies GCC will 12592 generate frame unwind information for all functions, which can 12593 produce significant data size overhead, although it does not 12594 affect execution. If you do not specify this option, GCC will 12595 enable it by default for languages like C++ which normally require 12596 exception handling, and disable it for languages like C that do 12597 not normally require it. However, you may need to enable this 12598 option when compiling C code that needs to interoperate properly 12599 with exception handlers written in C++. You may also wish to 12600 disable this option if you are compiling older C++ programs that 12601 don't use exception handling. 12602 12603`-fnon-call-exceptions' 12604 Generate code that allows trapping instructions to throw 12605 exceptions. Note that this requires platform-specific runtime 12606 support that does not exist everywhere. Moreover, it only allows 12607 _trapping_ instructions to throw exceptions, i.e. memory 12608 references or floating point instructions. It does not allow 12609 exceptions to be thrown from arbitrary signal handlers such as 12610 `SIGALRM'. 12611 12612`-funwind-tables' 12613 Similar to `-fexceptions', except that it will just generate any 12614 needed static data, but will not affect the generated code in any 12615 other way. You will normally not enable this option; instead, a 12616 language processor that needs this handling would enable it on 12617 your behalf. 12618 12619`-fasynchronous-unwind-tables' 12620 Generate unwind table in dwarf2 format, if supported by target 12621 machine. The table is exact at each instruction boundary, so it 12622 can be used for stack unwinding from asynchronous events (such as 12623 debugger or garbage collector). 12624 12625`-fpcc-struct-return' 12626 Return "short" `struct' and `union' values in memory like longer 12627 ones, rather than in registers. This convention is less 12628 efficient, but it has the advantage of allowing intercallability 12629 between GCC-compiled files and files compiled with other 12630 compilers, particularly the Portable C Compiler (pcc). 12631 12632 The precise convention for returning structures in memory depends 12633 on the target configuration macros. 12634 12635 Short structures and unions are those whose size and alignment 12636 match that of some integer type. 12637 12638 *Warning:* code compiled with the `-fpcc-struct-return' switch is 12639 not binary compatible with code compiled with the 12640 `-freg-struct-return' switch. Use it to conform to a non-default 12641 application binary interface. 12642 12643`-freg-struct-return' 12644 Return `struct' and `union' values in registers when possible. 12645 This is more efficient for small structures than 12646 `-fpcc-struct-return'. 12647 12648 If you specify neither `-fpcc-struct-return' nor 12649 `-freg-struct-return', GCC defaults to whichever convention is 12650 standard for the target. If there is no standard convention, GCC 12651 defaults to `-fpcc-struct-return', except on targets where GCC is 12652 the principal compiler. In those cases, we can choose the 12653 standard, and we chose the more efficient register return 12654 alternative. 12655 12656 *Warning:* code compiled with the `-freg-struct-return' switch is 12657 not binary compatible with code compiled with the 12658 `-fpcc-struct-return' switch. Use it to conform to a non-default 12659 application binary interface. 12660 12661`-fshort-enums' 12662 Allocate to an `enum' type only as many bytes as it needs for the 12663 declared range of possible values. Specifically, the `enum' type 12664 will be equivalent to the smallest integer type which has enough 12665 room. 12666 12667 *Warning:* the `-fshort-enums' switch causes GCC to generate code 12668 that is not binary compatible with code generated without that 12669 switch. Use it to conform to a non-default application binary 12670 interface. 12671 12672`-fshort-double' 12673 Use the same size for `double' as for `float'. 12674 12675 *Warning:* the `-fshort-double' switch causes GCC to generate code 12676 that is not binary compatible with code generated without that 12677 switch. Use it to conform to a non-default application binary 12678 interface. 12679 12680`-fshort-wchar' 12681 Override the underlying type for `wchar_t' to be `short unsigned 12682 int' instead of the default for the target. This option is useful 12683 for building programs to run under WINE. 12684 12685 *Warning:* the `-fshort-wchar' switch causes GCC to generate code 12686 that is not binary compatible with code generated without that 12687 switch. Use it to conform to a non-default application binary 12688 interface. 12689 12690`-fno-common' 12691 In C, allocate even uninitialized global variables in the data 12692 section of the object file, rather than generating them as common 12693 blocks. This has the effect that if the same variable is declared 12694 (without `extern') in two different compilations, you will get an 12695 error when you link them. The only reason this might be useful is 12696 if you wish to verify that the program will work on other systems 12697 which always work this way. 12698 12699`-fno-ident' 12700 Ignore the `#ident' directive. 12701 12702`-finhibit-size-directive' 12703 Don't output a `.size' assembler directive, or anything else that 12704 would cause trouble if the function is split in the middle, and the 12705 two halves are placed at locations far apart in memory. This 12706 option is used when compiling `crtstuff.c'; you should not need to 12707 use it for anything else. 12708 12709`-fverbose-asm' 12710 Put extra commentary information in the generated assembly code to 12711 make it more readable. This option is generally only of use to 12712 those who actually need to read the generated assembly code 12713 (perhaps while debugging the compiler itself). 12714 12715 `-fno-verbose-asm', the default, causes the extra information to 12716 be omitted and is useful when comparing two assembler files. 12717 12718`-fpic' 12719 Generate position-independent code (PIC) suitable for use in a 12720 shared library, if supported for the target machine. Such code 12721 accesses all constant addresses through a global offset table 12722 (GOT). The dynamic loader resolves the GOT entries when the 12723 program starts (the dynamic loader is not part of GCC; it is part 12724 of the operating system). If the GOT size for the linked 12725 executable exceeds a machine-specific maximum size, you get an 12726 error message from the linker indicating that `-fpic' does not 12727 work; in that case, recompile with `-fPIC' instead. (These 12728 maximums are 8k on the SPARC and 32k on the m68k and RS/6000. The 12729 386 has no such limit.) 12730 12731 Position-independent code requires special support, and therefore 12732 works only on certain machines. For the 386, GCC supports PIC for 12733 System V but not for the Sun 386i. Code generated for the IBM 12734 RS/6000 is always position-independent. 12735 12736 When this flag is set, the macros `__pic__' and `__PIC__' are 12737 defined to 1. 12738 12739`-fPIC' 12740 If supported for the target machine, emit position-independent 12741 code, suitable for dynamic linking and avoiding any limit on the 12742 size of the global offset table. This option makes a difference 12743 on the m68k, PowerPC and SPARC. 12744 12745 Position-independent code requires special support, and therefore 12746 works only on certain machines. 12747 12748 When this flag is set, the macros `__pic__' and `__PIC__' are 12749 defined to 2. 12750 12751`-fpie' 12752`-fPIE' 12753 These options are similar to `-fpic' and `-fPIC', but generated 12754 position independent code can be only linked into executables. 12755 Usually these options are used when `-pie' GCC option will be used 12756 during linking. 12757 12758`-fno-jump-tables' 12759 Do not use jump tables for switch statements even where it would be 12760 more efficient than other code generation strategies. This option 12761 is of use in conjunction with `-fpic' or `-fPIC' for building code 12762 which forms part of a dynamic linker and cannot reference the 12763 address of a jump table. On some targets, jump tables do not 12764 require a GOT and this option is not needed. 12765 12766`-ffixed-REG' 12767 Treat the register named REG as a fixed register; generated code 12768 should never refer to it (except perhaps as a stack pointer, frame 12769 pointer or in some other fixed role). 12770 12771 REG must be the name of a register. The register names accepted 12772 are machine-specific and are defined in the `REGISTER_NAMES' macro 12773 in the machine description macro file. 12774 12775 This flag does not have a negative form, because it specifies a 12776 three-way choice. 12777 12778`-fcall-used-REG' 12779 Treat the register named REG as an allocable register that is 12780 clobbered by function calls. It may be allocated for temporaries 12781 or variables that do not live across a call. Functions compiled 12782 this way will not save and restore the register REG. 12783 12784 It is an error to used this flag with the frame pointer or stack 12785 pointer. Use of this flag for other registers that have fixed 12786 pervasive roles in the machine's execution model will produce 12787 disastrous results. 12788 12789 This flag does not have a negative form, because it specifies a 12790 three-way choice. 12791 12792`-fcall-saved-REG' 12793 Treat the register named REG as an allocable register saved by 12794 functions. It may be allocated even for temporaries or variables 12795 that live across a call. Functions compiled this way will save 12796 and restore the register REG if they use it. 12797 12798 It is an error to used this flag with the frame pointer or stack 12799 pointer. Use of this flag for other registers that have fixed 12800 pervasive roles in the machine's execution model will produce 12801 disastrous results. 12802 12803 A different sort of disaster will result from the use of this flag 12804 for a register in which function values may be returned. 12805 12806 This flag does not have a negative form, because it specifies a 12807 three-way choice. 12808 12809`-fpack-struct[=N]' 12810 Without a value specified, pack all structure members together 12811 without holes. When a value is specified (which must be a small 12812 power of two), pack structure members according to this value, 12813 representing the maximum alignment (that is, objects with default 12814 alignment requirements larger than this will be output potentially 12815 unaligned at the next fitting location. 12816 12817 *Warning:* the `-fpack-struct' switch causes GCC to generate code 12818 that is not binary compatible with code generated without that 12819 switch. Additionally, it makes the code suboptimal. Use it to 12820 conform to a non-default application binary interface. 12821 12822`-finstrument-functions' 12823 Generate instrumentation calls for entry and exit to functions. 12824 Just after function entry and just before function exit, the 12825 following profiling functions will be called with the address of 12826 the current function and its call site. (On some platforms, 12827 `__builtin_return_address' does not work beyond the current 12828 function, so the call site information may not be available to the 12829 profiling functions otherwise.) 12830 12831 void __cyg_profile_func_enter (void *this_fn, 12832 void *call_site); 12833 void __cyg_profile_func_exit (void *this_fn, 12834 void *call_site); 12835 12836 The first argument is the address of the start of the current 12837 function, which may be looked up exactly in the symbol table. 12838 12839 This instrumentation is also done for functions expanded inline in 12840 other functions. The profiling calls will indicate where, 12841 conceptually, the inline function is entered and exited. This 12842 means that addressable versions of such functions must be 12843 available. If all your uses of a function are expanded inline, 12844 this may mean an additional expansion of code size. If you use 12845 `extern inline' in your C code, an addressable version of such 12846 functions must be provided. (This is normally the case anyways, 12847 but if you get lucky and the optimizer always expands the 12848 functions inline, you might have gotten away without providing 12849 static copies.) 12850 12851 A function may be given the attribute `no_instrument_function', in 12852 which case this instrumentation will not be done. This can be 12853 used, for example, for the profiling functions listed above, 12854 high-priority interrupt routines, and any functions from which the 12855 profiling functions cannot safely be called (perhaps signal 12856 handlers, if the profiling routines generate output or allocate 12857 memory). 12858 12859`-fstack-check' 12860 Generate code to verify that you do not go beyond the boundary of 12861 the stack. You should specify this flag if you are running in an 12862 environment with multiple threads, but only rarely need to specify 12863 it in a single-threaded environment since stack overflow is 12864 automatically detected on nearly all systems if there is only one 12865 stack. 12866 12867 Note that this switch does not actually cause checking to be done; 12868 the operating system must do that. The switch causes generation 12869 of code to ensure that the operating system sees the stack being 12870 extended. 12871 12872`-fstack-limit-register=REG' 12873`-fstack-limit-symbol=SYM' 12874`-fno-stack-limit' 12875 Generate code to ensure that the stack does not grow beyond a 12876 certain value, either the value of a register or the address of a 12877 symbol. If the stack would grow beyond the value, a signal is 12878 raised. For most targets, the signal is raised before the stack 12879 overruns the boundary, so it is possible to catch the signal 12880 without taking special precautions. 12881 12882 For instance, if the stack starts at absolute address `0x80000000' 12883 and grows downwards, you can use the flags 12884 `-fstack-limit-symbol=__stack_limit' and 12885 `-Wl,--defsym,__stack_limit=0x7ffe0000' to enforce a stack limit 12886 of 128KB. Note that this may only work with the GNU linker. 12887 12888`-fargument-alias' 12889`-fargument-noalias' 12890`-fargument-noalias-global' 12891`-fargument-noalias-anything' 12892 Specify the possible relationships among parameters and between 12893 parameters and global data. 12894 12895 `-fargument-alias' specifies that arguments (parameters) may alias 12896 each other and may alias global storage. 12897 `-fargument-noalias' specifies that arguments do not alias each 12898 other, but may alias global storage. 12899 `-fargument-noalias-global' specifies that arguments do not alias 12900 each other and do not alias global storage. 12901 `-fargument-noalias-anything' specifies that arguments do not 12902 alias any other storage. 12903 12904 Each language will automatically use whatever option is required by 12905 the language standard. You should not need to use these options 12906 yourself. 12907 12908`-fleading-underscore' 12909 This option and its counterpart, `-fno-leading-underscore', 12910 forcibly change the way C symbols are represented in the object 12911 file. One use is to help link with legacy assembly code. 12912 12913 *Warning:* the `-fleading-underscore' switch causes GCC to 12914 generate code that is not binary compatible with code generated 12915 without that switch. Use it to conform to a non-default 12916 application binary interface. Not all targets provide complete 12917 support for this switch. 12918 12919`-ftls-model=MODEL' 12920 Alter the thread-local storage model to be used (*note 12921 Thread-Local::). The MODEL argument should be one of 12922 `global-dynamic', `local-dynamic', `initial-exec' or `local-exec'. 12923 12924 The default without `-fpic' is `initial-exec'; with `-fpic' the 12925 default is `global-dynamic'. 12926 12927`-fvisibility=DEFAULT|INTERNAL|HIDDEN|PROTECTED' 12928 Set the default ELF image symbol visibility to the specified 12929 option--all symbols will be marked with this unless overridden 12930 within the code. Using this feature can very substantially 12931 improve linking and load times of shared object libraries, produce 12932 more optimized code, provide near-perfect API export and prevent 12933 symbol clashes. It is *strongly* recommended that you use this in 12934 any shared objects you distribute. 12935 12936 Despite the nomenclature, `default' always means public ie; 12937 available to be linked against from outside the shared object. 12938 `protected' and `internal' are pretty useless in real-world usage 12939 so the only other commonly used option will be `hidden'. The 12940 default if `-fvisibility' isn't specified is `default', i.e., make 12941 every symbol public--this causes the same behavior as previous 12942 versions of GCC. 12943 12944 A good explanation of the benefits offered by ensuring ELF symbols 12945 have the correct visibility is given by "How To Write Shared 12946 Libraries" by Ulrich Drepper (which can be found at 12947 `http://people.redhat.com/~drepper/')--however a superior solution 12948 made possible by this option to marking things hidden when the 12949 default is public is to make the default hidden and mark things 12950 public. This is the norm with DLL's on Windows and with 12951 `-fvisibility=hidden' and `__attribute__ 12952 ((visibility("default")))' instead of `__declspec(dllexport)' you 12953 get almost identical semantics with identical syntax. This is a 12954 great boon to those working with cross-platform projects. 12955 12956 For those adding visibility support to existing code, you may find 12957 `#pragma GCC visibility' of use. This works by you enclosing the 12958 declarations you wish to set visibility for with (for example) 12959 `#pragma GCC visibility push(hidden)' and `#pragma GCC visibility 12960 pop'. Bear in mind that symbol visibility should be viewed *as 12961 part of the API interface contract* and thus all new code should 12962 always specify visibility when it is not the default ie; 12963 declarations only for use within the local DSO should *always* be 12964 marked explicitly as hidden as so to avoid PLT indirection 12965 overheads--making this abundantly clear also aids readability and 12966 self-documentation of the code. Note that due to ISO C++ 12967 specification requirements, operator new and operator delete must 12968 always be of default visibility. 12969 12970 Be aware that headers from outside your project, in particular 12971 system headers and headers from any other library you use, may not 12972 be expecting to be compiled with visibility other than the 12973 default. You may need to explicitly say `#pragma GCC visibility 12974 push(default)' before including any such headers. 12975 12976 `extern' declarations are not affected by `-fvisibility', so a lot 12977 of code can be recompiled with `-fvisibility=hidden' with no 12978 modifications. However, this means that calls to `extern' 12979 functions with no explicit visibility will use the PLT, so it is 12980 more effective to use `__attribute ((visibility))' and/or `#pragma 12981 GCC visibility' to tell the compiler which `extern' declarations 12982 should be treated as hidden. 12983 12984 Note that `-fvisibility' does affect C++ vague linkage entities. 12985 This means that, for instance, an exception class that will be 12986 thrown between DSOs must be explicitly marked with default 12987 visibility so that the `type_info' nodes will be unified between 12988 the DSOs. 12989 12990 An overview of these techniques, their benefits and how to use them 12991 is at `http://gcc.gnu.org/wiki/Visibility'. 12992 12993 12994 12995File: gcc.info, Node: Environment Variables, Next: Precompiled Headers, Prev: Code Gen Options, Up: Invoking GCC 12996 129973.19 Environment Variables Affecting GCC 12998======================================== 12999 13000This section describes several environment variables that affect how GCC 13001operates. Some of them work by specifying directories or prefixes to 13002use when searching for various kinds of files. Some are used to 13003specify other aspects of the compilation environment. 13004 13005 Note that you can also specify places to search using options such as 13006`-B', `-I' and `-L' (*note Directory Options::). These take precedence 13007over places specified using environment variables, which in turn take 13008precedence over those specified by the configuration of GCC. *Note 13009Controlling the Compilation Driver `gcc': (gccint)Driver. 13010 13011`LANG' 13012`LC_CTYPE' 13013`LC_MESSAGES' 13014`LC_ALL' 13015 These environment variables control the way that GCC uses 13016 localization information that allow GCC to work with different 13017 national conventions. GCC inspects the locale categories 13018 `LC_CTYPE' and `LC_MESSAGES' if it has been configured to do so. 13019 These locale categories can be set to any value supported by your 13020 installation. A typical value is `en_GB.UTF-8' for English in the 13021 United Kingdom encoded in UTF-8. 13022 13023 The `LC_CTYPE' environment variable specifies character 13024 classification. GCC uses it to determine the character boundaries 13025 in a string; this is needed for some multibyte encodings that 13026 contain quote and escape characters that would otherwise be 13027 interpreted as a string end or escape. 13028 13029 The `LC_MESSAGES' environment variable specifies the language to 13030 use in diagnostic messages. 13031 13032 If the `LC_ALL' environment variable is set, it overrides the value 13033 of `LC_CTYPE' and `LC_MESSAGES'; otherwise, `LC_CTYPE' and 13034 `LC_MESSAGES' default to the value of the `LANG' environment 13035 variable. If none of these variables are set, GCC defaults to 13036 traditional C English behavior. 13037 13038`TMPDIR' 13039 If `TMPDIR' is set, it specifies the directory to use for temporary 13040 files. GCC uses temporary files to hold the output of one stage of 13041 compilation which is to be used as input to the next stage: for 13042 example, the output of the preprocessor, which is the input to the 13043 compiler proper. 13044 13045`GCC_EXEC_PREFIX' 13046 If `GCC_EXEC_PREFIX' is set, it specifies a prefix to use in the 13047 names of the subprograms executed by the compiler. No slash is 13048 added when this prefix is combined with the name of a subprogram, 13049 but you can specify a prefix that ends with a slash if you wish. 13050 13051 If `GCC_EXEC_PREFIX' is not set, GCC will attempt to figure out an 13052 appropriate prefix to use based on the pathname it was invoked 13053 with. 13054 13055 If GCC cannot find the subprogram using the specified prefix, it 13056 tries looking in the usual places for the subprogram. 13057 13058 The default value of `GCC_EXEC_PREFIX' is `PREFIX/lib/gcc/' where 13059 PREFIX is the value of `prefix' when you ran the `configure' 13060 script. 13061 13062 Other prefixes specified with `-B' take precedence over this 13063 prefix. 13064 13065 This prefix is also used for finding files such as `crt0.o' that 13066 are used for linking. 13067 13068 In addition, the prefix is used in an unusual way in finding the 13069 directories to search for header files. For each of the standard 13070 directories whose name normally begins with `/usr/local/lib/gcc' 13071 (more precisely, with the value of `GCC_INCLUDE_DIR'), GCC tries 13072 replacing that beginning with the specified prefix to produce an 13073 alternate directory name. Thus, with `-Bfoo/', GCC will search 13074 `foo/bar' where it would normally search `/usr/local/lib/bar'. 13075 These alternate directories are searched first; the standard 13076 directories come next. 13077 13078`COMPILER_PATH' 13079 The value of `COMPILER_PATH' is a colon-separated list of 13080 directories, much like `PATH'. GCC tries the directories thus 13081 specified when searching for subprograms, if it can't find the 13082 subprograms using `GCC_EXEC_PREFIX'. 13083 13084`LIBRARY_PATH' 13085 The value of `LIBRARY_PATH' is a colon-separated list of 13086 directories, much like `PATH'. When configured as a native 13087 compiler, GCC tries the directories thus specified when searching 13088 for special linker files, if it can't find them using 13089 `GCC_EXEC_PREFIX'. Linking using GCC also uses these directories 13090 when searching for ordinary libraries for the `-l' option (but 13091 directories specified with `-L' come first). 13092 13093`LANG' 13094 This variable is used to pass locale information to the compiler. 13095 One way in which this information is used is to determine the 13096 character set to be used when character literals, string literals 13097 and comments are parsed in C and C++. When the compiler is 13098 configured to allow multibyte characters, the following values for 13099 `LANG' are recognized: 13100 13101 `C-JIS' 13102 Recognize JIS characters. 13103 13104 `C-SJIS' 13105 Recognize SJIS characters. 13106 13107 `C-EUCJP' 13108 Recognize EUCJP characters. 13109 13110 If `LANG' is not defined, or if it has some other value, then the 13111 compiler will use mblen and mbtowc as defined by the default 13112 locale to recognize and translate multibyte characters. 13113 13114Some additional environments variables affect the behavior of the 13115preprocessor. 13116 13117`CPATH' 13118`C_INCLUDE_PATH' 13119`CPLUS_INCLUDE_PATH' 13120`OBJC_INCLUDE_PATH' 13121 Each variable's value is a list of directories separated by a 13122 special character, much like `PATH', in which to look for header 13123 files. The special character, `PATH_SEPARATOR', is 13124 target-dependent and determined at GCC build time. For Microsoft 13125 Windows-based targets it is a semicolon, and for almost all other 13126 targets it is a colon. 13127 13128 `CPATH' specifies a list of directories to be searched as if 13129 specified with `-I', but after any paths given with `-I' options 13130 on the command line. This environment variable is used regardless 13131 of which language is being preprocessed. 13132 13133 The remaining environment variables apply only when preprocessing 13134 the particular language indicated. Each specifies a list of 13135 directories to be searched as if specified with `-isystem', but 13136 after any paths given with `-isystem' options on the command line. 13137 13138 In all these variables, an empty element instructs the compiler to 13139 search its current working directory. Empty elements can appear 13140 at the beginning or end of a path. For instance, if the value of 13141 `CPATH' is `:/special/include', that has the same effect as 13142 `-I. -I/special/include'. 13143 13144`DEPENDENCIES_OUTPUT' 13145 If this variable is set, its value specifies how to output 13146 dependencies for Make based on the non-system header files 13147 processed by the compiler. System header files are ignored in the 13148 dependency output. 13149 13150 The value of `DEPENDENCIES_OUTPUT' can be just a file name, in 13151 which case the Make rules are written to that file, guessing the 13152 target name from the source file name. Or the value can have the 13153 form `FILE TARGET', in which case the rules are written to file 13154 FILE using TARGET as the target name. 13155 13156 In other words, this environment variable is equivalent to 13157 combining the options `-MM' and `-MF' (*note Preprocessor 13158 Options::), with an optional `-MT' switch too. 13159 13160`SUNPRO_DEPENDENCIES' 13161 This variable is the same as `DEPENDENCIES_OUTPUT' (see above), 13162 except that system header files are not ignored, so it implies 13163 `-M' rather than `-MM'. However, the dependence on the main input 13164 file is omitted. *Note Preprocessor Options::. 13165 13166 13167File: gcc.info, Node: Precompiled Headers, Next: Running Protoize, Prev: Environment Variables, Up: Invoking GCC 13168 131693.20 Using Precompiled Headers 13170============================== 13171 13172Often large projects have many header files that are included in every 13173source file. The time the compiler takes to process these header files 13174over and over again can account for nearly all of the time required to 13175build the project. To make builds faster, GCC allows users to 13176`precompile' a header file; then, if builds can use the precompiled 13177header file they will be much faster. 13178 13179 To create a precompiled header file, simply compile it as you would any 13180other file, if necessary using the `-x' option to make the driver treat 13181it as a C or C++ header file. You will probably want to use a tool 13182like `make' to keep the precompiled header up-to-date when the headers 13183it contains change. 13184 13185 A precompiled header file will be searched for when `#include' is seen 13186in the compilation. As it searches for the included file (*note Search 13187Path: (cpp)Search Path.) the compiler looks for a precompiled header in 13188each directory just before it looks for the include file in that 13189directory. The name searched for is the name specified in the 13190`#include' with `.gch' appended. If the precompiled header file can't 13191be used, it is ignored. 13192 13193 For instance, if you have `#include "all.h"', and you have `all.h.gch' 13194in the same directory as `all.h', then the precompiled header file will 13195be used if possible, and the original header will be used otherwise. 13196 13197 Alternatively, you might decide to put the precompiled header file in a 13198directory and use `-I' to ensure that directory is searched before (or 13199instead of) the directory containing the original header. Then, if you 13200want to check that the precompiled header file is always used, you can 13201put a file of the same name as the original header in this directory 13202containing an `#error' command. 13203 13204 This also works with `-include'. So yet another way to use 13205precompiled headers, good for projects not designed with precompiled 13206header files in mind, is to simply take most of the header files used by 13207a project, include them from another header file, precompile that header 13208file, and `-include' the precompiled header. If the header files have 13209guards against multiple inclusion, they will be skipped because they've 13210already been included (in the precompiled header). 13211 13212 If you need to precompile the same header file for different 13213languages, targets, or compiler options, you can instead make a 13214_directory_ named like `all.h.gch', and put each precompiled header in 13215the directory, perhaps using `-o'. It doesn't matter what you call the 13216files in the directory, every precompiled header in the directory will 13217be considered. The first precompiled header encountered in the 13218directory that is valid for this compilation will be used; they're 13219searched in no particular order. 13220 13221 There are many other possibilities, limited only by your imagination, 13222good sense, and the constraints of your build system. 13223 13224 A precompiled header file can be used only when these conditions apply: 13225 13226 * Only one precompiled header can be used in a particular 13227 compilation. 13228 13229 * A precompiled header can't be used once the first C token is seen. 13230 You can have preprocessor directives before a precompiled header; 13231 you can even include a precompiled header from inside another 13232 header, so long as there are no C tokens before the `#include'. 13233 13234 * The precompiled header file must be produced for the same language 13235 as the current compilation. You can't use a C precompiled header 13236 for a C++ compilation. 13237 13238 * The precompiled header file must have been produced by the same 13239 compiler binary as the current compilation is using. 13240 13241 * Any macros defined before the precompiled header is included must 13242 either be defined in the same way as when the precompiled header 13243 was generated, or must not affect the precompiled header, which 13244 usually means that they don't appear in the precompiled header at 13245 all. 13246 13247 The `-D' option is one way to define a macro before a precompiled 13248 header is included; using a `#define' can also do it. There are 13249 also some options that define macros implicitly, like `-O' and 13250 `-Wdeprecated'; the same rule applies to macros defined this way. 13251 13252 * If debugging information is output when using the precompiled 13253 header, using `-g' or similar, the same kind of debugging 13254 information must have been output when building the precompiled 13255 header. However, a precompiled header built using `-g' can be 13256 used in a compilation when no debugging information is being 13257 output. 13258 13259 * The same `-m' options must generally be used when building and 13260 using the precompiled header. *Note Submodel Options::, for any 13261 cases where this rule is relaxed. 13262 13263 * Each of the following options must be the same when building and 13264 using the precompiled header: 13265 13266 -fexceptions -funit-at-a-time 13267 13268 * Some other command-line options starting with `-f', `-p', or `-O' 13269 must be defined in the same way as when the precompiled header was 13270 generated. At present, it's not clear which options are safe to 13271 change and which are not; the safest choice is to use exactly the 13272 same options when generating and using the precompiled header. 13273 The following are known to be safe: 13274 13275 -fmessage-length= -fpreprocessed 13276 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous 13277 -fsched-verbose=<number> -fschedule-insns -fvisibility= 13278 -pedantic-errors 13279 13280 13281 For all of these except the last, the compiler will automatically 13282ignore the precompiled header if the conditions aren't met. If you 13283find an option combination that doesn't work and doesn't cause the 13284precompiled header to be ignored, please consider filing a bug report, 13285see *Note Bugs::. 13286 13287 If you do use differing options when generating and using the 13288precompiled header, the actual behavior will be a mixture of the 13289behavior for the options. For instance, if you use `-g' to generate 13290the precompiled header but not when using it, you may or may not get 13291debugging information for routines in the precompiled header. 13292 13293 13294File: gcc.info, Node: Running Protoize, Prev: Precompiled Headers, Up: Invoking GCC 13295 132963.21 Running Protoize 13297===================== 13298 13299The program `protoize' is an optional part of GCC. You can use it to 13300add prototypes to a program, thus converting the program to ISO C in 13301one respect. The companion program `unprotoize' does the reverse: it 13302removes argument types from any prototypes that are found. 13303 13304 When you run these programs, you must specify a set of source files as 13305command line arguments. The conversion programs start out by compiling 13306these files to see what functions they define. The information gathered 13307about a file FOO is saved in a file named `FOO.X'. 13308 13309 After scanning comes actual conversion. The specified files are all 13310eligible to be converted; any files they include (whether sources or 13311just headers) are eligible as well. 13312 13313 But not all the eligible files are converted. By default, `protoize' 13314and `unprotoize' convert only source and header files in the current 13315directory. You can specify additional directories whose files should 13316be converted with the `-d DIRECTORY' option. You can also specify 13317particular files to exclude with the `-x FILE' option. A file is 13318converted if it is eligible, its directory name matches one of the 13319specified directory names, and its name within the directory has not 13320been excluded. 13321 13322 Basic conversion with `protoize' consists of rewriting most function 13323definitions and function declarations to specify the types of the 13324arguments. The only ones not rewritten are those for varargs functions. 13325 13326 `protoize' optionally inserts prototype declarations at the beginning 13327of the source file, to make them available for any calls that precede 13328the function's definition. Or it can insert prototype declarations 13329with block scope in the blocks where undeclared functions are called. 13330 13331 Basic conversion with `unprotoize' consists of rewriting most function 13332declarations to remove any argument types, and rewriting function 13333definitions to the old-style pre-ISO form. 13334 13335 Both conversion programs print a warning for any function declaration 13336or definition that they can't convert. You can suppress these warnings 13337with `-q'. 13338 13339 The output from `protoize' or `unprotoize' replaces the original 13340source file. The original file is renamed to a name ending with 13341`.save' (for DOS, the saved filename ends in `.sav' without the 13342original `.c' suffix). If the `.save' (`.sav' for DOS) file already 13343exists, then the source file is simply discarded. 13344 13345 `protoize' and `unprotoize' both depend on GCC itself to scan the 13346program and collect information about the functions it uses. So 13347neither of these programs will work until GCC is installed. 13348 13349 Here is a table of the options you can use with `protoize' and 13350`unprotoize'. Each option works with both programs unless otherwise 13351stated. 13352 13353`-B DIRECTORY' 13354 Look for the file `SYSCALLS.c.X' in DIRECTORY, instead of the 13355 usual directory (normally `/usr/local/lib'). This file contains 13356 prototype information about standard system functions. This option 13357 applies only to `protoize'. 13358 13359`-c COMPILATION-OPTIONS' 13360 Use COMPILATION-OPTIONS as the options when running `gcc' to 13361 produce the `.X' files. The special option `-aux-info' is always 13362 passed in addition, to tell `gcc' to write a `.X' file. 13363 13364 Note that the compilation options must be given as a single 13365 argument to `protoize' or `unprotoize'. If you want to specify 13366 several `gcc' options, you must quote the entire set of 13367 compilation options to make them a single word in the shell. 13368 13369 There are certain `gcc' arguments that you cannot use, because they 13370 would produce the wrong kind of output. These include `-g', `-O', 13371 `-c', `-S', and `-o' If you include these in the 13372 COMPILATION-OPTIONS, they are ignored. 13373 13374`-C' 13375 Rename files to end in `.C' (`.cc' for DOS-based file systems) 13376 instead of `.c'. This is convenient if you are converting a C 13377 program to C++. This option applies only to `protoize'. 13378 13379`-g' 13380 Add explicit global declarations. This means inserting explicit 13381 declarations at the beginning of each source file for each function 13382 that is called in the file and was not declared. These 13383 declarations precede the first function definition that contains a 13384 call to an undeclared function. This option applies only to 13385 `protoize'. 13386 13387`-i STRING' 13388 Indent old-style parameter declarations with the string STRING. 13389 This option applies only to `protoize'. 13390 13391 `unprotoize' converts prototyped function definitions to old-style 13392 function definitions, where the arguments are declared between the 13393 argument list and the initial `{'. By default, `unprotoize' uses 13394 five spaces as the indentation. If you want to indent with just 13395 one space instead, use `-i " "'. 13396 13397`-k' 13398 Keep the `.X' files. Normally, they are deleted after conversion 13399 is finished. 13400 13401`-l' 13402 Add explicit local declarations. `protoize' with `-l' inserts a 13403 prototype declaration for each function in each block which calls 13404 the function without any declaration. This option applies only to 13405 `protoize'. 13406 13407`-n' 13408 Make no real changes. This mode just prints information about the 13409 conversions that would have been done without `-n'. 13410 13411`-N' 13412 Make no `.save' files. The original files are simply deleted. 13413 Use this option with caution. 13414 13415`-p PROGRAM' 13416 Use the program PROGRAM as the compiler. Normally, the name `gcc' 13417 is used. 13418 13419`-q' 13420 Work quietly. Most warnings are suppressed. 13421 13422`-v' 13423 Print the version number, just like `-v' for `gcc'. 13424 13425 If you need special compiler options to compile one of your program's 13426source files, then you should generate that file's `.X' file specially, 13427by running `gcc' on that source file with the appropriate options and 13428the option `-aux-info'. Then run `protoize' on the entire set of 13429files. `protoize' will use the existing `.X' file because it is newer 13430than the source file. For example: 13431 13432 gcc -Dfoo=bar file1.c -aux-info file1.X 13433 protoize *.c 13434 13435You need to include the special files along with the rest in the 13436`protoize' command, even though their `.X' files already exist, because 13437otherwise they won't get converted. 13438 13439 *Note Protoize Caveats::, for more information on how to use 13440`protoize' successfully. 13441 13442 13443File: gcc.info, Node: C Implementation, Next: C Extensions, Prev: Invoking GCC, Up: Top 13444 134454 C Implementation-defined behavior 13446*********************************** 13447 13448A conforming implementation of ISO C is required to document its choice 13449of behavior in each of the areas that are designated "implementation 13450defined". The following lists all such areas, along with the section 13451numbers from the ISO/IEC 9899:1990 and ISO/IEC 9899:1999 standards. 13452Some areas are only implementation-defined in one version of the 13453standard. 13454 13455 Some choices depend on the externally determined ABI for the platform 13456(including standard character encodings) which GCC follows; these are 13457listed as "determined by ABI" below. *Note Binary Compatibility: 13458Compatibility, and `http://gcc.gnu.org/readings.html'. Some choices 13459are documented in the preprocessor manual. *Note 13460Implementation-defined behavior: (cpp)Implementation-defined behavior. 13461Some choices are made by the library and operating system (or other 13462environment when compiling for a freestanding environment); refer to 13463their documentation for details. 13464 13465* Menu: 13466 13467* Translation implementation:: 13468* Environment implementation:: 13469* Identifiers implementation:: 13470* Characters implementation:: 13471* Integers implementation:: 13472* Floating point implementation:: 13473* Arrays and pointers implementation:: 13474* Hints implementation:: 13475* Structures unions enumerations and bit-fields implementation:: 13476* Qualifiers implementation:: 13477* Declarators implementation:: 13478* Statements implementation:: 13479* Preprocessing directives implementation:: 13480* Library functions implementation:: 13481* Architecture implementation:: 13482* Locale-specific behavior implementation:: 13483 13484 13485File: gcc.info, Node: Translation implementation, Next: Environment implementation, Up: C Implementation 13486 134874.1 Translation 13488=============== 13489 13490 * `How a diagnostic is identified (C90 3.7, C99 3.10, C90 and C99 13491 5.1.1.3).' 13492 13493 Diagnostics consist of all the output sent to stderr by GCC. 13494 13495 * `Whether each nonempty sequence of white-space characters other 13496 than new-line is retained or replaced by one space character in 13497 translation phase 3 (C90 and C99 5.1.1.2).' 13498 13499 *Note Implementation-defined behavior: (cpp)Implementation-defined 13500 behavior. 13501 13502 13503 13504File: gcc.info, Node: Environment implementation, Next: Identifiers implementation, Prev: Translation implementation, Up: C Implementation 13505 135064.2 Environment 13507=============== 13508 13509The behavior of most of these points are dependent on the implementation 13510of the C library, and are not defined by GCC itself. 13511 13512 * `The mapping between physical source file multibyte characters and 13513 the source character set in translation phase 1 (C90 and C99 13514 5.1.1.2).' 13515 13516 *Note Implementation-defined behavior: (cpp)Implementation-defined 13517 behavior. 13518 13519 13520 13521File: gcc.info, Node: Identifiers implementation, Next: Characters implementation, Prev: Environment implementation, Up: C Implementation 13522 135234.3 Identifiers 13524=============== 13525 13526 * `Which additional multibyte characters may appear in identifiers 13527 and their correspondence to universal character names (C99 6.4.2).' 13528 13529 *Note Implementation-defined behavior: (cpp)Implementation-defined 13530 behavior. 13531 13532 * `The number of significant initial characters in an identifier 13533 (C90 6.1.2, C90 and C99 5.2.4.1, C99 6.4.2).' 13534 13535 For internal names, all characters are significant. For external 13536 names, the number of significant characters are defined by the 13537 linker; for almost all targets, all characters are significant. 13538 13539 * `Whether case distinctions are significant in an identifier with 13540 external linkage (C90 6.1.2).' 13541 13542 This is a property of the linker. C99 requires that case 13543 distinctions are always significant in identifiers with external 13544 linkage and systems without this property are not supported by GCC. 13545 13546 13547 13548File: gcc.info, Node: Characters implementation, Next: Integers implementation, Prev: Identifiers implementation, Up: C Implementation 13549 135504.4 Characters 13551============== 13552 13553 * `The number of bits in a byte (C90 3.4, C99 3.6).' 13554 13555 Determined by ABI. 13556 13557 * `The values of the members of the execution character set (C90 and 13558 C99 5.2.1).' 13559 13560 Determined by ABI. 13561 13562 * `The unique value of the member of the execution character set 13563 produced for each of the standard alphabetic escape sequences (C90 13564 and C99 5.2.2).' 13565 13566 Determined by ABI. 13567 13568 * `The value of a `char' object into which has been stored any 13569 character other than a member of the basic execution character set 13570 (C90 6.1.2.5, C99 6.2.5).' 13571 13572 Determined by ABI. 13573 13574 * `Which of `signed char' or `unsigned char' has the same range, 13575 representation, and behavior as "plain" `char' (C90 6.1.2.5, C90 13576 6.2.1.1, C99 6.2.5, C99 6.3.1.1).' 13577 13578 Determined by ABI. The options `-funsigned-char' and 13579 `-fsigned-char' change the default. *Note Options Controlling C 13580 Dialect: C Dialect Options. 13581 13582 * `The mapping of members of the source character set (in character 13583 constants and string literals) to members of the execution 13584 character set (C90 6.1.3.4, C99 6.4.4.4, C90 and C99 5.1.1.2).' 13585 13586 Determined by ABI. 13587 13588 * `The value of an integer character constant containing more than 13589 one character or containing a character or escape sequence that 13590 does not map to a single-byte execution character (C90 6.1.3.4, 13591 C99 6.4.4.4).' 13592 13593 *Note Implementation-defined behavior: (cpp)Implementation-defined 13594 behavior. 13595 13596 * `The value of a wide character constant containing more than one 13597 multibyte character, or containing a multibyte character or escape 13598 sequence not represented in the extended execution character set 13599 (C90 6.1.3.4, C99 6.4.4.4).' 13600 13601 *Note Implementation-defined behavior: (cpp)Implementation-defined 13602 behavior. 13603 13604 * `The current locale used to convert a wide character constant 13605 consisting of a single multibyte character that maps to a member 13606 of the extended execution character set into a corresponding wide 13607 character code (C90 6.1.3.4, C99 6.4.4.4).' 13608 13609 *Note Implementation-defined behavior: (cpp)Implementation-defined 13610 behavior. 13611 13612 * `The current locale used to convert a wide string literal into 13613 corresponding wide character codes (C90 6.1.4, C99 6.4.5).' 13614 13615 *Note Implementation-defined behavior: (cpp)Implementation-defined 13616 behavior. 13617 13618 * `The value of a string literal containing a multibyte character or 13619 escape sequence not represented in the execution character set 13620 (C90 6.1.4, C99 6.4.5).' 13621 13622 *Note Implementation-defined behavior: (cpp)Implementation-defined 13623 behavior. 13624 13625 13626File: gcc.info, Node: Integers implementation, Next: Floating point implementation, Prev: Characters implementation, Up: C Implementation 13627 136284.5 Integers 13629============ 13630 13631 * `Any extended integer types that exist in the implementation (C99 13632 6.2.5).' 13633 13634 GCC does not support any extended integer types. 13635 13636 * `Whether signed integer types are represented using sign and 13637 magnitude, two's complement, or one's complement, and whether the 13638 extraordinary value is a trap representation or an ordinary value 13639 (C99 6.2.6.2).' 13640 13641 GCC supports only two's complement integer types, and all bit 13642 patterns are ordinary values. 13643 13644 * `The rank of any extended integer type relative to another extended 13645 integer type with the same precision (C99 6.3.1.1).' 13646 13647 GCC does not support any extended integer types. 13648 13649 * `The result of, or the signal raised by, converting an integer to a 13650 signed integer type when the value cannot be represented in an 13651 object of that type (C90 6.2.1.2, C99 6.3.1.3).' 13652 13653 For conversion to a type of width N, the value is reduced modulo 13654 2^N to be within range of the type; no signal is raised. 13655 13656 * `The results of some bitwise operations on signed integers (C90 13657 6.3, C99 6.5).' 13658 13659 Bitwise operators act on the representation of the value including 13660 both the sign and value bits, where the sign bit is considered 13661 immediately above the highest-value value bit. Signed `>>' acts 13662 on negative numbers by sign extension. 13663 13664 GCC does not use the latitude given in C99 only to treat certain 13665 aspects of signed `<<' as undefined, but this is subject to change. 13666 13667 * `The sign of the remainder on integer division (C90 6.3.5).' 13668 13669 GCC always follows the C99 requirement that the result of division 13670 is truncated towards zero. 13671 13672 13673 13674File: gcc.info, Node: Floating point implementation, Next: Arrays and pointers implementation, Prev: Integers implementation, Up: C Implementation 13675 136764.6 Floating point 13677================== 13678 13679 * `The accuracy of the floating-point operations and of the library 13680 functions in `<math.h>' and `<complex.h>' that return 13681 floating-point results (C90 and C99 5.2.4.2.2).' 13682 13683 The accuracy is unknown. 13684 13685 * `The rounding behaviors characterized by non-standard values of 13686 `FLT_ROUNDS' (C90 and C99 5.2.4.2.2).' 13687 13688 GCC does not use such values. 13689 13690 * `The evaluation methods characterized by non-standard negative 13691 values of `FLT_EVAL_METHOD' (C99 5.2.4.2.2).' 13692 13693 GCC does not use such values. 13694 13695 * `The direction of rounding when an integer is converted to a 13696 floating-point number that cannot exactly represent the original 13697 value (C90 6.2.1.3, C99 6.3.1.4).' 13698 13699 C99 Annex F is followed. 13700 13701 * `The direction of rounding when a floating-point number is 13702 converted to a narrower floating-point number (C90 6.2.1.4, C99 13703 6.3.1.5).' 13704 13705 C99 Annex F is followed. 13706 13707 * `How the nearest representable value or the larger or smaller 13708 representable value immediately adjacent to the nearest 13709 representable value is chosen for certain floating constants (C90 13710 6.1.3.1, C99 6.4.4.2).' 13711 13712 C99 Annex F is followed. 13713 13714 * `Whether and how floating expressions are contracted when not 13715 disallowed by the `FP_CONTRACT' pragma (C99 6.5).' 13716 13717 Expressions are currently only contracted if 13718 `-funsafe-math-optimizations' or `-ffast-math' are used. This is 13719 subject to change. 13720 13721 * `The default state for the `FENV_ACCESS' pragma (C99 7.6.1).' 13722 13723 This pragma is not implemented, but the default is to "off" unless 13724 `-frounding-math' is used in which case it is "on". 13725 13726 * `Additional floating-point exceptions, rounding modes, 13727 environments, and classifications, and their macro names (C99 7.6, 13728 C99 7.12).' 13729 13730 This is dependent on the implementation of the C library, and is 13731 not defined by GCC itself. 13732 13733 * `The default state for the `FP_CONTRACT' pragma (C99 7.12.2).' 13734 13735 This pragma is not implemented. Expressions are currently only 13736 contracted if `-funsafe-math-optimizations' or `-ffast-math' are 13737 used. This is subject to change. 13738 13739 * `Whether the "inexact" floating-point exception can be raised when 13740 the rounded result actually does equal the mathematical result in 13741 an IEC 60559 conformant implementation (C99 F.9).' 13742 13743 This is dependent on the implementation of the C library, and is 13744 not defined by GCC itself. 13745 13746 * `Whether the "underflow" (and "inexact") floating-point exception 13747 can be raised when a result is tiny but not inexact in an IEC 13748 60559 conformant implementation (C99 F.9).' 13749 13750 This is dependent on the implementation of the C library, and is 13751 not defined by GCC itself. 13752 13753 13754 13755File: gcc.info, Node: Arrays and pointers implementation, Next: Hints implementation, Prev: Floating point implementation, Up: C Implementation 13756 137574.7 Arrays and pointers 13758======================= 13759 13760 * `The result of converting a pointer to an integer or vice versa 13761 (C90 6.3.4, C99 6.3.2.3).' 13762 13763 A cast from pointer to integer discards most-significant bits if 13764 the pointer representation is larger than the integer type, 13765 sign-extends(1) if the pointer representation is smaller than the 13766 integer type, otherwise the bits are unchanged. 13767 13768 A cast from integer to pointer discards most-significant bits if 13769 the pointer representation is smaller than the integer type, 13770 extends according to the signedness of the integer type if the 13771 pointer representation is larger than the integer type, otherwise 13772 the bits are unchanged. 13773 13774 When casting from pointer to integer and back again, the resulting 13775 pointer must reference the same object as the original pointer, 13776 otherwise the behavior is undefined. That is, one may not use 13777 integer arithmetic to avoid the undefined behavior of pointer 13778 arithmetic as proscribed in C99 6.5.6/8. 13779 13780 * `The size of the result of subtracting two pointers to elements of 13781 the same array (C90 6.3.6, C99 6.5.6).' 13782 13783 The value is as specified in the standard and the type is 13784 determined by the ABI. 13785 13786 13787 ---------- Footnotes ---------- 13788 13789 (1) Future versions of GCC may zero-extend, or use a target-defined 13790`ptr_extend' pattern. Do not rely on sign extension. 13791 13792 13793File: gcc.info, Node: Hints implementation, Next: Structures unions enumerations and bit-fields implementation, Prev: Arrays and pointers implementation, Up: C Implementation 13794 137954.8 Hints 13796========= 13797 13798 * `The extent to which suggestions made by using the `register' 13799 storage-class specifier are effective (C90 6.5.1, C99 6.7.1).' 13800 13801 The `register' specifier affects code generation only in these 13802 ways: 13803 13804 * When used as part of the register variable extension, see 13805 *Note Explicit Reg Vars::. 13806 13807 * When `-O0' is in use, the compiler allocates distinct stack 13808 memory for all variables that do not have the `register' 13809 storage-class specifier; if `register' is specified, the 13810 variable may have a shorter lifespan than the code would 13811 indicate and may never be placed in memory. 13812 13813 * On some rare x86 targets, `setjmp' doesn't save the registers 13814 in all circumstances. In those cases, GCC doesn't allocate 13815 any variables in registers unless they are marked `register'. 13816 13817 13818 * `The extent to which suggestions made by using the inline function 13819 specifier are effective (C99 6.7.4).' 13820 13821 GCC will not inline any functions if the `-fno-inline' option is 13822 used or if `-O0' is used. Otherwise, GCC may still be unable to 13823 inline a function for many reasons; the `-Winline' option may be 13824 used to determine if a function has not been inlined and why not. 13825 13826 13827 13828File: gcc.info, Node: Structures unions enumerations and bit-fields implementation, Next: Qualifiers implementation, Prev: Hints implementation, Up: C Implementation 13829 138304.9 Structures, unions, enumerations, and bit-fields 13831==================================================== 13832 13833 * `A member of a union object is accessed using a member of a 13834 different type (C90 6.3.2.3).' 13835 13836 The relevant bytes of the representation of the object are treated 13837 as an object of the type used for the access. This may be a trap 13838 representation. 13839 13840 * `Whether a "plain" `int' bit-field is treated as a `signed int' 13841 bit-field or as an `unsigned int' bit-field (C90 6.5.2, C90 13842 6.5.2.1, C99 6.7.2, C99 6.7.2.1).' 13843 13844 By default it is treated as `signed int' but this may be changed 13845 by the `-funsigned-bitfields' option. 13846 13847 * `Allowable bit-field types other than `_Bool', `signed int', and 13848 `unsigned int' (C99 6.7.2.1).' 13849 13850 No other types are permitted in strictly conforming mode. 13851 13852 * `Whether a bit-field can straddle a storage-unit boundary (C90 13853 6.5.2.1, C99 6.7.2.1).' 13854 13855 Determined by ABI. 13856 13857 * `The order of allocation of bit-fields within a unit (C90 6.5.2.1, 13858 C99 6.7.2.1).' 13859 13860 Determined by ABI. 13861 13862 * `The alignment of non-bit-field members of structures (C90 13863 6.5.2.1, C99 6.7.2.1).' 13864 13865 Determined by ABI. 13866 13867 * `The integer type compatible with each enumerated type (C90 13868 6.5.2.2, C99 6.7.2.2).' 13869 13870 Normally, the type is `unsigned int' if there are no negative 13871 values in the enumeration, otherwise `int'. If `-fshort-enums' is 13872 specified, then if there are negative values it is the first of 13873 `signed char', `short' and `int' that can represent all the 13874 values, otherwise it is the first of `unsigned char', `unsigned 13875 short' and `unsigned int' that can represent all the values. 13876 13877 On some targets, `-fshort-enums' is the default; this is 13878 determined by the ABI. 13879 13880 13881 13882File: gcc.info, Node: Qualifiers implementation, Next: Declarators implementation, Prev: Structures unions enumerations and bit-fields implementation, Up: C Implementation 13883 138844.10 Qualifiers 13885=============== 13886 13887 * `What constitutes an access to an object that has 13888 volatile-qualified type (C90 6.5.3, C99 6.7.3).' 13889 13890 Such an object is normally accessed by pointers and used for 13891 accessing hardware. In most expressions, it is intuitively 13892 obvious what is a read and what is a write. For example 13893 13894 volatile int *dst = SOMEVALUE; 13895 volatile int *src = SOMEOTHERVALUE; 13896 *dst = *src; 13897 13898 will cause a read of the volatile object pointed to by SRC and 13899 store the value into the volatile object pointed to by DST. There 13900 is no guarantee that these reads and writes are atomic, especially 13901 for objects larger than `int'. 13902 13903 However, if the volatile storage is not being modified, and the 13904 value of the volatile storage is not used, then the situation is 13905 less obvious. For example 13906 13907 volatile int *src = SOMEVALUE; 13908 *src; 13909 13910 According to the C standard, such an expression is an rvalue whose 13911 type is the unqualified version of its original type, i.e. `int'. 13912 Whether GCC interprets this as a read of the volatile object being 13913 pointed to or only as a request to evaluate the expression for its 13914 side-effects depends on this type. 13915 13916 If it is a scalar type, or on most targets an aggregate type whose 13917 only member object is of a scalar type, or a union type whose 13918 member objects are of scalar types, the expression is interpreted 13919 by GCC as a read of the volatile object; in the other cases, the 13920 expression is only evaluated for its side-effects. 13921 13922 13923 13924File: gcc.info, Node: Declarators implementation, Next: Statements implementation, Prev: Qualifiers implementation, Up: C Implementation 13925 139264.11 Declarators 13927================ 13928 13929 * `The maximum number of declarators that may modify an arithmetic, 13930 structure or union type (C90 6.5.4).' 13931 13932 GCC is only limited by available memory. 13933 13934 13935 13936File: gcc.info, Node: Statements implementation, Next: Preprocessing directives implementation, Prev: Declarators implementation, Up: C Implementation 13937 139384.12 Statements 13939=============== 13940 13941 * `The maximum number of `case' values in a `switch' statement (C90 13942 6.6.4.2).' 13943 13944 GCC is only limited by available memory. 13945 13946 13947 13948File: gcc.info, Node: Preprocessing directives implementation, Next: Library functions implementation, Prev: Statements implementation, Up: C Implementation 13949 139504.13 Preprocessing directives 13951============================= 13952 13953*Note Implementation-defined behavior: (cpp)Implementation-defined 13954behavior, for details of these aspects of implementation-defined 13955behavior. 13956 13957 * `How sequences in both forms of header names are mapped to headers 13958 or external source file names (C90 6.1.7, C99 6.4.7).' 13959 13960 * `Whether the value of a character constant in a constant expression 13961 that controls conditional inclusion matches the value of the same 13962 character constant in the execution character set (C90 6.8.1, C99 13963 6.10.1).' 13964 13965 * `Whether the value of a single-character character constant in a 13966 constant expression that controls conditional inclusion may have a 13967 negative value (C90 6.8.1, C99 6.10.1).' 13968 13969 * `The places that are searched for an included `<>' delimited 13970 header, and how the places are specified or the header is 13971 identified (C90 6.8.2, C99 6.10.2).' 13972 13973 * `How the named source file is searched for in an included `""' 13974 delimited header (C90 6.8.2, C99 6.10.2).' 13975 13976 * `The method by which preprocessing tokens (possibly resulting from 13977 macro expansion) in a `#include' directive are combined into a 13978 header name (C90 6.8.2, C99 6.10.2).' 13979 13980 * `The nesting limit for `#include' processing (C90 6.8.2, C99 13981 6.10.2).' 13982 13983 * `Whether the `#' operator inserts a `\' character before the `\' 13984 character that begins a universal character name in a character 13985 constant or string literal (C99 6.10.3.2).' 13986 13987 * `The behavior on each recognized non-`STDC #pragma' directive (C90 13988 6.8.6, C99 6.10.6).' 13989 13990 *Note Pragmas: (cpp)Pragmas, for details of pragmas accepted by 13991 GCC on all targets. *Note Pragmas Accepted by GCC: Pragmas, for 13992 details of target-specific pragmas. 13993 13994 * `The definitions for `__DATE__' and `__TIME__' when respectively, 13995 the date and time of translation are not available (C90 6.8.8, C99 13996 6.10.8).' 13997 13998 13999 14000File: gcc.info, Node: Library functions implementation, Next: Architecture implementation, Prev: Preprocessing directives implementation, Up: C Implementation 14001 140024.14 Library functions 14003====================== 14004 14005The behavior of most of these points are dependent on the implementation 14006of the C library, and are not defined by GCC itself. 14007 14008 * `The null pointer constant to which the macro `NULL' expands (C90 14009 7.1.6, C99 7.17).' 14010 14011 In `<stddef.h>', `NULL' expands to `((void *)0)'. GCC does not 14012 provide the other headers which define `NULL' and some library 14013 implementations may use other definitions in those headers. 14014 14015 14016 14017File: gcc.info, Node: Architecture implementation, Next: Locale-specific behavior implementation, Prev: Library functions implementation, Up: C Implementation 14018 140194.15 Architecture 14020================= 14021 14022 * `The values or expressions assigned to the macros specified in the 14023 headers `<float.h>', `<limits.h>', and `<stdint.h>' (C90 and C99 14024 5.2.4.2, C99 7.18.2, C99 7.18.3).' 14025 14026 Determined by ABI. 14027 14028 * `The number, order, and encoding of bytes in any object (when not 14029 explicitly specified in this International Standard) (C99 14030 6.2.6.1).' 14031 14032 Determined by ABI. 14033 14034 * `The value of the result of the `sizeof' operator (C90 6.3.3.4, 14035 C99 6.5.3.4).' 14036 14037 Determined by ABI. 14038 14039 14040 14041File: gcc.info, Node: Locale-specific behavior implementation, Prev: Architecture implementation, Up: C Implementation 14042 140434.16 Locale-specific behavior 14044============================= 14045 14046The behavior of these points are dependent on the implementation of the 14047C library, and are not defined by GCC itself. 14048 14049 14050File: gcc.info, Node: C Extensions, Next: C++ Extensions, Prev: C Implementation, Up: Top 14051 140525 Extensions to the C Language Family 14053************************************* 14054 14055GNU C provides several language features not found in ISO standard C. 14056(The `-pedantic' option directs GCC to print a warning message if any 14057of these features is used.) To test for the availability of these 14058features in conditional compilation, check for a predefined macro 14059`__GNUC__', which is always defined under GCC. 14060 14061 These extensions are available in C and Objective-C. Most of them are 14062also available in C++. *Note Extensions to the C++ Language: C++ 14063Extensions, for extensions that apply _only_ to C++. 14064 14065 Some features that are in ISO C99 but not C89 or C++ are also, as 14066extensions, accepted by GCC in C89 mode and in C++. 14067 14068* Menu: 14069 14070* Statement Exprs:: Putting statements and declarations inside expressions. 14071* Local Labels:: Labels local to a block. 14072* Labels as Values:: Getting pointers to labels, and computed gotos. 14073* Nested Functions:: As in Algol and Pascal, lexical scoping of functions. 14074* Constructing Calls:: Dispatching a call to another function. 14075* Typeof:: `typeof': referring to the type of an expression. 14076* Conditionals:: Omitting the middle operand of a `?:' expression. 14077* Long Long:: Double-word integers---`long long int'. 14078* Complex:: Data types for complex numbers. 14079* Decimal Float:: Decimal Floating Types. 14080* Hex Floats:: Hexadecimal floating-point constants. 14081* Zero Length:: Zero-length arrays. 14082* Variable Length:: Arrays whose length is computed at run time. 14083* Empty Structures:: Structures with no members. 14084* Variadic Macros:: Macros with a variable number of arguments. 14085* Escaped Newlines:: Slightly looser rules for escaped newlines. 14086* Subscripting:: Any array can be subscripted, even if not an lvalue. 14087* Pointer Arith:: Arithmetic on `void'-pointers and function pointers. 14088* Initializers:: Non-constant initializers. 14089* Compound Literals:: Compound literals give structures, unions 14090 or arrays as values. 14091* Designated Inits:: Labeling elements of initializers. 14092* Cast to Union:: Casting to union type from any member of the union. 14093* Case Ranges:: `case 1 ... 9' and such. 14094* Mixed Declarations:: Mixing declarations and code. 14095* Function Attributes:: Declaring that functions have no side effects, 14096 or that they can never return. 14097* Attribute Syntax:: Formal syntax for attributes. 14098* Function Prototypes:: Prototype declarations and old-style definitions. 14099* C++ Comments:: C++ comments are recognized. 14100* Dollar Signs:: Dollar sign is allowed in identifiers. 14101* Character Escapes:: `\e' stands for the character <ESC>. 14102* Variable Attributes:: Specifying attributes of variables. 14103* Type Attributes:: Specifying attributes of types. 14104* Alignment:: Inquiring about the alignment of a type or variable. 14105* Inline:: Defining inline functions (as fast as macros). 14106* Extended Asm:: Assembler instructions with C expressions as operands. 14107 (With them you can define ``built-in'' functions.) 14108* Constraints:: Constraints for asm operands 14109* Asm Labels:: Specifying the assembler name to use for a C symbol. 14110* Explicit Reg Vars:: Defining variables residing in specified registers. 14111* Alternate Keywords:: `__const__', `__asm__', etc., for header files. 14112* Incomplete Enums:: `enum foo;', with details to follow. 14113* Function Names:: Printable strings which are the name of the current 14114 function. 14115* Return Address:: Getting the return or frame address of a function. 14116* Vector Extensions:: Using vector instructions through built-in functions. 14117* Offsetof:: Special syntax for implementing `offsetof'. 14118* Atomic Builtins:: Built-in functions for atomic memory access. 14119* Object Size Checking:: Built-in functions for limited buffer overflow 14120 checking. 14121* Other Builtins:: Other built-in functions. 14122* Target Builtins:: Built-in functions specific to particular targets. 14123* Target Format Checks:: Format checks specific to particular targets. 14124* Pragmas:: Pragmas accepted by GCC. 14125* Unnamed Fields:: Unnamed struct/union fields within structs/unions. 14126* Thread-Local:: Per-thread variables. 14127 14128 14129File: gcc.info, Node: Statement Exprs, Next: Local Labels, Up: C Extensions 14130 141315.1 Statements and Declarations in Expressions 14132============================================== 14133 14134A compound statement enclosed in parentheses may appear as an expression 14135in GNU C. This allows you to use loops, switches, and local variables 14136within an expression. 14137 14138 Recall that a compound statement is a sequence of statements surrounded 14139by braces; in this construct, parentheses go around the braces. For 14140example: 14141 14142 ({ int y = foo (); int z; 14143 if (y > 0) z = y; 14144 else z = - y; 14145 z; }) 14146 14147is a valid (though slightly more complex than necessary) expression for 14148the absolute value of `foo ()'. 14149 14150 The last thing in the compound statement should be an expression 14151followed by a semicolon; the value of this subexpression serves as the 14152value of the entire construct. (If you use some other kind of statement 14153last within the braces, the construct has type `void', and thus 14154effectively no value.) 14155 14156 This feature is especially useful in making macro definitions "safe" 14157(so that they evaluate each operand exactly once). For example, the 14158"maximum" function is commonly defined as a macro in standard C as 14159follows: 14160 14161 #define max(a,b) ((a) > (b) ? (a) : (b)) 14162 14163But this definition computes either A or B twice, with bad results if 14164the operand has side effects. In GNU C, if you know the type of the 14165operands (here taken as `int'), you can define the macro safely as 14166follows: 14167 14168 #define maxint(a,b) \ 14169 ({int _a = (a), _b = (b); _a > _b ? _a : _b; }) 14170 14171 Embedded statements are not allowed in constant expressions, such as 14172the value of an enumeration constant, the width of a bit-field, or the 14173initial value of a static variable. 14174 14175 If you don't know the type of the operand, you can still do this, but 14176you must use `typeof' (*note Typeof::). 14177 14178 In G++, the result value of a statement expression undergoes array and 14179function pointer decay, and is returned by value to the enclosing 14180expression. For instance, if `A' is a class, then 14181 14182 A a; 14183 14184 ({a;}).Foo () 14185 14186will construct a temporary `A' object to hold the result of the 14187statement expression, and that will be used to invoke `Foo'. Therefore 14188the `this' pointer observed by `Foo' will not be the address of `a'. 14189 14190 Any temporaries created within a statement within a statement 14191expression will be destroyed at the statement's end. This makes 14192statement expressions inside macros slightly different from function 14193calls. In the latter case temporaries introduced during argument 14194evaluation will be destroyed at the end of the statement that includes 14195the function call. In the statement expression case they will be 14196destroyed during the statement expression. For instance, 14197 14198 #define macro(a) ({__typeof__(a) b = (a); b + 3; }) 14199 template<typename T> T function(T a) { T b = a; return b + 3; } 14200 14201 void foo () 14202 { 14203 macro (X ()); 14204 function (X ()); 14205 } 14206 14207will have different places where temporaries are destroyed. For the 14208`macro' case, the temporary `X' will be destroyed just after the 14209initialization of `b'. In the `function' case that temporary will be 14210destroyed when the function returns. 14211 14212 These considerations mean that it is probably a bad idea to use 14213statement-expressions of this form in header files that are designed to 14214work with C++. (Note that some versions of the GNU C Library contained 14215header files using statement-expression that lead to precisely this 14216bug.) 14217 14218 Jumping into a statement expression with `goto' or using a `switch' 14219statement outside the statement expression with a `case' or `default' 14220label inside the statement expression is not permitted. Jumping into a 14221statement expression with a computed `goto' (*note Labels as Values::) 14222yields undefined behavior. Jumping out of a statement expression is 14223permitted, but if the statement expression is part of a larger 14224expression then it is unspecified which other subexpressions of that 14225expression have been evaluated except where the language definition 14226requires certain subexpressions to be evaluated before or after the 14227statement expression. In any case, as with a function call the 14228evaluation of a statement expression is not interleaved with the 14229evaluation of other parts of the containing expression. For example, 14230 14231 foo (), (({ bar1 (); goto a; 0; }) + bar2 ()), baz(); 14232 14233will call `foo' and `bar1' and will not call `baz' but may or may not 14234call `bar2'. If `bar2' is called, it will be called after `foo' and 14235before `bar1' 14236 14237 14238File: gcc.info, Node: Local Labels, Next: Labels as Values, Prev: Statement Exprs, Up: C Extensions 14239 142405.2 Locally Declared Labels 14241=========================== 14242 14243GCC allows you to declare "local labels" in any nested block scope. A 14244local label is just like an ordinary label, but you can only reference 14245it (with a `goto' statement, or by taking its address) within the block 14246in which it was declared. 14247 14248 A local label declaration looks like this: 14249 14250 __label__ LABEL; 14251 14252or 14253 14254 __label__ LABEL1, LABEL2, /* ... */; 14255 14256 Local label declarations must come at the beginning of the block, 14257before any ordinary declarations or statements. 14258 14259 The label declaration defines the label _name_, but does not define 14260the label itself. You must do this in the usual way, with `LABEL:', 14261within the statements of the statement expression. 14262 14263 The local label feature is useful for complex macros. If a macro 14264contains nested loops, a `goto' can be useful for breaking out of them. 14265However, an ordinary label whose scope is the whole function cannot be 14266used: if the macro can be expanded several times in one function, the 14267label will be multiply defined in that function. A local label avoids 14268this problem. For example: 14269 14270 #define SEARCH(value, array, target) \ 14271 do { \ 14272 __label__ found; \ 14273 typeof (target) _SEARCH_target = (target); \ 14274 typeof (*(array)) *_SEARCH_array = (array); \ 14275 int i, j; \ 14276 int value; \ 14277 for (i = 0; i < max; i++) \ 14278 for (j = 0; j < max; j++) \ 14279 if (_SEARCH_array[i][j] == _SEARCH_target) \ 14280 { (value) = i; goto found; } \ 14281 (value) = -1; \ 14282 found:; \ 14283 } while (0) 14284 14285 This could also be written using a statement-expression: 14286 14287 #define SEARCH(array, target) \ 14288 ({ \ 14289 __label__ found; \ 14290 typeof (target) _SEARCH_target = (target); \ 14291 typeof (*(array)) *_SEARCH_array = (array); \ 14292 int i, j; \ 14293 int value; \ 14294 for (i = 0; i < max; i++) \ 14295 for (j = 0; j < max; j++) \ 14296 if (_SEARCH_array[i][j] == _SEARCH_target) \ 14297 { value = i; goto found; } \ 14298 value = -1; \ 14299 found: \ 14300 value; \ 14301 }) 14302 14303 Local label declarations also make the labels they declare visible to 14304nested functions, if there are any. *Note Nested Functions::, for 14305details. 14306 14307 14308File: gcc.info, Node: Labels as Values, Next: Nested Functions, Prev: Local Labels, Up: C Extensions 14309 143105.3 Labels as Values 14311==================== 14312 14313You can get the address of a label defined in the current function (or 14314a containing function) with the unary operator `&&'. The value has 14315type `void *'. This value is a constant and can be used wherever a 14316constant of that type is valid. For example: 14317 14318 void *ptr; 14319 /* ... */ 14320 ptr = &&foo; 14321 14322 To use these values, you need to be able to jump to one. This is done 14323with the computed goto statement(1), `goto *EXP;'. For example, 14324 14325 goto *ptr; 14326 14327Any expression of type `void *' is allowed. 14328 14329 One way of using these constants is in initializing a static array that 14330will serve as a jump table: 14331 14332 static void *array[] = { &&foo, &&bar, &&hack }; 14333 14334 Then you can select a label with indexing, like this: 14335 14336 goto *array[i]; 14337 14338Note that this does not check whether the subscript is in bounds--array 14339indexing in C never does that. 14340 14341 Such an array of label values serves a purpose much like that of the 14342`switch' statement. The `switch' statement is cleaner, so use that 14343rather than an array unless the problem does not fit a `switch' 14344statement very well. 14345 14346 Another use of label values is in an interpreter for threaded code. 14347The labels within the interpreter function can be stored in the 14348threaded code for super-fast dispatching. 14349 14350 You may not use this mechanism to jump to code in a different function. 14351If you do that, totally unpredictable things will happen. The best way 14352to avoid this is to store the label address only in automatic variables 14353and never pass it as an argument. 14354 14355 An alternate way to write the above example is 14356 14357 static const int array[] = { &&foo - &&foo, &&bar - &&foo, 14358 &&hack - &&foo }; 14359 goto *(&&foo + array[i]); 14360 14361This is more friendly to code living in shared libraries, as it reduces 14362the number of dynamic relocations that are needed, and by consequence, 14363allows the data to be read-only. 14364 14365 ---------- Footnotes ---------- 14366 14367 (1) The analogous feature in Fortran is called an assigned goto, but 14368that name seems inappropriate in C, where one can do more than simply 14369store label addresses in label variables. 14370 14371 14372File: gcc.info, Node: Nested Functions, Next: Constructing Calls, Prev: Labels as Values, Up: C Extensions 14373 143745.4 Nested Functions 14375==================== 14376 14377A "nested function" is a function defined inside another function. 14378(Nested functions are not supported for GNU C++.) The nested function's 14379name is local to the block where it is defined. For example, here we 14380define a nested function named `square', and call it twice: 14381 14382 foo (double a, double b) 14383 { 14384 double square (double z) { return z * z; } 14385 14386 return square (a) + square (b); 14387 } 14388 14389 The nested function can access all the variables of the containing 14390function that are visible at the point of its definition. This is 14391called "lexical scoping". For example, here we show a nested function 14392which uses an inherited variable named `offset': 14393 14394 bar (int *array, int offset, int size) 14395 { 14396 int access (int *array, int index) 14397 { return array[index + offset]; } 14398 int i; 14399 /* ... */ 14400 for (i = 0; i < size; i++) 14401 /* ... */ access (array, i) /* ... */ 14402 } 14403 14404 Nested function definitions are permitted within functions in the 14405places where variable definitions are allowed; that is, in any block, 14406mixed with the other declarations and statements in the block. 14407 14408 It is possible to call the nested function from outside the scope of 14409its name by storing its address or passing the address to another 14410function: 14411 14412 hack (int *array, int size) 14413 { 14414 void store (int index, int value) 14415 { array[index] = value; } 14416 14417 intermediate (store, size); 14418 } 14419 14420 Here, the function `intermediate' receives the address of `store' as 14421an argument. If `intermediate' calls `store', the arguments given to 14422`store' are used to store into `array'. But this technique works only 14423so long as the containing function (`hack', in this example) does not 14424exit. 14425 14426 If you try to call the nested function through its address after the 14427containing function has exited, all hell will break loose. If you try 14428to call it after a containing scope level has exited, and if it refers 14429to some of the variables that are no longer in scope, you may be lucky, 14430but it's not wise to take the risk. If, however, the nested function 14431does not refer to anything that has gone out of scope, you should be 14432safe. 14433 14434 GCC implements taking the address of a nested function using a 14435technique called "trampolines". A paper describing them is available as 14436 14437`http://people.debian.org/~aaronl/Usenix88-lexic.pdf'. 14438 14439 A nested function can jump to a label inherited from a containing 14440function, provided the label was explicitly declared in the containing 14441function (*note Local Labels::). Such a jump returns instantly to the 14442containing function, exiting the nested function which did the `goto' 14443and any intermediate functions as well. Here is an example: 14444 14445 bar (int *array, int offset, int size) 14446 { 14447 __label__ failure; 14448 int access (int *array, int index) 14449 { 14450 if (index > size) 14451 goto failure; 14452 return array[index + offset]; 14453 } 14454 int i; 14455 /* ... */ 14456 for (i = 0; i < size; i++) 14457 /* ... */ access (array, i) /* ... */ 14458 /* ... */ 14459 return 0; 14460 14461 /* Control comes here from `access' 14462 if it detects an error. */ 14463 failure: 14464 return -1; 14465 } 14466 14467 A nested function always has no linkage. Declaring one with `extern' 14468or `static' is erroneous. If you need to declare the nested function 14469before its definition, use `auto' (which is otherwise meaningless for 14470function declarations). 14471 14472 bar (int *array, int offset, int size) 14473 { 14474 __label__ failure; 14475 auto int access (int *, int); 14476 /* ... */ 14477 int access (int *array, int index) 14478 { 14479 if (index > size) 14480 goto failure; 14481 return array[index + offset]; 14482 } 14483 /* ... */ 14484 } 14485 14486 14487File: gcc.info, Node: Constructing Calls, Next: Typeof, Prev: Nested Functions, Up: C Extensions 14488 144895.5 Constructing Function Calls 14490=============================== 14491 14492Using the built-in functions described below, you can record the 14493arguments a function received, and call another function with the same 14494arguments, without knowing the number or types of the arguments. 14495 14496 You can also record the return value of that function call, and later 14497return that value, without knowing what data type the function tried to 14498return (as long as your caller expects that data type). 14499 14500 However, these built-in functions may interact badly with some 14501sophisticated features or other extensions of the language. It is, 14502therefore, not recommended to use them outside very simple functions 14503acting as mere forwarders for their arguments. 14504 14505 -- Built-in Function: void * __builtin_apply_args () 14506 This built-in function returns a pointer to data describing how to 14507 perform a call with the same arguments as were passed to the 14508 current function. 14509 14510 The function saves the arg pointer register, structure value 14511 address, and all registers that might be used to pass arguments to 14512 a function into a block of memory allocated on the stack. Then it 14513 returns the address of that block. 14514 14515 -- Built-in Function: void * __builtin_apply (void (*FUNCTION)(), void 14516 *ARGUMENTS, size_t SIZE) 14517 This built-in function invokes FUNCTION with a copy of the 14518 parameters described by ARGUMENTS and SIZE. 14519 14520 The value of ARGUMENTS should be the value returned by 14521 `__builtin_apply_args'. The argument SIZE specifies the size of 14522 the stack argument data, in bytes. 14523 14524 This function returns a pointer to data describing how to return 14525 whatever value was returned by FUNCTION. The data is saved in a 14526 block of memory allocated on the stack. 14527 14528 It is not always simple to compute the proper value for SIZE. The 14529 value is used by `__builtin_apply' to compute the amount of data 14530 that should be pushed on the stack and copied from the incoming 14531 argument area. 14532 14533 -- Built-in Function: void __builtin_return (void *RESULT) 14534 This built-in function returns the value described by RESULT from 14535 the containing function. You should specify, for RESULT, a value 14536 returned by `__builtin_apply'. 14537 14538 14539File: gcc.info, Node: Typeof, Next: Conditionals, Prev: Constructing Calls, Up: C Extensions 14540 145415.6 Referring to a Type with `typeof' 14542===================================== 14543 14544Another way to refer to the type of an expression is with `typeof'. 14545The syntax of using of this keyword looks like `sizeof', but the 14546construct acts semantically like a type name defined with `typedef'. 14547 14548 There are two ways of writing the argument to `typeof': with an 14549expression or with a type. Here is an example with an expression: 14550 14551 typeof (x[0](1)) 14552 14553This assumes that `x' is an array of pointers to functions; the type 14554described is that of the values of the functions. 14555 14556 Here is an example with a typename as the argument: 14557 14558 typeof (int *) 14559 14560Here the type described is that of pointers to `int'. 14561 14562 If you are writing a header file that must work when included in ISO C 14563programs, write `__typeof__' instead of `typeof'. *Note Alternate 14564Keywords::. 14565 14566 A `typeof'-construct can be used anywhere a typedef name could be 14567used. For example, you can use it in a declaration, in a cast, or 14568inside of `sizeof' or `typeof'. 14569 14570 `typeof' is often useful in conjunction with the 14571statements-within-expressions feature. Here is how the two together can 14572be used to define a safe "maximum" macro that operates on any 14573arithmetic type and evaluates each of its arguments exactly once: 14574 14575 #define max(a,b) \ 14576 ({ typeof (a) _a = (a); \ 14577 typeof (b) _b = (b); \ 14578 _a > _b ? _a : _b; }) 14579 14580 The reason for using names that start with underscores for the local 14581variables is to avoid conflicts with variable names that occur within 14582the expressions that are substituted for `a' and `b'. Eventually we 14583hope to design a new form of declaration syntax that allows you to 14584declare variables whose scopes start only after their initializers; 14585this will be a more reliable way to prevent such conflicts. 14586 14587Some more examples of the use of `typeof': 14588 14589 * This declares `y' with the type of what `x' points to. 14590 14591 typeof (*x) y; 14592 14593 * This declares `y' as an array of such values. 14594 14595 typeof (*x) y[4]; 14596 14597 * This declares `y' as an array of pointers to characters: 14598 14599 typeof (typeof (char *)[4]) y; 14600 14601 It is equivalent to the following traditional C declaration: 14602 14603 char *y[4]; 14604 14605 To see the meaning of the declaration using `typeof', and why it 14606 might be a useful way to write, rewrite it with these macros: 14607 14608 #define pointer(T) typeof(T *) 14609 #define array(T, N) typeof(T [N]) 14610 14611 Now the declaration can be rewritten this way: 14612 14613 array (pointer (char), 4) y; 14614 14615 Thus, `array (pointer (char), 4)' is the type of arrays of 4 14616 pointers to `char'. 14617 14618 _Compatibility Note:_ In addition to `typeof', GCC 2 supported a more 14619limited extension which permitted one to write 14620 14621 typedef T = EXPR; 14622 14623with the effect of declaring T to have the type of the expression EXPR. 14624This extension does not work with GCC 3 (versions between 3.0 and 3.2 14625will crash; 3.2.1 and later give an error). Code which relies on it 14626should be rewritten to use `typeof': 14627 14628 typedef typeof(EXPR) T; 14629 14630This will work with all versions of GCC. 14631 14632 14633File: gcc.info, Node: Conditionals, Next: Long Long, Prev: Typeof, Up: C Extensions 14634 146355.7 Conditionals with Omitted Operands 14636====================================== 14637 14638The middle operand in a conditional expression may be omitted. Then if 14639the first operand is nonzero, its value is the value of the conditional 14640expression. 14641 14642 Therefore, the expression 14643 14644 x ? : y 14645 14646has the value of `x' if that is nonzero; otherwise, the value of `y'. 14647 14648 This example is perfectly equivalent to 14649 14650 x ? x : y 14651 14652In this simple case, the ability to omit the middle operand is not 14653especially useful. When it becomes useful is when the first operand 14654does, or may (if it is a macro argument), contain a side effect. Then 14655repeating the operand in the middle would perform the side effect 14656twice. Omitting the middle operand uses the value already computed 14657without the undesirable effects of recomputing it. 14658 14659 14660File: gcc.info, Node: Long Long, Next: Complex, Prev: Conditionals, Up: C Extensions 14661 146625.8 Double-Word Integers 14663======================== 14664 14665ISO C99 supports data types for integers that are at least 64 bits wide, 14666and as an extension GCC supports them in C89 mode and in C++. Simply 14667write `long long int' for a signed integer, or `unsigned long long int' 14668for an unsigned integer. To make an integer constant of type `long 14669long int', add the suffix `LL' to the integer. To make an integer 14670constant of type `unsigned long long int', add the suffix `ULL' to the 14671integer. 14672 14673 You can use these types in arithmetic like any other integer types. 14674Addition, subtraction, and bitwise boolean operations on these types 14675are open-coded on all types of machines. Multiplication is open-coded 14676if the machine supports fullword-to-doubleword a widening multiply 14677instruction. Division and shifts are open-coded only on machines that 14678provide special support. The operations that are not open-coded use 14679special library routines that come with GCC. 14680 14681 There may be pitfalls when you use `long long' types for function 14682arguments, unless you declare function prototypes. If a function 14683expects type `int' for its argument, and you pass a value of type `long 14684long int', confusion will result because the caller and the subroutine 14685will disagree about the number of bytes for the argument. Likewise, if 14686the function expects `long long int' and you pass `int'. The best way 14687to avoid such problems is to use prototypes. 14688 14689 14690File: gcc.info, Node: Complex, Next: Decimal Float, Prev: Long Long, Up: C Extensions 14691 146925.9 Complex Numbers 14693=================== 14694 14695ISO C99 supports complex floating data types, and as an extension GCC 14696supports them in C89 mode and in C++, and supports complex integer data 14697types which are not part of ISO C99. You can declare complex types 14698using the keyword `_Complex'. As an extension, the older GNU keyword 14699`__complex__' is also supported. 14700 14701 For example, `_Complex double x;' declares `x' as a variable whose 14702real part and imaginary part are both of type `double'. `_Complex 14703short int y;' declares `y' to have real and imaginary parts of type 14704`short int'; this is not likely to be useful, but it shows that the set 14705of complex types is complete. 14706 14707 To write a constant with a complex data type, use the suffix `i' or 14708`j' (either one; they are equivalent). For example, `2.5fi' has type 14709`_Complex float' and `3i' has type `_Complex int'. Such a constant 14710always has a pure imaginary value, but you can form any complex value 14711you like by adding one to a real constant. This is a GNU extension; if 14712you have an ISO C99 conforming C library (such as GNU libc), and want 14713to construct complex constants of floating type, you should include 14714`<complex.h>' and use the macros `I' or `_Complex_I' instead. 14715 14716 To extract the real part of a complex-valued expression EXP, write 14717`__real__ EXP'. Likewise, use `__imag__' to extract the imaginary 14718part. This is a GNU extension; for values of floating type, you should 14719use the ISO C99 functions `crealf', `creal', `creall', `cimagf', 14720`cimag' and `cimagl', declared in `<complex.h>' and also provided as 14721built-in functions by GCC. 14722 14723 The operator `~' performs complex conjugation when used on a value 14724with a complex type. This is a GNU extension; for values of floating 14725type, you should use the ISO C99 functions `conjf', `conj' and `conjl', 14726declared in `<complex.h>' and also provided as built-in functions by 14727GCC. 14728 14729 GCC can allocate complex automatic variables in a noncontiguous 14730fashion; it's even possible for the real part to be in a register while 14731the imaginary part is on the stack (or vice-versa). Only the DWARF2 14732debug info format can represent this, so use of DWARF2 is recommended. 14733If you are using the stabs debug info format, GCC describes a 14734noncontiguous complex variable as if it were two separate variables of 14735noncomplex type. If the variable's actual name is `foo', the two 14736fictitious variables are named `foo$real' and `foo$imag'. You can 14737examine and set these two fictitious variables with your debugger. 14738 14739 14740File: gcc.info, Node: Decimal Float, Next: Hex Floats, Prev: Complex, Up: C Extensions 14741 147425.10 Decimal Floating Types 14743=========================== 14744 14745As an extension, the GNU C compiler supports decimal floating types as 14746defined in the N1176 draft of ISO/IEC WDTR24732. Support for decimal 14747floating types in GCC will evolve as the draft technical report changes. 14748Calling conventions for any target might also change. Not all targets 14749support decimal floating types. 14750 14751 The decimal floating types are `_Decimal32', `_Decimal64', and 14752`_Decimal128'. They use a radix of ten, unlike the floating types 14753`float', `double', and `long double' whose radix is not specified by 14754the C standard but is usually two. 14755 14756 Support for decimal floating types includes the arithmetic operators 14757add, subtract, multiply, divide; unary arithmetic operators; relational 14758operators; equality operators; and conversions to and from integer and 14759other floating types. Use a suffix `df' or `DF' in a literal constant 14760of type `_Decimal32', `dd' or `DD' for `_Decimal64', and `dl' or `DL' 14761for `_Decimal128'. 14762 14763 GCC support of decimal float as specified by the draft technical report 14764is incomplete: 14765 14766 * Translation time data type (TTDT) is not supported. 14767 14768 * Characteristics of decimal floating types are defined in header 14769 file `decfloat.h' rather than `float.h'. 14770 14771 * When the value of a decimal floating type cannot be represented in 14772 the integer type to which it is being converted, the result is 14773 undefined rather than the result value specified by the draft 14774 technical report. 14775 14776 Types `_Decimal32', `_Decimal64', and `_Decimal128' are supported by 14777the DWARF2 debug information format. 14778 14779 14780File: gcc.info, Node: Hex Floats, Next: Zero Length, Prev: Decimal Float, Up: C Extensions 14781 147825.11 Hex Floats 14783=============== 14784 14785ISO C99 supports floating-point numbers written not only in the usual 14786decimal notation, such as `1.55e1', but also numbers such as `0x1.fp3' 14787written in hexadecimal format. As a GNU extension, GCC supports this 14788in C89 mode (except in some cases when strictly conforming) and in C++. 14789In that format the `0x' hex introducer and the `p' or `P' exponent 14790field are mandatory. The exponent is a decimal number that indicates 14791the power of 2 by which the significant part will be multiplied. Thus 14792`0x1.f' is 1 15/16, `p3' multiplies it by 8, and the value of `0x1.fp3' 14793is the same as `1.55e1'. 14794 14795 Unlike for floating-point numbers in the decimal notation the exponent 14796is always required in the hexadecimal notation. Otherwise the compiler 14797would not be able to resolve the ambiguity of, e.g., `0x1.f'. This 14798could mean `1.0f' or `1.9375' since `f' is also the extension for 14799floating-point constants of type `float'. 14800 14801 14802File: gcc.info, Node: Zero Length, Next: Variable Length, Prev: Hex Floats, Up: C Extensions 14803 148045.12 Arrays of Length Zero 14805========================== 14806 14807Zero-length arrays are allowed in GNU C. They are very useful as the 14808last element of a structure which is really a header for a 14809variable-length object: 14810 14811 struct line { 14812 int length; 14813 char contents[0]; 14814 }; 14815 14816 struct line *thisline = (struct line *) 14817 malloc (sizeof (struct line) + this_length); 14818 thisline->length = this_length; 14819 14820 In ISO C90, you would have to give `contents' a length of 1, which 14821means either you waste space or complicate the argument to `malloc'. 14822 14823 In ISO C99, you would use a "flexible array member", which is slightly 14824different in syntax and semantics: 14825 14826 * Flexible array members are written as `contents[]' without the `0'. 14827 14828 * Flexible array members have incomplete type, and so the `sizeof' 14829 operator may not be applied. As a quirk of the original 14830 implementation of zero-length arrays, `sizeof' evaluates to zero. 14831 14832 * Flexible array members may only appear as the last member of a 14833 `struct' that is otherwise non-empty. 14834 14835 * A structure containing a flexible array member, or a union 14836 containing such a structure (possibly recursively), may not be a 14837 member of a structure or an element of an array. (However, these 14838 uses are permitted by GCC as extensions.) 14839 14840 GCC versions before 3.0 allowed zero-length arrays to be statically 14841initialized, as if they were flexible arrays. In addition to those 14842cases that were useful, it also allowed initializations in situations 14843that would corrupt later data. Non-empty initialization of zero-length 14844arrays is now treated like any case where there are more initializer 14845elements than the array holds, in that a suitable warning about "excess 14846elements in array" is given, and the excess elements (all of them, in 14847this case) are ignored. 14848 14849 Instead GCC allows static initialization of flexible array members. 14850This is equivalent to defining a new structure containing the original 14851structure followed by an array of sufficient size to contain the data. 14852I.e. in the following, `f1' is constructed as if it were declared like 14853`f2'. 14854 14855 struct f1 { 14856 int x; int y[]; 14857 } f1 = { 1, { 2, 3, 4 } }; 14858 14859 struct f2 { 14860 struct f1 f1; int data[3]; 14861 } f2 = { { 1 }, { 2, 3, 4 } }; 14862 14863The convenience of this extension is that `f1' has the desired type, 14864eliminating the need to consistently refer to `f2.f1'. 14865 14866 This has symmetry with normal static arrays, in that an array of 14867unknown size is also written with `[]'. 14868 14869 Of course, this extension only makes sense if the extra data comes at 14870the end of a top-level object, as otherwise we would be overwriting 14871data at subsequent offsets. To avoid undue complication and confusion 14872with initialization of deeply nested arrays, we simply disallow any 14873non-empty initialization except when the structure is the top-level 14874object. For example: 14875 14876 struct foo { int x; int y[]; }; 14877 struct bar { struct foo z; }; 14878 14879 struct foo a = { 1, { 2, 3, 4 } }; // Valid. 14880 struct bar b = { { 1, { 2, 3, 4 } } }; // Invalid. 14881 struct bar c = { { 1, { } } }; // Valid. 14882 struct foo d[1] = { { 1 { 2, 3, 4 } } }; // Invalid. 14883 14884 14885File: gcc.info, Node: Empty Structures, Next: Variadic Macros, Prev: Variable Length, Up: C Extensions 14886 148875.13 Structures With No Members 14888=============================== 14889 14890GCC permits a C structure to have no members: 14891 14892 struct empty { 14893 }; 14894 14895 The structure will have size zero. In C++, empty structures are part 14896of the language. G++ treats empty structures as if they had a single 14897member of type `char'. 14898 14899 14900File: gcc.info, Node: Variable Length, Next: Empty Structures, Prev: Zero Length, Up: C Extensions 14901 149025.14 Arrays of Variable Length 14903============================== 14904 14905Variable-length automatic arrays are allowed in ISO C99, and as an 14906extension GCC accepts them in C89 mode and in C++. (However, GCC's 14907implementation of variable-length arrays does not yet conform in detail 14908to the ISO C99 standard.) These arrays are declared like any other 14909automatic arrays, but with a length that is not a constant expression. 14910The storage is allocated at the point of declaration and deallocated 14911when the brace-level is exited. For example: 14912 14913 FILE * 14914 concat_fopen (char *s1, char *s2, char *mode) 14915 { 14916 char str[strlen (s1) + strlen (s2) + 1]; 14917 strcpy (str, s1); 14918 strcat (str, s2); 14919 return fopen (str, mode); 14920 } 14921 14922 Jumping or breaking out of the scope of the array name deallocates the 14923storage. Jumping into the scope is not allowed; you get an error 14924message for it. 14925 14926 You can use the function `alloca' to get an effect much like 14927variable-length arrays. The function `alloca' is available in many 14928other C implementations (but not in all). On the other hand, 14929variable-length arrays are more elegant. 14930 14931 There are other differences between these two methods. Space allocated 14932with `alloca' exists until the containing _function_ returns. The 14933space for a variable-length array is deallocated as soon as the array 14934name's scope ends. (If you use both variable-length arrays and 14935`alloca' in the same function, deallocation of a variable-length array 14936will also deallocate anything more recently allocated with `alloca'.) 14937 14938 You can also use variable-length arrays as arguments to functions: 14939 14940 struct entry 14941 tester (int len, char data[len][len]) 14942 { 14943 /* ... */ 14944 } 14945 14946 The length of an array is computed once when the storage is allocated 14947and is remembered for the scope of the array in case you access it with 14948`sizeof'. 14949 14950 If you want to pass the array first and the length afterward, you can 14951use a forward declaration in the parameter list--another GNU extension. 14952 14953 struct entry 14954 tester (int len; char data[len][len], int len) 14955 { 14956 /* ... */ 14957 } 14958 14959 The `int len' before the semicolon is a "parameter forward 14960declaration", and it serves the purpose of making the name `len' known 14961when the declaration of `data' is parsed. 14962 14963 You can write any number of such parameter forward declarations in the 14964parameter list. They can be separated by commas or semicolons, but the 14965last one must end with a semicolon, which is followed by the "real" 14966parameter declarations. Each forward declaration must match a "real" 14967declaration in parameter name and data type. ISO C99 does not support 14968parameter forward declarations. 14969 14970 14971File: gcc.info, Node: Variadic Macros, Next: Escaped Newlines, Prev: Empty Structures, Up: C Extensions 14972 149735.15 Macros with a Variable Number of Arguments. 14974================================================ 14975 14976In the ISO C standard of 1999, a macro can be declared to accept a 14977variable number of arguments much as a function can. The syntax for 14978defining the macro is similar to that of a function. Here is an 14979example: 14980 14981 #define debug(format, ...) fprintf (stderr, format, __VA_ARGS__) 14982 14983 Here `...' is a "variable argument". In the invocation of such a 14984macro, it represents the zero or more tokens until the closing 14985parenthesis that ends the invocation, including any commas. This set of 14986tokens replaces the identifier `__VA_ARGS__' in the macro body wherever 14987it appears. See the CPP manual for more information. 14988 14989 GCC has long supported variadic macros, and used a different syntax 14990that allowed you to give a name to the variable arguments just like any 14991other argument. Here is an example: 14992 14993 #define debug(format, args...) fprintf (stderr, format, args) 14994 14995 This is in all ways equivalent to the ISO C example above, but arguably 14996more readable and descriptive. 14997 14998 GNU CPP has two further variadic macro extensions, and permits them to 14999be used with either of the above forms of macro definition. 15000 15001 In standard C, you are not allowed to leave the variable argument out 15002entirely; but you are allowed to pass an empty argument. For example, 15003this invocation is invalid in ISO C, because there is no comma after 15004the string: 15005 15006 debug ("A message") 15007 15008 GNU CPP permits you to completely omit the variable arguments in this 15009way. In the above examples, the compiler would complain, though since 15010the expansion of the macro still has the extra comma after the format 15011string. 15012 15013 To help solve this problem, CPP behaves specially for variable 15014arguments used with the token paste operator, `##'. If instead you 15015write 15016 15017 #define debug(format, ...) fprintf (stderr, format, ## __VA_ARGS__) 15018 15019 and if the variable arguments are omitted or empty, the `##' operator 15020causes the preprocessor to remove the comma before it. If you do 15021provide some variable arguments in your macro invocation, GNU CPP does 15022not complain about the paste operation and instead places the variable 15023arguments after the comma. Just like any other pasted macro argument, 15024these arguments are not macro expanded. 15025 15026 15027File: gcc.info, Node: Escaped Newlines, Next: Subscripting, Prev: Variadic Macros, Up: C Extensions 15028 150295.16 Slightly Looser Rules for Escaped Newlines 15030=============================================== 15031 15032Recently, the preprocessor has relaxed its treatment of escaped 15033newlines. Previously, the newline had to immediately follow a 15034backslash. The current implementation allows whitespace in the form of 15035spaces, horizontal and vertical tabs, and form feeds between the 15036backslash and the subsequent newline. The preprocessor issues a 15037warning, but treats it as a valid escaped newline and combines the two 15038lines to form a single logical line. This works within comments and 15039tokens, as well as between tokens. Comments are _not_ treated as 15040whitespace for the purposes of this relaxation, since they have not yet 15041been replaced with spaces. 15042 15043 15044File: gcc.info, Node: Subscripting, Next: Pointer Arith, Prev: Escaped Newlines, Up: C Extensions 15045 150465.17 Non-Lvalue Arrays May Have Subscripts 15047========================================== 15048 15049In ISO C99, arrays that are not lvalues still decay to pointers, and 15050may be subscripted, although they may not be modified or used after the 15051next sequence point and the unary `&' operator may not be applied to 15052them. As an extension, GCC allows such arrays to be subscripted in C89 15053mode, though otherwise they do not decay to pointers outside C99 mode. 15054For example, this is valid in GNU C though not valid in C89: 15055 15056 struct foo {int a[4];}; 15057 15058 struct foo f(); 15059 15060 bar (int index) 15061 { 15062 return f().a[index]; 15063 } 15064 15065 15066File: gcc.info, Node: Pointer Arith, Next: Initializers, Prev: Subscripting, Up: C Extensions 15067 150685.18 Arithmetic on `void'- and Function-Pointers 15069================================================ 15070 15071In GNU C, addition and subtraction operations are supported on pointers 15072to `void' and on pointers to functions. This is done by treating the 15073size of a `void' or of a function as 1. 15074 15075 A consequence of this is that `sizeof' is also allowed on `void' and 15076on function types, and returns 1. 15077 15078 The option `-Wpointer-arith' requests a warning if these extensions 15079are used. 15080 15081 15082File: gcc.info, Node: Initializers, Next: Compound Literals, Prev: Pointer Arith, Up: C Extensions 15083 150845.19 Non-Constant Initializers 15085============================== 15086 15087As in standard C++ and ISO C99, the elements of an aggregate 15088initializer for an automatic variable are not required to be constant 15089expressions in GNU C. Here is an example of an initializer with 15090run-time varying elements: 15091 15092 foo (float f, float g) 15093 { 15094 float beat_freqs[2] = { f-g, f+g }; 15095 /* ... */ 15096 } 15097 15098 15099File: gcc.info, Node: Compound Literals, Next: Designated Inits, Prev: Initializers, Up: C Extensions 15100 151015.20 Compound Literals 15102====================== 15103 15104ISO C99 supports compound literals. A compound literal looks like a 15105cast containing an initializer. Its value is an object of the type 15106specified in the cast, containing the elements specified in the 15107initializer; it is an lvalue. As an extension, GCC supports compound 15108literals in C89 mode and in C++. 15109 15110 Usually, the specified type is a structure. Assume that `struct foo' 15111and `structure' are declared as shown: 15112 15113 struct foo {int a; char b[2];} structure; 15114 15115Here is an example of constructing a `struct foo' with a compound 15116literal: 15117 15118 structure = ((struct foo) {x + y, 'a', 0}); 15119 15120This is equivalent to writing the following: 15121 15122 { 15123 struct foo temp = {x + y, 'a', 0}; 15124 structure = temp; 15125 } 15126 15127 You can also construct an array. If all the elements of the compound 15128literal are (made up of) simple constant expressions, suitable for use 15129in initializers of objects of static storage duration, then the compound 15130literal can be coerced to a pointer to its first element and used in 15131such an initializer, as shown here: 15132 15133 char **foo = (char *[]) { "x", "y", "z" }; 15134 15135 Compound literals for scalar types and union types are is also 15136allowed, but then the compound literal is equivalent to a cast. 15137 15138 As a GNU extension, GCC allows initialization of objects with static 15139storage duration by compound literals (which is not possible in ISO 15140C99, because the initializer is not a constant). It is handled as if 15141the object was initialized only with the bracket enclosed list if the 15142types of the compound literal and the object match. The initializer 15143list of the compound literal must be constant. If the object being 15144initialized has array type of unknown size, the size is determined by 15145compound literal size. 15146 15147 static struct foo x = (struct foo) {1, 'a', 'b'}; 15148 static int y[] = (int []) {1, 2, 3}; 15149 static int z[] = (int [3]) {1}; 15150 15151The above lines are equivalent to the following: 15152 static struct foo x = {1, 'a', 'b'}; 15153 static int y[] = {1, 2, 3}; 15154 static int z[] = {1, 0, 0}; 15155 15156 15157File: gcc.info, Node: Designated Inits, Next: Cast to Union, Prev: Compound Literals, Up: C Extensions 15158 151595.21 Designated Initializers 15160============================ 15161 15162Standard C89 requires the elements of an initializer to appear in a 15163fixed order, the same as the order of the elements in the array or 15164structure being initialized. 15165 15166 In ISO C99 you can give the elements in any order, specifying the array 15167indices or structure field names they apply to, and GNU C allows this as 15168an extension in C89 mode as well. This extension is not implemented in 15169GNU C++. 15170 15171 To specify an array index, write `[INDEX] =' before the element value. 15172For example, 15173 15174 int a[6] = { [4] = 29, [2] = 15 }; 15175 15176is equivalent to 15177 15178 int a[6] = { 0, 0, 15, 0, 29, 0 }; 15179 15180The index values must be constant expressions, even if the array being 15181initialized is automatic. 15182 15183 An alternative syntax for this which has been obsolete since GCC 2.5 15184but GCC still accepts is to write `[INDEX]' before the element value, 15185with no `='. 15186 15187 To initialize a range of elements to the same value, write `[FIRST ... 15188LAST] = VALUE'. This is a GNU extension. For example, 15189 15190 int widths[] = { [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 }; 15191 15192If the value in it has side-effects, the side-effects will happen only 15193once, not for each initialized field by the range initializer. 15194 15195Note that the length of the array is the highest value specified plus 15196one. 15197 15198 In a structure initializer, specify the name of a field to initialize 15199with `.FIELDNAME =' before the element value. For example, given the 15200following structure, 15201 15202 struct point { int x, y; }; 15203 15204the following initialization 15205 15206 struct point p = { .y = yvalue, .x = xvalue }; 15207 15208is equivalent to 15209 15210 struct point p = { xvalue, yvalue }; 15211 15212 Another syntax which has the same meaning, obsolete since GCC 2.5, is 15213`FIELDNAME:', as shown here: 15214 15215 struct point p = { y: yvalue, x: xvalue }; 15216 15217 The `[INDEX]' or `.FIELDNAME' is known as a "designator". You can 15218also use a designator (or the obsolete colon syntax) when initializing 15219a union, to specify which element of the union should be used. For 15220example, 15221 15222 union foo { int i; double d; }; 15223 15224 union foo f = { .d = 4 }; 15225 15226will convert 4 to a `double' to store it in the union using the second 15227element. By contrast, casting 4 to type `union foo' would store it 15228into the union as the integer `i', since it is an integer. (*Note Cast 15229to Union::.) 15230 15231 You can combine this technique of naming elements with ordinary C 15232initialization of successive elements. Each initializer element that 15233does not have a designator applies to the next consecutive element of 15234the array or structure. For example, 15235 15236 int a[6] = { [1] = v1, v2, [4] = v4 }; 15237 15238is equivalent to 15239 15240 int a[6] = { 0, v1, v2, 0, v4, 0 }; 15241 15242 Labeling the elements of an array initializer is especially useful 15243when the indices are characters or belong to an `enum' type. For 15244example: 15245 15246 int whitespace[256] 15247 = { [' '] = 1, ['\t'] = 1, ['\h'] = 1, 15248 ['\f'] = 1, ['\n'] = 1, ['\r'] = 1 }; 15249 15250 You can also write a series of `.FIELDNAME' and `[INDEX]' designators 15251before an `=' to specify a nested subobject to initialize; the list is 15252taken relative to the subobject corresponding to the closest 15253surrounding brace pair. For example, with the `struct point' 15254declaration above: 15255 15256 struct point ptarray[10] = { [2].y = yv2, [2].x = xv2, [0].x = xv0 }; 15257 15258If the same field is initialized multiple times, it will have value from 15259the last initialization. If any such overridden initialization has 15260side-effect, it is unspecified whether the side-effect happens or not. 15261Currently, GCC will discard them and issue a warning. 15262 15263 15264File: gcc.info, Node: Case Ranges, Next: Mixed Declarations, Prev: Cast to Union, Up: C Extensions 15265 152665.22 Case Ranges 15267================ 15268 15269You can specify a range of consecutive values in a single `case' label, 15270like this: 15271 15272 case LOW ... HIGH: 15273 15274This has the same effect as the proper number of individual `case' 15275labels, one for each integer value from LOW to HIGH, inclusive. 15276 15277 This feature is especially useful for ranges of ASCII character codes: 15278 15279 case 'A' ... 'Z': 15280 15281 *Be careful:* Write spaces around the `...', for otherwise it may be 15282parsed wrong when you use it with integer values. For example, write 15283this: 15284 15285 case 1 ... 5: 15286 15287rather than this: 15288 15289 case 1...5: 15290 15291 15292File: gcc.info, Node: Cast to Union, Next: Case Ranges, Prev: Designated Inits, Up: C Extensions 15293 152945.23 Cast to a Union Type 15295========================= 15296 15297A cast to union type is similar to other casts, except that the type 15298specified is a union type. You can specify the type either with `union 15299TAG' or with a typedef name. A cast to union is actually a constructor 15300though, not a cast, and hence does not yield an lvalue like normal 15301casts. (*Note Compound Literals::.) 15302 15303 The types that may be cast to the union type are those of the members 15304of the union. Thus, given the following union and variables: 15305 15306 union foo { int i; double d; }; 15307 int x; 15308 double y; 15309 15310both `x' and `y' can be cast to type `union foo'. 15311 15312 Using the cast as the right-hand side of an assignment to a variable of 15313union type is equivalent to storing in a member of the union: 15314 15315 union foo u; 15316 /* ... */ 15317 u = (union foo) x == u.i = x 15318 u = (union foo) y == u.d = y 15319 15320 You can also use the union cast as a function argument: 15321 15322 void hack (union foo); 15323 /* ... */ 15324 hack ((union foo) x); 15325 15326 15327File: gcc.info, Node: Mixed Declarations, Next: Function Attributes, Prev: Case Ranges, Up: C Extensions 15328 153295.24 Mixed Declarations and Code 15330================================ 15331 15332ISO C99 and ISO C++ allow declarations and code to be freely mixed 15333within compound statements. As an extension, GCC also allows this in 15334C89 mode. For example, you could do: 15335 15336 int i; 15337 /* ... */ 15338 i++; 15339 int j = i + 2; 15340 15341 Each identifier is visible from where it is declared until the end of 15342the enclosing block. 15343 15344 15345File: gcc.info, Node: Function Attributes, Next: Attribute Syntax, Prev: Mixed Declarations, Up: C Extensions 15346 153475.25 Declaring Attributes of Functions 15348====================================== 15349 15350In GNU C, you declare certain things about functions called in your 15351program which help the compiler optimize function calls and check your 15352code more carefully. 15353 15354 The keyword `__attribute__' allows you to specify special attributes 15355when making a declaration. This keyword is followed by an attribute 15356specification inside double parentheses. The following attributes are 15357currently defined for functions on all targets: `noreturn', 15358`returns_twice', `noinline', `always_inline', `flatten', `pure', 15359`const', `nothrow', `sentinel', `format', `format_arg', `bounded', 15360`no_instrument_function', `section', `constructor', `destructor', 15361`used', `unused', `deprecated', `weak', `malloc', `alias', 15362`warn_unused_result', `nonnull', `gnu_inline' and `externally_visible'. 15363Several other attributes are defined for functions on particular 15364target systems. Other attributes, including `section' are supported 15365for variables declarations (*note Variable Attributes::) and for types 15366(*note Type Attributes::). 15367 15368 You may also specify attributes with `__' preceding and following each 15369keyword. This allows you to use them in header files without being 15370concerned about a possible macro of the same name. For example, you 15371may use `__noreturn__' instead of `noreturn'. 15372 15373 *Note Attribute Syntax::, for details of the exact syntax for using 15374attributes. 15375 15376`alias ("TARGET")' 15377 The `alias' attribute causes the declaration to be emitted as an 15378 alias for another symbol, which must be specified. For instance, 15379 15380 void __f () { /* Do something. */; } 15381 void f () __attribute__ ((weak, alias ("__f"))); 15382 15383 defines `f' to be a weak alias for `__f'. In C++, the mangled 15384 name for the target must be used. It is an error if `__f' is not 15385 defined in the same translation unit. 15386 15387 Not all target machines support this attribute. 15388 15389`always_inline' 15390 Generally, functions are not inlined unless optimization is 15391 specified. For functions declared inline, this attribute inlines 15392 the function even if no optimization level was specified. 15393 15394`gnu_inline' 15395 This attribute should be used with a function which is also 15396 declared with the `inline' keyword. It directs GCC to treat the 15397 function as if it were defined in gnu89 mode even when compiling 15398 in C99 or gnu99 mode. 15399 15400 If the function is declared `extern', then this definition of the 15401 function is used only for inlining. In no case is the function 15402 compiled as a standalone function, not even if you take its address 15403 explicitly. Such an address becomes an external reference, as if 15404 you had only declared the function, and had not defined it. This 15405 has almost the effect of a macro. The way to use this is to put a 15406 function definition in a header file with this attribute, and put 15407 another copy of the function, without `extern', in a library file. 15408 The definition in the header file will cause most calls to the 15409 function to be inlined. If any uses of the function remain, they 15410 will refer to the single copy in the library. Note that the two 15411 definitions of the functions need not be precisely the same, 15412 although if they do not have the same effect your program may 15413 behave oddly. 15414 15415 If the function is neither `extern' nor `static', then the 15416 function is compiled as a standalone function, as well as being 15417 inlined where possible. 15418 15419 This is how GCC traditionally handled functions declared `inline'. 15420 Since ISO C99 specifies a different semantics for `inline', this 15421 function attribute is provided as a transition measure and as a 15422 useful feature in its own right. This attribute is available in 15423 GCC 4.1.3 and later. It is available if either of the 15424 preprocessor macros `__GNUC_GNU_INLINE__' or 15425 `__GNUC_STDC_INLINE__' are defined. *Note An Inline Function is 15426 As Fast As a Macro: Inline. 15427 15428 Note that since the first version of GCC to support C99 inline 15429 semantics is 4.3, earlier versions of GCC which accept this 15430 attribute effectively assume that it is always present, whether or 15431 not it is given explicitly. In versions prior to 4.3, the only 15432 effect of explicitly including it is to disable warnings about 15433 using inline functions in C99 mode. 15434 15435`flatten' 15436 Generally, inlining into a function is limited. For a function 15437 marked with this attribute, every call inside this function will 15438 be inlined, if possible. Whether the function itself is 15439 considered for inlining depends on its size and the current 15440 inlining parameters. The `flatten' attribute only works reliably 15441 in unit-at-a-time mode. 15442 15443`bounded' 15444 This attribute is used to type-check functions whose parameters 15445 pass fixed-length buffer and their sizes. The syntax for normal 15446 buffers is: 15447 15448 __attribute__ ((__bounded__ ( __buffer__, buffer, length ))) 15449 15450 where buffer contains the parameter number (starting from 1) of the 15451 pointer to the buffer, and length contains the parameter number of the 15452 buffer length argument. 15453 15454 gcc will emit a warning if the length argument is a constant larger than 15455 the actual size of the buffer. If the buffer is not a statically 15456 declared array of fixed length, no warnings will be generated. Refer to 15457 memcpy(3) for an example of a function with this check. 15458 15459 For checking strings, just use __string__ instead of __buffer__: 15460 15461 __attribute__ ((__bounded__ ( __string__, buffer, length ))) 15462 15463 In addition to the checks described above, this also tests if the length 15464 argument was wrongly derived from a sizeof(void *) operation. strlcpy(3) 15465 is a good example of a string function with this check. 15466 15467 If a function needs string checking like __string__ but operates on 15468 element counts rather than buffer sizes, use __wcstring__: 15469 15470 __attribute__ ((__bounded__ ( __wcstring__, buffer, count ))) 15471 15472 An example of a string function with this check is wcslcpy(3). 15473 15474 Some functions specify the length as two arguments: the number of 15475 elements and the size of each element. In this case, use the __size__ 15476 attribute: 15477 15478 __attribute__ ((__bounded__ ( __size__, buffer, nmemb, size ))) 15479 15480 where buffer contains the parameter number of the pointer to the buffer, 15481 nmemb contains the parameter number of the number of members, and size 15482 has the parameter number of the size of each element. The type checks 15483 performed by __size__ are the same as the __buffer__ attribute. See 15484 fread(3) for an example of this type of function. 15485 15486 If a function accepts a buffer parameter and specifies that it has to be 15487 of a minimum length, the __minbytes__ attribute can be used: 15488 15489 __attribute__ ((__bounded__ ( __minbytes__, buffer, minsize ))) 15490 15491 where buffer contains the parameter number of the pointer to the buffer, 15492 and minsize specifies the minimum number of bytes that the buffer should 15493 be. ctime_r(3) is an example of this type of function. 15494 15495 If -Wbounded is specified with -Wformat, additional checks are performed 15496 on sscanf(3) format strings. The `%s' fields are checked for incorrect 15497 bound lengths by checking the size of the buffer associated with the 15498 format argument. 15499 15500`cdecl' 15501 On the Intel 386, the `cdecl' attribute causes the compiler to 15502 assume that the calling function will pop off the stack space used 15503 to pass arguments. This is useful to override the effects of the 15504 `-mrtd' switch. 15505 15506`const' 15507 Many functions do not examine any values except their arguments, 15508 and have no effects except the return value. Basically this is 15509 just slightly more strict class than the `pure' attribute below, 15510 since function is not allowed to read global memory. 15511 15512 Note that a function that has pointer arguments and examines the 15513 data pointed to must _not_ be declared `const'. Likewise, a 15514 function that calls a non-`const' function usually must not be 15515 `const'. It does not make sense for a `const' function to return 15516 `void'. 15517 15518 The attribute `const' is not implemented in GCC versions earlier 15519 than 2.5. An alternative way to declare that a function has no 15520 side effects, which works in the current version and in some older 15521 versions, is as follows: 15522 15523 typedef int intfn (); 15524 15525 extern const intfn square; 15526 15527 This approach does not work in GNU C++ from 2.6.0 on, since the 15528 language specifies that the `const' must be attached to the return 15529 value. 15530 15531`constructor' 15532`destructor' 15533 The `constructor' attribute causes the function to be called 15534 automatically before execution enters `main ()'. Similarly, the 15535 `destructor' attribute causes the function to be called 15536 automatically after `main ()' has completed or `exit ()' has been 15537 called. Functions with these attributes are useful for 15538 initializing data that will be used implicitly during the 15539 execution of the program. 15540 15541 These attributes are not currently implemented for Objective-C. 15542 15543`deprecated' 15544 The `deprecated' attribute results in a warning if the function is 15545 used anywhere in the source file. This is useful when identifying 15546 functions that are expected to be removed in a future version of a 15547 program. The warning also includes the location of the declaration 15548 of the deprecated function, to enable users to easily find further 15549 information about why the function is deprecated, or what they 15550 should do instead. Note that the warnings only occurs for uses: 15551 15552 int old_fn () __attribute__ ((deprecated)); 15553 int old_fn (); 15554 int (*fn_ptr)() = old_fn; 15555 15556 results in a warning on line 3 but not line 2. 15557 15558 The `deprecated' attribute can also be used for variables and 15559 types (*note Variable Attributes::, *note Type Attributes::.) 15560 15561`dllexport' 15562 On Microsoft Windows targets and Symbian OS targets the 15563 `dllexport' attribute causes the compiler to provide a global 15564 pointer to a pointer in a DLL, so that it can be referenced with 15565 the `dllimport' attribute. On Microsoft Windows targets, the 15566 pointer name is formed by combining `_imp__' and the function or 15567 variable name. 15568 15569 You can use `__declspec(dllexport)' as a synonym for 15570 `__attribute__ ((dllexport))' for compatibility with other 15571 compilers. 15572 15573 On systems that support the `visibility' attribute, this attribute 15574 also implies "default" visibility, unless a `visibility' attribute 15575 is explicitly specified. You should avoid the use of `dllexport' 15576 with "hidden" or "internal" visibility; in the future GCC may 15577 issue an error for those cases. 15578 15579 Currently, the `dllexport' attribute is ignored for inlined 15580 functions, unless the `-fkeep-inline-functions' flag has been 15581 used. The attribute is also ignored for undefined symbols. 15582 15583 When applied to C++ classes, the attribute marks defined 15584 non-inlined member functions and static data members as exports. 15585 Static consts initialized in-class are not marked unless they are 15586 also defined out-of-class. 15587 15588 For Microsoft Windows targets there are alternative methods for 15589 including the symbol in the DLL's export table such as using a 15590 `.def' file with an `EXPORTS' section or, with GNU ld, using the 15591 `--export-all' linker flag. 15592 15593`dllimport' 15594 On Microsoft Windows and Symbian OS targets, the `dllimport' 15595 attribute causes the compiler to reference a function or variable 15596 via a global pointer to a pointer that is set up by the DLL 15597 exporting the symbol. The attribute implies `extern' storage. On 15598 Microsoft Windows targets, the pointer name is formed by combining 15599 `_imp__' and the function or variable name. 15600 15601 You can use `__declspec(dllimport)' as a synonym for 15602 `__attribute__ ((dllimport))' for compatibility with other 15603 compilers. 15604 15605 Currently, the attribute is ignored for inlined functions. If the 15606 attribute is applied to a symbol _definition_, an error is 15607 reported. If a symbol previously declared `dllimport' is later 15608 defined, the attribute is ignored in subsequent references, and a 15609 warning is emitted. The attribute is also overridden by a 15610 subsequent declaration as `dllexport'. 15611 15612 When applied to C++ classes, the attribute marks non-inlined 15613 member functions and static data members as imports. However, the 15614 attribute is ignored for virtual methods to allow creation of 15615 vtables using thunks. 15616 15617 On the SH Symbian OS target the `dllimport' attribute also has 15618 another affect--it can cause the vtable and run-time type 15619 information for a class to be exported. This happens when the 15620 class has a dllimport'ed constructor or a non-inline, non-pure 15621 virtual function and, for either of those two conditions, the 15622 class also has a inline constructor or destructor and has a key 15623 function that is defined in the current translation unit. 15624 15625 For Microsoft Windows based targets the use of the `dllimport' 15626 attribute on functions is not necessary, but provides a small 15627 performance benefit by eliminating a thunk in the DLL. The use of 15628 the `dllimport' attribute on imported variables was required on 15629 older versions of the GNU linker, but can now be avoided by 15630 passing the `--enable-auto-import' switch to the GNU linker. As 15631 with functions, using the attribute for a variable eliminates a 15632 thunk in the DLL. 15633 15634 One drawback to using this attribute is that a pointer to a 15635 function or variable marked as `dllimport' cannot be used as a 15636 constant address. On Microsoft Windows targets, the attribute can 15637 be disabled for functions by setting the `-mnop-fun-dllimport' 15638 flag. 15639 15640`eightbit_data' 15641 Use this attribute on the H8/300, H8/300H, and H8S to indicate 15642 that the specified variable should be placed into the eight bit 15643 data section. The compiler will generate more efficient code for 15644 certain operations on data in the eight bit data area. Note the 15645 eight bit data area is limited to 256 bytes of data. 15646 15647 You must use GAS and GLD from GNU binutils version 2.7 or later for 15648 this attribute to work correctly. 15649 15650`exception_handler' 15651 Use this attribute on the Blackfin to indicate that the specified 15652 function is an exception handler. The compiler will generate 15653 function entry and exit sequences suitable for use in an exception 15654 handler when this attribute is present. 15655 15656`far' 15657 On 68HC11 and 68HC12 the `far' attribute causes the compiler to 15658 use a calling convention that takes care of switching memory banks 15659 when entering and leaving a function. This calling convention is 15660 also the default when using the `-mlong-calls' option. 15661 15662 On 68HC12 the compiler will use the `call' and `rtc' instructions 15663 to call and return from a function. 15664 15665 On 68HC11 the compiler will generate a sequence of instructions to 15666 invoke a board-specific routine to switch the memory bank and call 15667 the real function. The board-specific routine simulates a `call'. 15668 At the end of a function, it will jump to a board-specific routine 15669 instead of using `rts'. The board-specific return routine 15670 simulates the `rtc'. 15671 15672`fastcall' 15673 On the Intel 386, the `fastcall' attribute causes the compiler to 15674 pass the first argument (if of integral type) in the register ECX 15675 and the second argument (if of integral type) in the register EDX. 15676 Subsequent and other typed arguments are passed on the stack. 15677 The called function will pop the arguments off the stack. If the 15678 number of arguments is variable all arguments are pushed on the 15679 stack. 15680 15681`format (ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)' 15682 The `format' attribute specifies that a function takes `printf', 15683 `scanf', `strftime' or `strfmon' style arguments which should be 15684 type-checked against a format string. For example, the 15685 declaration: 15686 15687 extern int 15688 my_printf (void *my_object, const char *my_format, ...) 15689 __attribute__ ((format (printf, 2, 3))); 15690 15691 causes the compiler to check the arguments in calls to `my_printf' 15692 for consistency with the `printf' style format string argument 15693 `my_format'. 15694 15695 The parameter ARCHETYPE determines how the format string is 15696 interpreted, and should be `printf', `scanf', `strftime' or 15697 `strfmon'. (You can also use `__printf__', `__scanf__', 15698 `__strftime__' or `__strfmon__'.) The parameter STRING-INDEX 15699 specifies which argument is the format string argument (starting 15700 from 1), while FIRST-TO-CHECK is the number of the first argument 15701 to check against the format string. For functions where the 15702 arguments are not available to be checked (such as `vprintf'), 15703 specify the third parameter as zero. In this case the compiler 15704 only checks the format string for consistency. For `strftime' 15705 formats, the third parameter is required to be zero. Since 15706 non-static C++ methods have an implicit `this' argument, the 15707 arguments of such methods should be counted from two, not one, when 15708 giving values for STRING-INDEX and FIRST-TO-CHECK. 15709 15710 In the example above, the format string (`my_format') is the second 15711 argument of the function `my_print', and the arguments to check 15712 start with the third argument, so the correct parameters for the 15713 format attribute are 2 and 3. 15714 15715 The `format' attribute allows you to identify your own functions 15716 which take format strings as arguments, so that GCC can check the 15717 calls to these functions for errors. The compiler always (unless 15718 `-ffreestanding' or `-fno-builtin' is used) checks formats for the 15719 standard library functions `printf', `fprintf', `sprintf', 15720 `scanf', `fscanf', `sscanf', `strftime', `vprintf', `vfprintf' and 15721 `vsprintf' whenever such warnings are requested (using 15722 `-Wformat'), so there is no need to modify the header file 15723 `stdio.h'. In C99 mode, the functions `snprintf', `vsnprintf', 15724 `vscanf', `vfscanf' and `vsscanf' are also checked. Except in 15725 strictly conforming C standard modes, the X/Open function 15726 `strfmon' is also checked as are `printf_unlocked' and 15727 `fprintf_unlocked'. *Note Options Controlling C Dialect: C 15728 Dialect Options. 15729 15730 The target may provide additional types of format checks. *Note 15731 Format Checks Specific to Particular Target Machines: Target 15732 Format Checks. 15733 15734`format_arg (STRING-INDEX)' 15735 The `format_arg' attribute specifies that a function takes a format 15736 string for a `printf', `scanf', `strftime' or `strfmon' style 15737 function and modifies it (for example, to translate it into 15738 another language), so the result can be passed to a `printf', 15739 `scanf', `strftime' or `strfmon' style function (with the 15740 remaining arguments to the format function the same as they would 15741 have been for the unmodified string). For example, the 15742 declaration: 15743 15744 extern char * 15745 my_dgettext (char *my_domain, const char *my_format) 15746 __attribute__ ((format_arg (2))); 15747 15748 causes the compiler to check the arguments in calls to a `printf', 15749 `scanf', `strftime' or `strfmon' type function, whose format 15750 string argument is a call to the `my_dgettext' function, for 15751 consistency with the format string argument `my_format'. If the 15752 `format_arg' attribute had not been specified, all the compiler 15753 could tell in such calls to format functions would be that the 15754 format string argument is not constant; this would generate a 15755 warning when `-Wformat-nonliteral' is used, but the calls could 15756 not be checked without the attribute. 15757 15758 The parameter STRING-INDEX specifies which argument is the format 15759 string argument (starting from one). Since non-static C++ methods 15760 have an implicit `this' argument, the arguments of such methods 15761 should be counted from two. 15762 15763 The `format-arg' attribute allows you to identify your own 15764 functions which modify format strings, so that GCC can check the 15765 calls to `printf', `scanf', `strftime' or `strfmon' type function 15766 whose operands are a call to one of your own function. The 15767 compiler always treats `gettext', `dgettext', and `dcgettext' in 15768 this manner except when strict ISO C support is requested by 15769 `-ansi' or an appropriate `-std' option, or `-ffreestanding' or 15770 `-fno-builtin' is used. *Note Options Controlling C Dialect: C 15771 Dialect Options. 15772 15773`function_vector' 15774 Use this attribute on the H8/300, H8/300H, and H8S to indicate 15775 that the specified function should be called through the function 15776 vector. Calling a function through the function vector will 15777 reduce code size, however; the function vector has a limited size 15778 (maximum 128 entries on the H8/300 and 64 entries on the H8/300H 15779 and H8S) and shares space with the interrupt vector. 15780 15781 You must use GAS and GLD from GNU binutils version 2.7 or later for 15782 this attribute to work correctly. 15783 15784`interrupt' 15785 Use this attribute on the ARM, AVR, C4x, CRX, M32C, M32R/D, MS1, 15786 and Xstormy16 ports to indicate that the specified function is an 15787 interrupt handler. The compiler will generate function entry and 15788 exit sequences suitable for use in an interrupt handler when this 15789 attribute is present. 15790 15791 Note, interrupt handlers for the Blackfin, m68k, H8/300, H8/300H, 15792 H8S, and SH processors can be specified via the 15793 `interrupt_handler' attribute. 15794 15795 Note, on the AVR, interrupts will be enabled inside the function. 15796 15797 Note, for the ARM, you can specify the kind of interrupt to be 15798 handled by adding an optional parameter to the interrupt attribute 15799 like this: 15800 15801 void f () __attribute__ ((interrupt ("IRQ"))); 15802 15803 Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT 15804 and UNDEF. 15805 15806`interrupt_handler' 15807 Use this attribute on the Blackfin, m68k, H8/300, H8/300H, H8S, 15808 and SH to indicate that the specified function is an interrupt 15809 handler. The compiler will generate function entry and exit 15810 sequences suitable for use in an interrupt handler when this 15811 attribute is present. 15812 15813`kspisusp' 15814 When used together with `interrupt_handler', `exception_handler' 15815 or `nmi_handler', code will be generated to load the stack pointer 15816 from the USP register in the function prologue. 15817 15818`long_call/short_call' 15819 This attribute specifies how a particular function is called on 15820 ARM. Both attributes override the `-mlong-calls' (*note ARM 15821 Options::) command line switch and `#pragma long_calls' settings. 15822 The `long_call' attribute indicates that the function might be far 15823 away from the call site and require a different (more expensive) 15824 calling sequence. The `short_call' attribute always places the 15825 offset to the function from the call site into the `BL' 15826 instruction directly. 15827 15828`longcall/shortcall' 15829 On the Blackfin, RS/6000 and PowerPC, the `longcall' attribute 15830 indicates that the function might be far away from the call site 15831 and require a different (more expensive) calling sequence. The 15832 `shortcall' attribute indicates that the function is always close 15833 enough for the shorter calling sequence to be used. These 15834 attributes override both the `-mlongcall' switch and, on the 15835 RS/6000 and PowerPC, the `#pragma longcall' setting. 15836 15837 *Note RS/6000 and PowerPC Options::, for more information on 15838 whether long calls are necessary. 15839 15840`long_call' 15841 This attribute specifies how a particular function is called on 15842 MIPS. The attribute overrides the `-mlong-calls' (*note MIPS 15843 Options::) command line switch. This attribute causes the 15844 compiler to always call the function by first loading its address 15845 into a register, and then using the contents of that register. 15846 15847`malloc' 15848 The `malloc' attribute is used to tell the compiler that a function 15849 may be treated as if any non-`NULL' pointer it returns cannot 15850 alias any other pointer valid when the function returns. This 15851 will often improve optimization. Standard functions with this 15852 property include `malloc' and `calloc'. `realloc'-like functions 15853 have this property as long as the old pointer is never referred to 15854 (including comparing it to the new pointer) after the function 15855 returns a non-`NULL' value. 15856 15857`model (MODEL-NAME)' 15858 On the M32R/D, use this attribute to set the addressability of an 15859 object, and of the code generated for a function. The identifier 15860 MODEL-NAME is one of `small', `medium', or `large', representing 15861 each of the code models. 15862 15863 Small model objects live in the lower 16MB of memory (so that their 15864 addresses can be loaded with the `ld24' instruction), and are 15865 callable with the `bl' instruction. 15866 15867 Medium model objects may live anywhere in the 32-bit address space 15868 (the compiler will generate `seth/add3' instructions to load their 15869 addresses), and are callable with the `bl' instruction. 15870 15871 Large model objects may live anywhere in the 32-bit address space 15872 (the compiler will generate `seth/add3' instructions to load their 15873 addresses), and may not be reachable with the `bl' instruction 15874 (the compiler will generate the much slower `seth/add3/jl' 15875 instruction sequence). 15876 15877 On IA-64, use this attribute to set the addressability of an 15878 object. At present, the only supported identifier for MODEL-NAME 15879 is `small', indicating addressability via "small" (22-bit) 15880 addresses (so that their addresses can be loaded with the `addl' 15881 instruction). Caveat: such addressing is by definition not 15882 position independent and hence this attribute must not be used for 15883 objects defined by shared libraries. 15884 15885`naked' 15886 Use this attribute on the ARM, AVR, C4x and IP2K ports to indicate 15887 that the specified function does not need prologue/epilogue 15888 sequences generated by the compiler. It is up to the programmer 15889 to provide these sequences. 15890 15891`near' 15892 On 68HC11 and 68HC12 the `near' attribute causes the compiler to 15893 use the normal calling convention based on `jsr' and `rts'. This 15894 attribute can be used to cancel the effect of the `-mlong-calls' 15895 option. 15896 15897`nesting' 15898 Use this attribute together with `interrupt_handler', 15899 `exception_handler' or `nmi_handler' to indicate that the function 15900 entry code should enable nested interrupts or exceptions. 15901 15902`nmi_handler' 15903 Use this attribute on the Blackfin to indicate that the specified 15904 function is an NMI handler. The compiler will generate function 15905 entry and exit sequences suitable for use in an NMI handler when 15906 this attribute is present. 15907 15908`no_instrument_function' 15909 If `-finstrument-functions' is given, profiling function calls will 15910 be generated at entry and exit of most user-compiled functions. 15911 Functions with this attribute will not be so instrumented. 15912 15913`noinline' 15914 This function attribute prevents a function from being considered 15915 for inlining. 15916 15917`nonnull (ARG-INDEX, ...)' 15918 The `nonnull' attribute specifies that some function parameters 15919 should be non-null pointers. For instance, the declaration: 15920 15921 extern void * 15922 my_memcpy (void *dest, const void *src, size_t len) 15923 __attribute__((nonnull (1, 2))); 15924 15925 causes the compiler to check that, in calls to `my_memcpy', 15926 arguments DEST and SRC are non-null. If the compiler determines 15927 that a null pointer is passed in an argument slot marked as 15928 non-null, and the `-Wnonnull' option is enabled, a warning is 15929 issued. The compiler may also choose to make optimizations based 15930 on the knowledge that certain function arguments will not be null. 15931 15932 If no argument index list is given to the `nonnull' attribute, all 15933 pointer arguments are marked as non-null. To illustrate, the 15934 following declaration is equivalent to the previous example: 15935 15936 extern void * 15937 my_memcpy (void *dest, const void *src, size_t len) 15938 __attribute__((nonnull)); 15939 15940`noreturn' 15941 A few standard library functions, such as `abort' and `exit', 15942 cannot return. GCC knows this automatically. Some programs define 15943 their own functions that never return. You can declare them 15944 `noreturn' to tell the compiler this fact. For example, 15945 15946 void fatal () __attribute__ ((noreturn)); 15947 15948 void 15949 fatal (/* ... */) 15950 { 15951 /* ... */ /* Print error message. */ /* ... */ 15952 exit (1); 15953 } 15954 15955 The `noreturn' keyword tells the compiler to assume that `fatal' 15956 cannot return. It can then optimize without regard to what would 15957 happen if `fatal' ever did return. This makes slightly better 15958 code. More importantly, it helps avoid spurious warnings of 15959 uninitialized variables. 15960 15961 The `noreturn' keyword does not affect the exceptional path when 15962 that applies: a `noreturn'-marked function may still return to the 15963 caller by throwing an exception or calling `longjmp'. 15964 15965 Do not assume that registers saved by the calling function are 15966 restored before calling the `noreturn' function. 15967 15968 It does not make sense for a `noreturn' function to have a return 15969 type other than `void'. 15970 15971 The attribute `noreturn' is not implemented in GCC versions 15972 earlier than 2.5. An alternative way to declare that a function 15973 does not return, which works in the current version and in some 15974 older versions, is as follows: 15975 15976 typedef void voidfn (); 15977 15978 volatile voidfn fatal; 15979 15980 This approach does not work in GNU C++. 15981 15982`nothrow' 15983 The `nothrow' attribute is used to inform the compiler that a 15984 function cannot throw an exception. For example, most functions in 15985 the standard C library can be guaranteed not to throw an exception 15986 with the notable exceptions of `qsort' and `bsearch' that take 15987 function pointer arguments. The `nothrow' attribute is not 15988 implemented in GCC versions earlier than 3.3. 15989 15990`pure' 15991 Many functions have no effects except the return value and their 15992 return value depends only on the parameters and/or global 15993 variables. Such a function can be subject to common subexpression 15994 elimination and loop optimization just as an arithmetic operator 15995 would be. These functions should be declared with the attribute 15996 `pure'. For example, 15997 15998 int square (int) __attribute__ ((pure)); 15999 16000 says that the hypothetical function `square' is safe to call fewer 16001 times than the program says. 16002 16003 Some of common examples of pure functions are `strlen' or `memcmp'. 16004 Interesting non-pure functions are functions with infinite loops 16005 or those depending on volatile memory or other system resource, 16006 that may change between two consecutive calls (such as `feof' in a 16007 multithreading environment). 16008 16009 The attribute `pure' is not implemented in GCC versions earlier 16010 than 2.96. 16011 16012`regparm (NUMBER)' 16013 On the Intel 386, the `regparm' attribute causes the compiler to 16014 pass arguments number one to NUMBER if they are of integral type 16015 in registers EAX, EDX, and ECX instead of on the stack. Functions 16016 that take a variable number of arguments will continue to be 16017 passed all of their arguments on the stack. 16018 16019 Beware that on some ELF systems this attribute is unsuitable for 16020 global functions in shared libraries with lazy binding (which is 16021 the default). Lazy binding will send the first call via resolving 16022 code in the loader, which might assume EAX, EDX and ECX can be 16023 clobbered, as per the standard calling conventions. Solaris 8 is 16024 affected by this. GNU systems with GLIBC 2.1 or higher, and 16025 FreeBSD, are believed to be safe since the loaders there save all 16026 registers. (Lazy binding can be disabled with the linker or the 16027 loader if desired, to avoid the problem.) 16028 16029`sseregparm' 16030 On the Intel 386 with SSE support, the `sseregparm' attribute 16031 causes the compiler to pass up to 3 floating point arguments in 16032 SSE registers instead of on the stack. Functions that take a 16033 variable number of arguments will continue to pass all of their 16034 floating point arguments on the stack. 16035 16036`force_align_arg_pointer' 16037 On the Intel x86, the `force_align_arg_pointer' attribute may be 16038 applied to individual function definitions, generating an alternate 16039 prologue and epilogue that realigns the runtime stack. This 16040 supports mixing legacy codes that run with a 4-byte aligned stack 16041 with modern codes that keep a 16-byte stack for SSE compatibility. 16042 The alternate prologue and epilogue are slower and bigger than 16043 the regular ones, and the alternate prologue requires a scratch 16044 register; this lowers the number of registers available if used in 16045 conjunction with the `regparm' attribute. The 16046 `force_align_arg_pointer' attribute is incompatible with nested 16047 functions; this is considered a hard error. 16048 16049`returns_twice' 16050 The `returns_twice' attribute tells the compiler that a function 16051 may return more than one time. The compiler will ensure that all 16052 registers are dead before calling such a function and will emit a 16053 warning about the variables that may be clobbered after the second 16054 return from the function. Examples of such functions are `setjmp' 16055 and `vfork'. The `longjmp'-like counterpart of such function, if 16056 any, might need to be marked with the `noreturn' attribute. 16057 16058`saveall' 16059 Use this attribute on the Blackfin, H8/300, H8/300H, and H8S to 16060 indicate that all registers except the stack pointer should be 16061 saved in the prologue regardless of whether they are used or not. 16062 16063`section ("SECTION-NAME")' 16064 Normally, the compiler places the code it generates in the `text' 16065 section. Sometimes, however, you need additional sections, or you 16066 need certain particular functions to appear in special sections. 16067 The `section' attribute specifies that a function lives in a 16068 particular section. For example, the declaration: 16069 16070 extern void foobar (void) __attribute__ ((section ("bar"))); 16071 16072 puts the function `foobar' in the `bar' section. 16073 16074 Some file formats do not support arbitrary sections so the 16075 `section' attribute is not available on all platforms. If you 16076 need to map the entire contents of a module to a particular 16077 section, consider using the facilities of the linker instead. 16078 16079`sentinel' 16080 This function attribute ensures that a parameter in a function 16081 call is an explicit `NULL'. The attribute is only valid on 16082 variadic functions. By default, the sentinel is located at 16083 position zero, the last parameter of the function call. If an 16084 optional integer position argument P is supplied to the attribute, 16085 the sentinel must be located at position P counting backwards from 16086 the end of the argument list. 16087 16088 __attribute__ ((sentinel)) 16089 is equivalent to 16090 __attribute__ ((sentinel(0))) 16091 16092 The attribute is automatically set with a position of 0 for the 16093 built-in functions `execl' and `execlp'. The built-in function 16094 `execle' has the attribute set with a position of 1. 16095 16096 A valid `NULL' in this context is defined as zero with any pointer 16097 type. If your system defines the `NULL' macro with an integer type 16098 then you need to add an explicit cast. GCC replaces `stddef.h' 16099 with a copy that redefines NULL appropriately. 16100 16101 The warnings for missing or incorrect sentinels are enabled with 16102 `-Wformat'. 16103 16104`short_call' 16105 See long_call/short_call. 16106 16107`shortcall' 16108 See longcall/shortcall. 16109 16110`signal' 16111 Use this attribute on the AVR to indicate that the specified 16112 function is a signal handler. The compiler will generate function 16113 entry and exit sequences suitable for use in a signal handler when 16114 this attribute is present. Interrupts will be disabled inside the 16115 function. 16116 16117`sp_switch' 16118 Use this attribute on the SH to indicate an `interrupt_handler' 16119 function should switch to an alternate stack. It expects a string 16120 argument that names a global variable holding the address of the 16121 alternate stack. 16122 16123 void *alt_stack; 16124 void f () __attribute__ ((interrupt_handler, 16125 sp_switch ("alt_stack"))); 16126 16127`stdcall' 16128 On the Intel 386, the `stdcall' attribute causes the compiler to 16129 assume that the called function will pop off the stack space used 16130 to pass arguments, unless it takes a variable number of arguments. 16131 16132`tiny_data' 16133 Use this attribute on the H8/300H and H8S to indicate that the 16134 specified variable should be placed into the tiny data section. 16135 The compiler will generate more efficient code for loads and stores 16136 on data in the tiny data section. Note the tiny data area is 16137 limited to slightly under 32kbytes of data. 16138 16139`trap_exit' 16140 Use this attribute on the SH for an `interrupt_handler' to return 16141 using `trapa' instead of `rte'. This attribute expects an integer 16142 argument specifying the trap number to be used. 16143 16144`unused' 16145 This attribute, attached to a function, means that the function is 16146 meant to be possibly unused. GCC will not produce a warning for 16147 this function. 16148 16149`used' 16150 This attribute, attached to a function, means that code must be 16151 emitted for the function even if it appears that the function is 16152 not referenced. This is useful, for example, when the function is 16153 referenced only in inline assembly. 16154 16155`visibility ("VISIBILITY_TYPE")' 16156 This attribute affects the linkage of the declaration to which it 16157 is attached. There are four supported VISIBILITY_TYPE values: 16158 default, hidden, protected or internal visibility. 16159 16160 void __attribute__ ((visibility ("protected"))) 16161 f () { /* Do something. */; } 16162 int i __attribute__ ((visibility ("hidden"))); 16163 16164 The possible values of VISIBILITY_TYPE correspond to the 16165 visibility settings in the ELF gABI. 16166 16167 "default" 16168 Default visibility is the normal case for the object file 16169 format. This value is available for the visibility attribute 16170 to override other options that may change the assumed 16171 visibility of entities. 16172 16173 On ELF, default visibility means that the declaration is 16174 visible to other modules and, in shared libraries, means that 16175 the declared entity may be overridden. 16176 16177 On Darwin, default visibility means that the declaration is 16178 visible to other modules. 16179 16180 Default visibility corresponds to "external linkage" in the 16181 language. 16182 16183 "hidden" 16184 Hidden visibility indicates that the entity declared will 16185 have a new form of linkage, which we'll call "hidden 16186 linkage". Two declarations of an object with hidden linkage 16187 refer to the same object if they are in the same shared 16188 object. 16189 16190 "internal" 16191 Internal visibility is like hidden visibility, but with 16192 additional processor specific semantics. Unless otherwise 16193 specified by the psABI, GCC defines internal visibility to 16194 mean that a function is _never_ called from another module. 16195 Compare this with hidden functions which, while they cannot 16196 be referenced directly by other modules, can be referenced 16197 indirectly via function pointers. By indicating that a 16198 function cannot be called from outside the module, GCC may 16199 for instance omit the load of a PIC register since it is known 16200 that the calling function loaded the correct value. 16201 16202 "protected" 16203 Protected visibility is like default visibility except that it 16204 indicates that references within the defining module will 16205 bind to the definition in that module. That is, the declared 16206 entity cannot be overridden by another module. 16207 16208 16209 All visibilities are supported on many, but not all, ELF targets 16210 (supported when the assembler supports the `.visibility' 16211 pseudo-op). Default visibility is supported everywhere. Hidden 16212 visibility is supported on Darwin targets. 16213 16214 The visibility attribute should be applied only to declarations 16215 which would otherwise have external linkage. The attribute should 16216 be applied consistently, so that the same entity should not be 16217 declared with different settings of the attribute. 16218 16219 In C++, the visibility attribute applies to types as well as 16220 functions and objects, because in C++ types have linkage. A class 16221 must not have greater visibility than its non-static data member 16222 types and bases, and class members default to the visibility of 16223 their class. Also, a declaration without explicit visibility is 16224 limited to the visibility of its type. 16225 16226 In C++, you can mark member functions and static member variables 16227 of a class with the visibility attribute. This is useful if if 16228 you know a particular method or static member variable should only 16229 be used from one shared object; then you can mark it hidden while 16230 the rest of the class has default visibility. Care must be taken 16231 to avoid breaking the One Definition Rule; for example, it is 16232 usually not useful to mark an inline method as hidden without 16233 marking the whole class as hidden. 16234 16235 A C++ namespace declaration can also have the visibility attribute. 16236 This attribute applies only to the particular namespace body, not 16237 to other definitions of the same namespace; it is equivalent to 16238 using `#pragma GCC visibility' before and after the namespace 16239 definition (*note Visibility Pragmas::). 16240 16241 In C++, if a template argument has limited visibility, this 16242 restriction is implicitly propagated to the template instantiation. 16243 Otherwise, template instantiations and specializations default to 16244 the visibility of their template. 16245 16246 If both the template and enclosing class have explicit visibility, 16247 the visibility from the template is used. 16248 16249`warn_unused_result' 16250 The `warn_unused_result' attribute causes a warning to be emitted 16251 if a caller of the function with this attribute does not use its 16252 return value. This is useful for functions where not checking the 16253 result is either a security problem or always a bug, such as 16254 `realloc'. 16255 16256 int fn () __attribute__ ((warn_unused_result)); 16257 int foo () 16258 { 16259 if (fn () < 0) return -1; 16260 fn (); 16261 return 0; 16262 } 16263 16264 results in warning on line 5. 16265 16266`weak' 16267 The `weak' attribute causes the declaration to be emitted as a weak 16268 symbol rather than a global. This is primarily useful in defining 16269 library functions which can be overridden in user code, though it 16270 can also be used with non-function declarations. Weak symbols are 16271 supported for ELF targets, and also for a.out targets when using 16272 the GNU assembler and linker. 16273 16274`weakref' 16275`weakref ("TARGET")' 16276 The `weakref' attribute marks a declaration as a weak reference. 16277 Without arguments, it should be accompanied by an `alias' attribute 16278 naming the target symbol. Optionally, the TARGET may be given as 16279 an argument to `weakref' itself. In either case, `weakref' 16280 implicitly marks the declaration as `weak'. Without a TARGET, 16281 given as an argument to `weakref' or to `alias', `weakref' is 16282 equivalent to `weak'. 16283 16284 static int x() __attribute__ ((weakref ("y"))); 16285 /* is equivalent to... */ 16286 static int x() __attribute__ ((weak, weakref, alias ("y"))); 16287 /* and to... */ 16288 static int x() __attribute__ ((weakref)); 16289 static int x() __attribute__ ((alias ("y"))); 16290 16291 A weak reference is an alias that does not by itself require a 16292 definition to be given for the target symbol. If the target 16293 symbol is only referenced through weak references, then the 16294 becomes a `weak' undefined symbol. If it is directly referenced, 16295 however, then such strong references prevail, and a definition 16296 will be required for the symbol, not necessarily in the same 16297 translation unit. 16298 16299 The effect is equivalent to moving all references to the alias to a 16300 separate translation unit, renaming the alias to the aliased 16301 symbol, declaring it as weak, compiling the two separate 16302 translation units and performing a reloadable link on them. 16303 16304 At present, a declaration to which `weakref' is attached can only 16305 be `static'. 16306 16307`externally_visible' 16308 This attribute, attached to a global variable or function nullify 16309 effect of `-fwhole-program' command line option, so the object 16310 remain visible outside the current compilation unit 16311 16312 16313 You can specify multiple attributes in a declaration by separating them 16314by commas within the double parentheses or by immediately following an 16315attribute declaration with another attribute declaration. 16316 16317 Some people object to the `__attribute__' feature, suggesting that ISO 16318C's `#pragma' should be used instead. At the time `__attribute__' was 16319designed, there were two reasons for not doing this. 16320 16321 1. It is impossible to generate `#pragma' commands from a macro. 16322 16323 2. There is no telling what the same `#pragma' might mean in another 16324 compiler. 16325 16326 These two reasons applied to almost any application that might have 16327been proposed for `#pragma'. It was basically a mistake to use 16328`#pragma' for _anything_. 16329 16330 The ISO C99 standard includes `_Pragma', which now allows pragmas to 16331be generated from macros. In addition, a `#pragma GCC' namespace is 16332now in use for GCC-specific pragmas. However, it has been found 16333convenient to use `__attribute__' to achieve a natural attachment of 16334attributes to their corresponding declarations, whereas `#pragma GCC' 16335is of use for constructs that do not naturally form part of the 16336grammar. *Note Miscellaneous Preprocessing Directives: (cpp)Other 16337Directives. 16338 16339 16340File: gcc.info, Node: Attribute Syntax, Next: Function Prototypes, Prev: Function Attributes, Up: C Extensions 16341 163425.26 Attribute Syntax 16343===================== 16344 16345This section describes the syntax with which `__attribute__' may be 16346used, and the constructs to which attribute specifiers bind, for the C 16347language. Some details may vary for C++ and Objective-C. Because of 16348infelicities in the grammar for attributes, some forms described here 16349may not be successfully parsed in all cases. 16350 16351 There are some problems with the semantics of attributes in C++. For 16352example, there are no manglings for attributes, although they may affect 16353code generation, so problems may arise when attributed types are used in 16354conjunction with templates or overloading. Similarly, `typeid' does 16355not distinguish between types with different attributes. Support for 16356attributes in C++ may be restricted in future to attributes on 16357declarations only, but not on nested declarators. 16358 16359 *Note Function Attributes::, for details of the semantics of attributes 16360applying to functions. *Note Variable Attributes::, for details of the 16361semantics of attributes applying to variables. *Note Type Attributes::, 16362for details of the semantics of attributes applying to structure, union 16363and enumerated types. 16364 16365 An "attribute specifier" is of the form `__attribute__ 16366((ATTRIBUTE-LIST))'. An "attribute list" is a possibly empty 16367comma-separated sequence of "attributes", where each attribute is one 16368of the following: 16369 16370 * Empty. Empty attributes are ignored. 16371 16372 * A word (which may be an identifier such as `unused', or a reserved 16373 word such as `const'). 16374 16375 * A word, followed by, in parentheses, parameters for the attribute. 16376 These parameters take one of the following forms: 16377 16378 * An identifier. For example, `mode' attributes use this form. 16379 16380 * An identifier followed by a comma and a non-empty 16381 comma-separated list of expressions. For example, `format' 16382 attributes use this form. 16383 16384 * A possibly empty comma-separated list of expressions. For 16385 example, `format_arg' attributes use this form with the list 16386 being a single integer constant expression, and `alias' 16387 attributes use this form with the list being a single string 16388 constant. 16389 16390 An "attribute specifier list" is a sequence of one or more attribute 16391specifiers, not separated by any other tokens. 16392 16393 In GNU C, an attribute specifier list may appear after the colon 16394following a label, other than a `case' or `default' label. The only 16395attribute it makes sense to use after a label is `unused'. This 16396feature is intended for code generated by programs which contains labels 16397that may be unused but which is compiled with `-Wall'. It would not 16398normally be appropriate to use in it human-written code, though it 16399could be useful in cases where the code that jumps to the label is 16400contained within an `#ifdef' conditional. GNU C++ does not permit such 16401placement of attribute lists, as it is permissible for a declaration, 16402which could begin with an attribute list, to be labelled in C++. 16403Declarations cannot be labelled in C90 or C99, so the ambiguity does 16404not arise there. 16405 16406 An attribute specifier list may appear as part of a `struct', `union' 16407or `enum' specifier. It may go either immediately after the `struct', 16408`union' or `enum' keyword, or after the closing brace. The former 16409syntax is preferred. Where attribute specifiers follow the closing 16410brace, they are considered to relate to the structure, union or 16411enumerated type defined, not to any enclosing declaration the type 16412specifier appears in, and the type defined is not complete until after 16413the attribute specifiers. 16414 16415 Otherwise, an attribute specifier appears as part of a declaration, 16416counting declarations of unnamed parameters and type names, and relates 16417to that declaration (which may be nested in another declaration, for 16418example in the case of a parameter declaration), or to a particular 16419declarator within a declaration. Where an attribute specifier is 16420applied to a parameter declared as a function or an array, it should 16421apply to the function or array rather than the pointer to which the 16422parameter is implicitly converted, but this is not yet correctly 16423implemented. 16424 16425 Any list of specifiers and qualifiers at the start of a declaration may 16426contain attribute specifiers, whether or not such a list may in that 16427context contain storage class specifiers. (Some attributes, however, 16428are essentially in the nature of storage class specifiers, and only make 16429sense where storage class specifiers may be used; for example, 16430`section'.) There is one necessary limitation to this syntax: the 16431first old-style parameter declaration in a function definition cannot 16432begin with an attribute specifier, because such an attribute applies to 16433the function instead by syntax described below (which, however, is not 16434yet implemented in this case). In some other cases, attribute 16435specifiers are permitted by this grammar but not yet supported by the 16436compiler. All attribute specifiers in this place relate to the 16437declaration as a whole. In the obsolescent usage where a type of `int' 16438is implied by the absence of type specifiers, such a list of specifiers 16439and qualifiers may be an attribute specifier list with no other 16440specifiers or qualifiers. 16441 16442 At present, the first parameter in a function prototype must have some 16443type specifier which is not an attribute specifier; this resolves an 16444ambiguity in the interpretation of `void f(int (__attribute__((foo)) 16445x))', but is subject to change. At present, if the parentheses of a 16446function declarator contain only attributes then those attributes are 16447ignored, rather than yielding an error or warning or implying a single 16448parameter of type int, but this is subject to change. 16449 16450 An attribute specifier list may appear immediately before a declarator 16451(other than the first) in a comma-separated list of declarators in a 16452declaration of more than one identifier using a single list of 16453specifiers and qualifiers. Such attribute specifiers apply only to the 16454identifier before whose declarator they appear. For example, in 16455 16456 __attribute__((noreturn)) void d0 (void), 16457 __attribute__((format(printf, 1, 2))) d1 (const char *, ...), 16458 d2 (void) 16459 16460the `noreturn' attribute applies to all the functions declared; the 16461`format' attribute only applies to `d1'. 16462 16463 An attribute specifier list may appear immediately before the comma, 16464`=' or semicolon terminating the declaration of an identifier other 16465than a function definition. At present, such attribute specifiers apply 16466to the declared object or function, but in future they may attach to the 16467outermost adjacent declarator. In simple cases there is no difference, 16468but, for example, in 16469 16470 void (****f)(void) __attribute__((noreturn)); 16471 16472at present the `noreturn' attribute applies to `f', which causes a 16473warning since `f' is not a function, but in future it may apply to the 16474function `****f'. The precise semantics of what attributes in such 16475cases will apply to are not yet specified. Where an assembler name for 16476an object or function is specified (*note Asm Labels::), at present the 16477attribute must follow the `asm' specification; in future, attributes 16478before the `asm' specification may apply to the adjacent declarator, 16479and those after it to the declared object or function. 16480 16481 An attribute specifier list may, in future, be permitted to appear 16482after the declarator in a function definition (before any old-style 16483parameter declarations or the function body). 16484 16485 Attribute specifiers may be mixed with type qualifiers appearing inside 16486the `[]' of a parameter array declarator, in the C99 construct by which 16487such qualifiers are applied to the pointer to which the array is 16488implicitly converted. Such attribute specifiers apply to the pointer, 16489not to the array, but at present this is not implemented and they are 16490ignored. 16491 16492 An attribute specifier list may appear at the start of a nested 16493declarator. At present, there are some limitations in this usage: the 16494attributes correctly apply to the declarator, but for most individual 16495attributes the semantics this implies are not implemented. When 16496attribute specifiers follow the `*' of a pointer declarator, they may 16497be mixed with any type qualifiers present. The following describes the 16498formal semantics of this syntax. It will make the most sense if you 16499are familiar with the formal specification of declarators in the ISO C 16500standard. 16501 16502 Consider (as in C99 subclause 6.7.5 paragraph 4) a declaration `T D1', 16503where `T' contains declaration specifiers that specify a type TYPE 16504(such as `int') and `D1' is a declarator that contains an identifier 16505IDENT. The type specified for IDENT for derived declarators whose type 16506does not include an attribute specifier is as in the ISO C standard. 16507 16508 If `D1' has the form `( ATTRIBUTE-SPECIFIER-LIST D )', and the 16509declaration `T D' specifies the type "DERIVED-DECLARATOR-TYPE-LIST 16510TYPE" for IDENT, then `T D1' specifies the type 16511"DERIVED-DECLARATOR-TYPE-LIST ATTRIBUTE-SPECIFIER-LIST TYPE" for IDENT. 16512 16513 If `D1' has the form `* TYPE-QUALIFIER-AND-ATTRIBUTE-SPECIFIER-LIST 16514D', and the declaration `T D' specifies the type 16515"DERIVED-DECLARATOR-TYPE-LIST TYPE" for IDENT, then `T D1' specifies 16516the type "DERIVED-DECLARATOR-TYPE-LIST 16517TYPE-QUALIFIER-AND-ATTRIBUTE-SPECIFIER-LIST TYPE" for IDENT. 16518 16519 For example, 16520 16521 void (__attribute__((noreturn)) ****f) (void); 16522 16523specifies the type "pointer to pointer to pointer to pointer to 16524non-returning function returning `void'". As another example, 16525 16526 char *__attribute__((aligned(8))) *f; 16527 16528specifies the type "pointer to 8-byte-aligned pointer to `char'". Note 16529again that this does not work with most attributes; for example, the 16530usage of `aligned' and `noreturn' attributes given above is not yet 16531supported. 16532 16533 For compatibility with existing code written for compiler versions that 16534did not implement attributes on nested declarators, some laxity is 16535allowed in the placing of attributes. If an attribute that only applies 16536to types is applied to a declaration, it will be treated as applying to 16537the type of that declaration. If an attribute that only applies to 16538declarations is applied to the type of a declaration, it will be treated 16539as applying to that declaration; and, for compatibility with code 16540placing the attributes immediately before the identifier declared, such 16541an attribute applied to a function return type will be treated as 16542applying to the function type, and such an attribute applied to an array 16543element type will be treated as applying to the array type. If an 16544attribute that only applies to function types is applied to a 16545pointer-to-function type, it will be treated as applying to the pointer 16546target type; if such an attribute is applied to a function return type 16547that is not a pointer-to-function type, it will be treated as applying 16548to the function type. 16549 16550 16551File: gcc.info, Node: Function Prototypes, Next: C++ Comments, Prev: Attribute Syntax, Up: C Extensions 16552 165535.27 Prototypes and Old-Style Function Definitions 16554================================================== 16555 16556GNU C extends ISO C to allow a function prototype to override a later 16557old-style non-prototype definition. Consider the following example: 16558 16559 /* Use prototypes unless the compiler is old-fashioned. */ 16560 #ifdef __STDC__ 16561 #define P(x) x 16562 #else 16563 #define P(x) () 16564 #endif 16565 16566 /* Prototype function declaration. */ 16567 int isroot P((uid_t)); 16568 16569 /* Old-style function definition. */ 16570 int 16571 isroot (x) /* ??? lossage here ??? */ 16572 uid_t x; 16573 { 16574 return x == 0; 16575 } 16576 16577 Suppose the type `uid_t' happens to be `short'. ISO C does not allow 16578this example, because subword arguments in old-style non-prototype 16579definitions are promoted. Therefore in this example the function 16580definition's argument is really an `int', which does not match the 16581prototype argument type of `short'. 16582 16583 This restriction of ISO C makes it hard to write code that is portable 16584to traditional C compilers, because the programmer does not know 16585whether the `uid_t' type is `short', `int', or `long'. Therefore, in 16586cases like these GNU C allows a prototype to override a later old-style 16587definition. More precisely, in GNU C, a function prototype argument 16588type overrides the argument type specified by a later old-style 16589definition if the former type is the same as the latter type before 16590promotion. Thus in GNU C the above example is equivalent to the 16591following: 16592 16593 int isroot (uid_t); 16594 16595 int 16596 isroot (uid_t x) 16597 { 16598 return x == 0; 16599 } 16600 16601GNU C++ does not support old-style function definitions, so this 16602extension is irrelevant. 16603 16604 16605File: gcc.info, Node: C++ Comments, Next: Dollar Signs, Prev: Function Prototypes, Up: C Extensions 16606 166075.28 C++ Style Comments 16608======================= 16609 16610In GNU C, you may use C++ style comments, which start with `//' and 16611continue until the end of the line. Many other C implementations allow 16612such comments, and they are included in the 1999 C standard. However, 16613C++ style comments are not recognized if you specify an `-std' option 16614specifying a version of ISO C before C99, or `-ansi' (equivalent to 16615`-std=c89'). 16616 16617 16618File: gcc.info, Node: Dollar Signs, Next: Character Escapes, Prev: C++ Comments, Up: C Extensions 16619 166205.29 Dollar Signs in Identifier Names 16621===================================== 16622 16623In GNU C, you may normally use dollar signs in identifier names. This 16624is because many traditional C implementations allow such identifiers. 16625However, dollar signs in identifiers are not supported on a few target 16626machines, typically because the target assembler does not allow them. 16627 16628 16629File: gcc.info, Node: Character Escapes, Next: Variable Attributes, Prev: Dollar Signs, Up: C Extensions 16630 166315.30 The Character <ESC> in Constants 16632===================================== 16633 16634You can use the sequence `\e' in a string or character constant to 16635stand for the ASCII character <ESC>. 16636 16637 16638File: gcc.info, Node: Alignment, Next: Inline, Prev: Type Attributes, Up: C Extensions 16639 166405.31 Inquiring on Alignment of Types or Variables 16641================================================= 16642 16643The keyword `__alignof__' allows you to inquire about how an object is 16644aligned, or the minimum alignment usually required by a type. Its 16645syntax is just like `sizeof'. 16646 16647 For example, if the target machine requires a `double' value to be 16648aligned on an 8-byte boundary, then `__alignof__ (double)' is 8. This 16649is true on many RISC machines. On more traditional machine designs, 16650`__alignof__ (double)' is 4 or even 2. 16651 16652 Some machines never actually require alignment; they allow reference 16653to any data type even at an odd address. For these machines, 16654`__alignof__' reports the _recommended_ alignment of a type. 16655 16656 If the operand of `__alignof__' is an lvalue rather than a type, its 16657value is the required alignment for its type, taking into account any 16658minimum alignment specified with GCC's `__attribute__' extension (*note 16659Variable Attributes::). For example, after this declaration: 16660 16661 struct foo { int x; char y; } foo1; 16662 16663the value of `__alignof__ (foo1.y)' is 1, even though its actual 16664alignment is probably 2 or 4, the same as `__alignof__ (int)'. 16665 16666 It is an error to ask for the alignment of an incomplete type. 16667 16668 16669File: gcc.info, Node: Variable Attributes, Next: Type Attributes, Prev: Character Escapes, Up: C Extensions 16670 166715.32 Specifying Attributes of Variables 16672======================================= 16673 16674The keyword `__attribute__' allows you to specify special attributes of 16675variables or structure fields. This keyword is followed by an 16676attribute specification inside double parentheses. Some attributes are 16677currently defined generically for variables. Other attributes are 16678defined for variables on particular target systems. Other attributes 16679are available for functions (*note Function Attributes::) and for types 16680(*note Type Attributes::). Other front ends might define more 16681attributes (*note Extensions to the C++ Language: C++ Extensions.). 16682 16683 You may also specify attributes with `__' preceding and following each 16684keyword. This allows you to use them in header files without being 16685concerned about a possible macro of the same name. For example, you 16686may use `__aligned__' instead of `aligned'. 16687 16688 *Note Attribute Syntax::, for details of the exact syntax for using 16689attributes. 16690 16691`aligned (ALIGNMENT)' 16692 This attribute specifies a minimum alignment for the variable or 16693 structure field, measured in bytes. For example, the declaration: 16694 16695 int x __attribute__ ((aligned (16))) = 0; 16696 16697 causes the compiler to allocate the global variable `x' on a 16698 16-byte boundary. On a 68040, this could be used in conjunction 16699 with an `asm' expression to access the `move16' instruction which 16700 requires 16-byte aligned operands. 16701 16702 You can also specify the alignment of structure fields. For 16703 example, to create a double-word aligned `int' pair, you could 16704 write: 16705 16706 struct foo { int x[2] __attribute__ ((aligned (8))); }; 16707 16708 This is an alternative to creating a union with a `double' member 16709 that forces the union to be double-word aligned. 16710 16711 As in the preceding examples, you can explicitly specify the 16712 alignment (in bytes) that you wish the compiler to use for a given 16713 variable or structure field. Alternatively, you can leave out the 16714 alignment factor and just ask the compiler to align a variable or 16715 field to the maximum useful alignment for the target machine you 16716 are compiling for. For example, you could write: 16717 16718 short array[3] __attribute__ ((aligned)); 16719 16720 Whenever you leave out the alignment factor in an `aligned' 16721 attribute specification, the compiler automatically sets the 16722 alignment for the declared variable or field to the largest 16723 alignment which is ever used for any data type on the target 16724 machine you are compiling for. Doing this can often make copy 16725 operations more efficient, because the compiler can use whatever 16726 instructions copy the biggest chunks of memory when performing 16727 copies to or from the variables or fields that you have aligned 16728 this way. 16729 16730 The `aligned' attribute can only increase the alignment; but you 16731 can decrease it by specifying `packed' as well. See below. 16732 16733 Note that the effectiveness of `aligned' attributes may be limited 16734 by inherent limitations in your linker. On many systems, the 16735 linker is only able to arrange for variables to be aligned up to a 16736 certain maximum alignment. (For some linkers, the maximum 16737 supported alignment may be very very small.) If your linker is 16738 only able to align variables up to a maximum of 8 byte alignment, 16739 then specifying `aligned(16)' in an `__attribute__' will still 16740 only provide you with 8 byte alignment. See your linker 16741 documentation for further information. 16742 16743`cleanup (CLEANUP_FUNCTION)' 16744 The `cleanup' attribute runs a function when the variable goes out 16745 of scope. This attribute can only be applied to auto function 16746 scope variables; it may not be applied to parameters or variables 16747 with static storage duration. The function must take one 16748 parameter, a pointer to a type compatible with the variable. The 16749 return value of the function (if any) is ignored. 16750 16751 If `-fexceptions' is enabled, then CLEANUP_FUNCTION will be run 16752 during the stack unwinding that happens during the processing of 16753 the exception. Note that the `cleanup' attribute does not allow 16754 the exception to be caught, only to perform an action. It is 16755 undefined what happens if CLEANUP_FUNCTION does not return 16756 normally. 16757 16758`common' 16759`nocommon' 16760 The `common' attribute requests GCC to place a variable in 16761 "common" storage. The `nocommon' attribute requests the 16762 opposite--to allocate space for it directly. 16763 16764 These attributes override the default chosen by the `-fno-common' 16765 and `-fcommon' flags respectively. 16766 16767`deprecated' 16768 The `deprecated' attribute results in a warning if the variable is 16769 used anywhere in the source file. This is useful when identifying 16770 variables that are expected to be removed in a future version of a 16771 program. The warning also includes the location of the declaration 16772 of the deprecated variable, to enable users to easily find further 16773 information about why the variable is deprecated, or what they 16774 should do instead. Note that the warning only occurs for uses: 16775 16776 extern int old_var __attribute__ ((deprecated)); 16777 extern int old_var; 16778 int new_fn () { return old_var; } 16779 16780 results in a warning on line 3 but not line 2. 16781 16782 The `deprecated' attribute can also be used for functions and 16783 types (*note Function Attributes::, *note Type Attributes::.) 16784 16785`mode (MODE)' 16786 This attribute specifies the data type for the 16787 declaration--whichever type corresponds to the mode MODE. This in 16788 effect lets you request an integer or floating point type 16789 according to its width. 16790 16791 You may also specify a mode of `byte' or `__byte__' to indicate 16792 the mode corresponding to a one-byte integer, `word' or `__word__' 16793 for the mode of a one-word integer, and `pointer' or `__pointer__' 16794 for the mode used to represent pointers. 16795 16796`packed' 16797 The `packed' attribute specifies that a variable or structure field 16798 should have the smallest possible alignment--one byte for a 16799 variable, and one bit for a field, unless you specify a larger 16800 value with the `aligned' attribute. 16801 16802 Here is a structure in which the field `x' is packed, so that it 16803 immediately follows `a': 16804 16805 struct foo 16806 { 16807 char a; 16808 int x[2] __attribute__ ((packed)); 16809 }; 16810 16811`section ("SECTION-NAME")' 16812 Normally, the compiler places the objects it generates in sections 16813 like `data' and `bss'. Sometimes, however, you need additional 16814 sections, or you need certain particular variables to appear in 16815 special sections, for example to map to special hardware. The 16816 `section' attribute specifies that a variable (or function) lives 16817 in a particular section. For example, this small program uses 16818 several specific section names: 16819 16820 struct duart a __attribute__ ((section ("DUART_A"))) = { 0 }; 16821 struct duart b __attribute__ ((section ("DUART_B"))) = { 0 }; 16822 char stack[10000] __attribute__ ((section ("STACK"))) = { 0 }; 16823 int init_data __attribute__ ((section ("INITDATA"))) = 0; 16824 16825 main() 16826 { 16827 /* Initialize stack pointer */ 16828 init_sp (stack + sizeof (stack)); 16829 16830 /* Initialize initialized data */ 16831 memcpy (&init_data, &data, &edata - &data); 16832 16833 /* Turn on the serial ports */ 16834 init_duart (&a); 16835 init_duart (&b); 16836 } 16837 16838 Use the `section' attribute with an _initialized_ definition of a 16839 _global_ variable, as shown in the example. GCC issues a warning 16840 and otherwise ignores the `section' attribute in uninitialized 16841 variable declarations. 16842 16843 You may only use the `section' attribute with a fully initialized 16844 global definition because of the way linkers work. The linker 16845 requires each object be defined once, with the exception that 16846 uninitialized variables tentatively go in the `common' (or `bss') 16847 section and can be multiply "defined". You can force a variable 16848 to be initialized with the `-fno-common' flag or the `nocommon' 16849 attribute. 16850 16851 Some file formats do not support arbitrary sections so the 16852 `section' attribute is not available on all platforms. If you 16853 need to map the entire contents of a module to a particular 16854 section, consider using the facilities of the linker instead. 16855 16856`shared' 16857 On Microsoft Windows, in addition to putting variable definitions 16858 in a named section, the section can also be shared among all 16859 running copies of an executable or DLL. For example, this small 16860 program defines shared data by putting it in a named section 16861 `shared' and marking the section shareable: 16862 16863 int foo __attribute__((section ("shared"), shared)) = 0; 16864 16865 int 16866 main() 16867 { 16868 /* Read and write foo. All running 16869 copies see the same value. */ 16870 return 0; 16871 } 16872 16873 You may only use the `shared' attribute along with `section' 16874 attribute with a fully initialized global definition because of 16875 the way linkers work. See `section' attribute for more 16876 information. 16877 16878 The `shared' attribute is only available on Microsoft Windows. 16879 16880`tls_model ("TLS_MODEL")' 16881 The `tls_model' attribute sets thread-local storage model (*note 16882 Thread-Local::) of a particular `__thread' variable, overriding 16883 `-ftls-model=' command line switch on a per-variable basis. The 16884 TLS_MODEL argument should be one of `global-dynamic', 16885 `local-dynamic', `initial-exec' or `local-exec'. 16886 16887 Not all targets support this attribute. 16888 16889`unused' 16890 This attribute, attached to a variable, means that the variable is 16891 meant to be possibly unused. GCC will not produce a warning for 16892 this variable. 16893 16894`used' 16895 This attribute, attached to a variable, means that the variable 16896 must be emitted even if it appears that the variable is not 16897 referenced. 16898 16899`vector_size (BYTES)' 16900 This attribute specifies the vector size for the variable, 16901 measured in bytes. For example, the declaration: 16902 16903 int foo __attribute__ ((vector_size (16))); 16904 16905 causes the compiler to set the mode for `foo', to be 16 bytes, 16906 divided into `int' sized units. Assuming a 32-bit int (a vector of 16907 4 units of 4 bytes), the corresponding mode of `foo' will be V4SI. 16908 16909 This attribute is only applicable to integral and float scalars, 16910 although arrays, pointers, and function return values are allowed 16911 in conjunction with this construct. 16912 16913 Aggregates with this attribute are invalid, even if they are of 16914 the same size as a corresponding scalar. For example, the 16915 declaration: 16916 16917 struct S { int a; }; 16918 struct S __attribute__ ((vector_size (16))) foo; 16919 16920 is invalid even if the size of the structure is the same as the 16921 size of the `int'. 16922 16923`selectany' 16924 The `selectany' attribute causes an initialized global variable to 16925 have link-once semantics. When multiple definitions of the 16926 variable are encountered by the linker, the first is selected and 16927 the remainder are discarded. Following usage by the Microsoft 16928 compiler, the linker is told _not_ to warn about size or content 16929 differences of the multiple definitions. 16930 16931 Although the primary usage of this attribute is for POD types, the 16932 attribute can also be applied to global C++ objects that are 16933 initialized by a constructor. In this case, the static 16934 initialization and destruction code for the object is emitted in 16935 each translation defining the object, but the calls to the 16936 constructor and destructor are protected by a link-once guard 16937 variable. 16938 16939 The `selectany' attribute is only available on Microsoft Windows 16940 targets. You can use `__declspec (selectany)' as a synonym for 16941 `__attribute__ ((selectany))' for compatibility with other 16942 compilers. 16943 16944`weak' 16945 The `weak' attribute is described in *Note Function Attributes::. 16946 16947`dllimport' 16948 The `dllimport' attribute is described in *Note Function 16949 Attributes::. 16950 16951`dllexport' 16952 The `dllexport' attribute is described in *Note Function 16953 Attributes::. 16954 16955 169565.32.1 M32R/D Variable Attributes 16957--------------------------------- 16958 16959One attribute is currently defined for the M32R/D. 16960 16961`model (MODEL-NAME)' 16962 Use this attribute on the M32R/D to set the addressability of an 16963 object. The identifier MODEL-NAME is one of `small', `medium', or 16964 `large', representing each of the code models. 16965 16966 Small model objects live in the lower 16MB of memory (so that their 16967 addresses can be loaded with the `ld24' instruction). 16968 16969 Medium and large model objects may live anywhere in the 32-bit 16970 address space (the compiler will generate `seth/add3' instructions 16971 to load their addresses). 16972 169735.32.2 i386 Variable Attributes 16974------------------------------- 16975 16976Two attributes are currently defined for i386 configurations: 16977`ms_struct' and `gcc_struct' 16978 16979`ms_struct' 16980`gcc_struct' 16981 If `packed' is used on a structure, or if bit-fields are used it 16982 may be that the Microsoft ABI packs them differently than GCC 16983 would normally pack them. Particularly when moving packed data 16984 between functions compiled with GCC and the native Microsoft 16985 compiler (either via function call or as data in a file), it may 16986 be necessary to access either format. 16987 16988 Currently `-m[no-]ms-bitfields' is provided for the Microsoft 16989 Windows X86 compilers to match the native Microsoft compiler. 16990 16991 The Microsoft structure layout algorithm is fairly simple with the 16992 exception of the bitfield packing: 16993 16994 The padding and alignment of members of structures and whether a 16995 bit field can straddle a storage-unit boundary 16996 16997 1. Structure members are stored sequentially in the order in 16998 which they are declared: the first member has the lowest 16999 memory address and the last member the highest. 17000 17001 2. Every data object has an alignment-requirement. The 17002 alignment-requirement for all data except structures, unions, 17003 and arrays is either the size of the object or the current 17004 packing size (specified with either the aligned attribute or 17005 the pack pragma), whichever is less. For structures, unions, 17006 and arrays, the alignment-requirement is the largest 17007 alignment-requirement of its members. Every object is 17008 allocated an offset so that: 17009 17010 offset % alignment-requirement == 0 17011 17012 3. Adjacent bit fields are packed into the same 1-, 2-, or 17013 4-byte allocation unit if the integral types are the same 17014 size and if the next bit field fits into the current 17015 allocation unit without crossing the boundary imposed by the 17016 common alignment requirements of the bit fields. 17017 17018 Handling of zero-length bitfields: 17019 17020 MSVC interprets zero-length bitfields in the following ways: 17021 17022 1. If a zero-length bitfield is inserted between two bitfields 17023 that would normally be coalesced, the bitfields will not be 17024 coalesced. 17025 17026 For example: 17027 17028 struct 17029 { 17030 unsigned long bf_1 : 12; 17031 unsigned long : 0; 17032 unsigned long bf_2 : 12; 17033 } t1; 17034 17035 The size of `t1' would be 8 bytes with the zero-length 17036 bitfield. If the zero-length bitfield were removed, `t1''s 17037 size would be 4 bytes. 17038 17039 2. If a zero-length bitfield is inserted after a bitfield, 17040 `foo', and the alignment of the zero-length bitfield is 17041 greater than the member that follows it, `bar', `bar' will be 17042 aligned as the type of the zero-length bitfield. 17043 17044 For example: 17045 17046 struct 17047 { 17048 char foo : 4; 17049 short : 0; 17050 char bar; 17051 } t2; 17052 17053 struct 17054 { 17055 char foo : 4; 17056 short : 0; 17057 double bar; 17058 } t3; 17059 17060 For `t2', `bar' will be placed at offset 2, rather than 17061 offset 1. Accordingly, the size of `t2' will be 4. For 17062 `t3', the zero-length bitfield will not affect the alignment 17063 of `bar' or, as a result, the size of the structure. 17064 17065 Taking this into account, it is important to note the 17066 following: 17067 17068 1. If a zero-length bitfield follows a normal bitfield, the 17069 type of the zero-length bitfield may affect the 17070 alignment of the structure as whole. For example, `t2' 17071 has a size of 4 bytes, since the zero-length bitfield 17072 follows a normal bitfield, and is of type short. 17073 17074 2. Even if a zero-length bitfield is not followed by a 17075 normal bitfield, it may still affect the alignment of 17076 the structure: 17077 17078 struct 17079 { 17080 char foo : 6; 17081 long : 0; 17082 } t4; 17083 17084 Here, `t4' will take up 4 bytes. 17085 17086 3. Zero-length bitfields following non-bitfield members are 17087 ignored: 17088 17089 struct 17090 { 17091 char foo; 17092 long : 0; 17093 char bar; 17094 } t5; 17095 17096 Here, `t5' will take up 2 bytes. 17097 170985.32.3 PowerPC Variable Attributes 17099---------------------------------- 17100 17101Three attributes currently are defined for PowerPC configurations: 17102`altivec', `ms_struct' and `gcc_struct'. 17103 17104 For full documentation of the struct attributes please see the 17105documentation in the *Note i386 Variable Attributes::, section. 17106 17107 For documentation of `altivec' attribute please see the documentation 17108in the *Note PowerPC Type Attributes::, section. 17109 171105.32.4 Xstormy16 Variable Attributes 17111------------------------------------ 17112 17113One attribute is currently defined for xstormy16 configurations: 17114`below100' 17115 17116`below100' 17117 If a variable has the `below100' attribute (`BELOW100' is allowed 17118 also), GCC will place the variable in the first 0x100 bytes of 17119 memory and use special opcodes to access it. Such variables will 17120 be placed in either the `.bss_below100' section or the 17121 `.data_below100' section. 17122 17123 17124 17125File: gcc.info, Node: Type Attributes, Next: Alignment, Prev: Variable Attributes, Up: C Extensions 17126 171275.33 Specifying Attributes of Types 17128=================================== 17129 17130The keyword `__attribute__' allows you to specify special attributes of 17131`struct' and `union' types when you define such types. This keyword is 17132followed by an attribute specification inside double parentheses. 17133Seven attributes are currently defined for types: `aligned', `packed', 17134`transparent_union', `unused', `deprecated', `visibility', and 17135`may_alias'. Other attributes are defined for functions (*note 17136Function Attributes::) and for variables (*note Variable Attributes::). 17137 17138 You may also specify any one of these attributes with `__' preceding 17139and following its keyword. This allows you to use these attributes in 17140header files without being concerned about a possible macro of the same 17141name. For example, you may use `__aligned__' instead of `aligned'. 17142 17143 You may specify type attributes either in a `typedef' declaration or 17144in an enum, struct or union type declaration or definition. 17145 17146 For an enum, struct or union type, you may specify attributes either 17147between the enum, struct or union tag and the name of the type, or just 17148past the closing curly brace of the _definition_. The former syntax is 17149preferred. 17150 17151 *Note Attribute Syntax::, for details of the exact syntax for using 17152attributes. 17153 17154`aligned (ALIGNMENT)' 17155 This attribute specifies a minimum alignment (in bytes) for 17156 variables of the specified type. For example, the declarations: 17157 17158 struct S { short f[3]; } __attribute__ ((aligned (8))); 17159 typedef int more_aligned_int __attribute__ ((aligned (8))); 17160 17161 force the compiler to insure (as far as it can) that each variable 17162 whose type is `struct S' or `more_aligned_int' will be allocated 17163 and aligned _at least_ on a 8-byte boundary. On a SPARC, having 17164 all variables of type `struct S' aligned to 8-byte boundaries 17165 allows the compiler to use the `ldd' and `std' (doubleword load and 17166 store) instructions when copying one variable of type `struct S' to 17167 another, thus improving run-time efficiency. 17168 17169 Note that the alignment of any given `struct' or `union' type is 17170 required by the ISO C standard to be at least a perfect multiple of 17171 the lowest common multiple of the alignments of all of the members 17172 of the `struct' or `union' in question. This means that you _can_ 17173 effectively adjust the alignment of a `struct' or `union' type by 17174 attaching an `aligned' attribute to any one of the members of such 17175 a type, but the notation illustrated in the example above is a 17176 more obvious, intuitive, and readable way to request the compiler 17177 to adjust the alignment of an entire `struct' or `union' type. 17178 17179 As in the preceding example, you can explicitly specify the 17180 alignment (in bytes) that you wish the compiler to use for a given 17181 `struct' or `union' type. Alternatively, you can leave out the 17182 alignment factor and just ask the compiler to align a type to the 17183 maximum useful alignment for the target machine you are compiling 17184 for. For example, you could write: 17185 17186 struct S { short f[3]; } __attribute__ ((aligned)); 17187 17188 Whenever you leave out the alignment factor in an `aligned' 17189 attribute specification, the compiler automatically sets the 17190 alignment for the type to the largest alignment which is ever used 17191 for any data type on the target machine you are compiling for. 17192 Doing this can often make copy operations more efficient, because 17193 the compiler can use whatever instructions copy the biggest chunks 17194 of memory when performing copies to or from the variables which 17195 have types that you have aligned this way. 17196 17197 In the example above, if the size of each `short' is 2 bytes, then 17198 the size of the entire `struct S' type is 6 bytes. The smallest 17199 power of two which is greater than or equal to that is 8, so the 17200 compiler sets the alignment for the entire `struct S' type to 8 17201 bytes. 17202 17203 Note that although you can ask the compiler to select a 17204 time-efficient alignment for a given type and then declare only 17205 individual stand-alone objects of that type, the compiler's 17206 ability to select a time-efficient alignment is primarily useful 17207 only when you plan to create arrays of variables having the 17208 relevant (efficiently aligned) type. If you declare or use arrays 17209 of variables of an efficiently-aligned type, then it is likely 17210 that your program will also be doing pointer arithmetic (or 17211 subscripting, which amounts to the same thing) on pointers to the 17212 relevant type, and the code that the compiler generates for these 17213 pointer arithmetic operations will often be more efficient for 17214 efficiently-aligned types than for other types. 17215 17216 The `aligned' attribute can only increase the alignment; but you 17217 can decrease it by specifying `packed' as well. See below. 17218 17219 Note that the effectiveness of `aligned' attributes may be limited 17220 by inherent limitations in your linker. On many systems, the 17221 linker is only able to arrange for variables to be aligned up to a 17222 certain maximum alignment. (For some linkers, the maximum 17223 supported alignment may be very very small.) If your linker is 17224 only able to align variables up to a maximum of 8 byte alignment, 17225 then specifying `aligned(16)' in an `__attribute__' will still 17226 only provide you with 8 byte alignment. See your linker 17227 documentation for further information. 17228 17229`packed' 17230 This attribute, attached to `struct' or `union' type definition, 17231 specifies that each member (other than zero-width bitfields) of 17232 the structure or union is placed to minimize the memory required. 17233 When attached to an `enum' definition, it indicates that the 17234 smallest integral type should be used. 17235 17236 Specifying this attribute for `struct' and `union' types is 17237 equivalent to specifying the `packed' attribute on each of the 17238 structure or union members. Specifying the `-fshort-enums' flag 17239 on the line is equivalent to specifying the `packed' attribute on 17240 all `enum' definitions. 17241 17242 In the following example `struct my_packed_struct''s members are 17243 packed closely together, but the internal layout of its `s' member 17244 is not packed--to do that, `struct my_unpacked_struct' would need 17245 to be packed too. 17246 17247 struct my_unpacked_struct 17248 { 17249 char c; 17250 int i; 17251 }; 17252 17253 struct __attribute__ ((__packed__)) my_packed_struct 17254 { 17255 char c; 17256 int i; 17257 struct my_unpacked_struct s; 17258 }; 17259 17260 You may only specify this attribute on the definition of a `enum', 17261 `struct' or `union', not on a `typedef' which does not also define 17262 the enumerated type, structure or union. 17263 17264`transparent_union' 17265 This attribute, attached to a `union' type definition, indicates 17266 that any function parameter having that union type causes calls to 17267 that function to be treated in a special way. 17268 17269 First, the argument corresponding to a transparent union type can 17270 be of any type in the union; no cast is required. Also, if the 17271 union contains a pointer type, the corresponding argument can be a 17272 null pointer constant or a void pointer expression; and if the 17273 union contains a void pointer type, the corresponding argument can 17274 be any pointer expression. If the union member type is a pointer, 17275 qualifiers like `const' on the referenced type must be respected, 17276 just as with normal pointer conversions. 17277 17278 Second, the argument is passed to the function using the calling 17279 conventions of the first member of the transparent union, not the 17280 calling conventions of the union itself. All members of the union 17281 must have the same machine representation; this is necessary for 17282 this argument passing to work properly. 17283 17284 Transparent unions are designed for library functions that have 17285 multiple interfaces for compatibility reasons. For example, 17286 suppose the `wait' function must accept either a value of type 17287 `int *' to comply with Posix, or a value of type `union wait *' to 17288 comply with the 4.1BSD interface. If `wait''s parameter were 17289 `void *', `wait' would accept both kinds of arguments, but it 17290 would also accept any other pointer type and this would make 17291 argument type checking less useful. Instead, `<sys/wait.h>' might 17292 define the interface as follows: 17293 17294 typedef union 17295 { 17296 int *__ip; 17297 union wait *__up; 17298 } wait_status_ptr_t __attribute__ ((__transparent_union__)); 17299 17300 pid_t wait (wait_status_ptr_t); 17301 17302 This interface allows either `int *' or `union wait *' arguments 17303 to be passed, using the `int *' calling convention. The program 17304 can call `wait' with arguments of either type: 17305 17306 int w1 () { int w; return wait (&w); } 17307 int w2 () { union wait w; return wait (&w); } 17308 17309 With this interface, `wait''s implementation might look like this: 17310 17311 pid_t wait (wait_status_ptr_t p) 17312 { 17313 return waitpid (-1, p.__ip, 0); 17314 } 17315 17316`unused' 17317 When attached to a type (including a `union' or a `struct'), this 17318 attribute means that variables of that type are meant to appear 17319 possibly unused. GCC will not produce a warning for any variables 17320 of that type, even if the variable appears to do nothing. This is 17321 often the case with lock or thread classes, which are usually 17322 defined and then not referenced, but contain constructors and 17323 destructors that have nontrivial bookkeeping functions. 17324 17325`deprecated' 17326 The `deprecated' attribute results in a warning if the type is 17327 used anywhere in the source file. This is useful when identifying 17328 types that are expected to be removed in a future version of a 17329 program. If possible, the warning also includes the location of 17330 the declaration of the deprecated type, to enable users to easily 17331 find further information about why the type is deprecated, or what 17332 they should do instead. Note that the warnings only occur for 17333 uses and then only if the type is being applied to an identifier 17334 that itself is not being declared as deprecated. 17335 17336 typedef int T1 __attribute__ ((deprecated)); 17337 T1 x; 17338 typedef T1 T2; 17339 T2 y; 17340 typedef T1 T3 __attribute__ ((deprecated)); 17341 T3 z __attribute__ ((deprecated)); 17342 17343 results in a warning on line 2 and 3 but not lines 4, 5, or 6. No 17344 warning is issued for line 4 because T2 is not explicitly 17345 deprecated. Line 5 has no warning because T3 is explicitly 17346 deprecated. Similarly for line 6. 17347 17348 The `deprecated' attribute can also be used for functions and 17349 variables (*note Function Attributes::, *note Variable 17350 Attributes::.) 17351 17352`may_alias' 17353 Accesses to objects with types with this attribute are not 17354 subjected to type-based alias analysis, but are instead assumed to 17355 be able to alias any other type of objects, just like the `char' 17356 type. See `-fstrict-aliasing' for more information on aliasing 17357 issues. 17358 17359 Example of use: 17360 17361 typedef short __attribute__((__may_alias__)) short_a; 17362 17363 int 17364 main (void) 17365 { 17366 int a = 0x12345678; 17367 short_a *b = (short_a *) &a; 17368 17369 b[1] = 0; 17370 17371 if (a == 0x12345678) 17372 abort(); 17373 17374 exit(0); 17375 } 17376 17377 If you replaced `short_a' with `short' in the variable 17378 declaration, the above program would abort when compiled with 17379 `-fstrict-aliasing', which is on by default at `-O2' or above in 17380 recent GCC versions. 17381 17382`visibility' 17383 In C++, attribute visibility (*note Function Attributes::) can 17384 also be applied to class, struct, union and enum types. Unlike 17385 other type attributes, the attribute must appear between the 17386 initial keyword and the name of the type; it cannot appear after 17387 the body of the type. 17388 17389 Note that the type visibility is applied to vague linkage entities 17390 associated with the class (vtable, typeinfo node, etc.). In 17391 particular, if a class is thrown as an exception in one shared 17392 object and caught in another, the class must have default 17393 visibility. Otherwise the two shared objects will be unable to 17394 use the same typeinfo node and exception handling will break. 17395 173965.33.1 ARM Type Attributes 17397-------------------------- 17398 17399 On those ARM targets that support `dllimport' (such as Symbian 17400OS), you can use the `notshared' attribute to indicate that the virtual 17401table and other similar data for a class should not be exported from a 17402DLL. For example: 17403 17404 class __declspec(notshared) C { 17405 public: 17406 __declspec(dllimport) C(); 17407 virtual void f(); 17408 } 17409 17410 __declspec(dllexport) 17411 C::C() {} 17412 17413 In this code, `C::C' is exported from the current DLL, but the 17414virtual table for `C' is not exported. (You can use `__attribute__' 17415instead of `__declspec' if you prefer, but most Symbian OS code uses 17416`__declspec'.) 17417 174185.33.2 i386 Type Attributes 17419--------------------------- 17420 17421 Two attributes are currently defined for i386 configurations: 17422`ms_struct' and `gcc_struct' 17423 17424`ms_struct' 17425`gcc_struct' 17426 If `packed' is used on a structure, or if bit-fields are used it 17427 may be that the Microsoft ABI packs them differently than GCC 17428 would normally pack them. Particularly when moving packed data 17429 between functions compiled with GCC and the native Microsoft 17430 compiler (either via function call or as data in a file), it may 17431 be necessary to access either format. 17432 17433 Currently `-m[no-]ms-bitfields' is provided for the Microsoft 17434 Windows X86 compilers to match the native Microsoft compiler. 17435 17436 To specify multiple attributes, separate them by commas within the 17437double parentheses: for example, `__attribute__ ((aligned (16), 17438packed))'. 17439 174405.33.3 PowerPC Type Attributes 17441------------------------------ 17442 17443Three attributes currently are defined for PowerPC configurations: 17444`altivec', `ms_struct' and `gcc_struct'. 17445 17446 For full documentation of the struct attributes please see the 17447documentation in the *Note i386 Type Attributes::, section. 17448 17449 The `altivec' attribute allows one to declare AltiVec vector data 17450types supported by the AltiVec Programming Interface Manual. The 17451attribute requires an argument to specify one of three vector types: 17452`vector__', `pixel__' (always followed by unsigned short), and `bool__' 17453(always followed by unsigned). 17454 17455 __attribute__((altivec(vector__))) 17456 __attribute__((altivec(pixel__))) unsigned short 17457 __attribute__((altivec(bool__))) unsigned 17458 17459 These attributes mainly are intended to support the `__vector', 17460`__pixel', and `__bool' AltiVec keywords. 17461 17462 17463File: gcc.info, Node: Inline, Next: Extended Asm, Prev: Alignment, Up: C Extensions 17464 174655.34 An Inline Function is As Fast As a Macro 17466============================================= 17467 17468By declaring a function `inline', you can direct GCC to integrate that 17469function's code into the code for its callers. This makes execution 17470faster by eliminating the function-call overhead; in addition, if any 17471of the actual argument values are constant, their known values may 17472permit simplifications at compile time so that not all of the inline 17473function's code needs to be included. The effect on code size is less 17474predictable; object code may be larger or smaller with function 17475inlining, depending on the particular case. Inlining of functions is an 17476optimization and it really "works" only in optimizing compilation. If 17477you don't use `-O', no function is really inline. 17478 17479 Inline functions are included in the ISO C99 standard, but there are 17480currently substantial differences between what GCC implements and what 17481the ISO C99 standard requires. GCC will fully support C99 inline 17482functions in version 4.3. The traditional GCC handling of inline 17483functions will still be available with `-std=gnu89', `-fgnu89-inline' 17484or when `gnu_inline' attribute is present on all inline declarations. 17485The preprocessor macros `__GNUC_GNU_INLINE__' and 17486`__GNUC_STDC_INLINE__' may be used to determine the handling of 17487`inline' during a particular compilation (*note Common Predefined 17488Macros: (cpp)Common Predefined Macros.). 17489 17490 To declare a function inline, use the `inline' keyword in its 17491declaration, like this: 17492 17493 inline int 17494 inc (int *a) 17495 { 17496 (*a)++; 17497 } 17498 17499 (If you are writing a header file to be included in ISO C programs, 17500write `__inline__' instead of `inline'. *Note Alternate Keywords::.) 17501You can also make all "simple enough" functions inline with the option 17502`-finline-functions'. 17503 17504 Note that certain usages in a function definition can make it 17505unsuitable for inline substitution. Among these usages are: use of 17506varargs, use of alloca, use of variable sized data types (*note 17507Variable Length::), use of computed goto (*note Labels as Values::), 17508use of nonlocal goto, and nested functions (*note Nested Functions::). 17509Using `-Winline' will warn when a function marked `inline' could not be 17510substituted, and will give the reason for the failure. 17511 17512 Note that in C and Objective-C, unlike C++, the `inline' keyword does 17513not affect the linkage of the function. 17514 17515 GCC automatically inlines member functions defined within the class 17516body of C++ programs even if they are not explicitly declared `inline'. 17517(You can override this with `-fno-default-inline'; *note Options 17518Controlling C++ Dialect: C++ Dialect Options.) 17519 17520 When a function is both inline and `static', if all calls to the 17521function are integrated into the caller, and the function's address is 17522never used, then the function's own assembler code is never referenced. 17523In this case, GCC does not actually output assembler code for the 17524function, unless you specify the option `-fkeep-inline-functions'. 17525Some calls cannot be integrated for various reasons (in particular, 17526calls that precede the function's definition cannot be integrated, and 17527neither can recursive calls within the definition). If there is a 17528nonintegrated call, then the function is compiled to assembler code as 17529usual. The function must also be compiled as usual if the program 17530refers to its address, because that can't be inlined. 17531 17532 When an inline function is not `static', then the compiler must assume 17533that there may be calls from other source files; since a global symbol 17534can be defined only once in any program, the function must not be 17535defined in the other source files, so the calls therein cannot be 17536integrated. Therefore, a non-`static' inline function is always 17537compiled on its own in the usual fashion. 17538 17539 If you specify both `inline' and `extern' in the function definition, 17540then the definition is used only for inlining. In no case is the 17541function compiled on its own, not even if you refer to its address 17542explicitly. Such an address becomes an external reference, as if you 17543had only declared the function, and had not defined it. 17544 17545 This combination of `inline' and `extern' has almost the effect of a 17546macro. The way to use it is to put a function definition in a header 17547file with these keywords, and put another copy of the definition 17548(lacking `inline' and `extern') in a library file. The definition in 17549the header file will cause most calls to the function to be inlined. 17550If any uses of the function remain, they will refer to the single copy 17551in the library. 17552 17553 Since GCC 4.3 will implement ISO C99 semantics for inline functions, 17554it is simplest to use `static inline' only to guarantee compatibility. 17555(The existing semantics will remain available when `-std=gnu89' is 17556specified, but eventually the default will be `-std=gnu99'; that will 17557implement the C99 semantics, though it does not do so in versions of 17558GCC before 4.3. After the default changes, the existing semantics will 17559still be available via the `-fgnu89-inline' option or the `gnu_inline' 17560function attribute.) 17561 17562 GCC does not inline any functions when not optimizing unless you 17563specify the `always_inline' attribute for the function, like this: 17564 17565 /* Prototype. */ 17566 inline void foo (const char) __attribute__((always_inline)); 17567 17568 17569File: gcc.info, Node: Extended Asm, Next: Constraints, Prev: Inline, Up: C Extensions 17570 175715.35 Assembler Instructions with C Expression Operands 17572====================================================== 17573 17574In an assembler instruction using `asm', you can specify the operands 17575of the instruction using C expressions. This means you need not guess 17576which registers or memory locations will contain the data you want to 17577use. 17578 17579 You must specify an assembler instruction template much like what 17580appears in a machine description, plus an operand constraint string for 17581each operand. 17582 17583 For example, here is how to use the 68881's `fsinx' instruction: 17584 17585 asm ("fsinx %1,%0" : "=f" (result) : "f" (angle)); 17586 17587Here `angle' is the C expression for the input operand while `result' 17588is that of the output operand. Each has `"f"' as its operand 17589constraint, saying that a floating point register is required. The `=' 17590in `=f' indicates that the operand is an output; all output operands' 17591constraints must use `='. The constraints use the same language used 17592in the machine description (*note Constraints::). 17593 17594 Each operand is described by an operand-constraint string followed by 17595the C expression in parentheses. A colon separates the assembler 17596template from the first output operand and another separates the last 17597output operand from the first input, if any. Commas separate the 17598operands within each group. The total number of operands is currently 17599limited to 30; this limitation may be lifted in some future version of 17600GCC. 17601 17602 If there are no output operands but there are input operands, you must 17603place two consecutive colons surrounding the place where the output 17604operands would go. 17605 17606 As of GCC version 3.1, it is also possible to specify input and output 17607operands using symbolic names which can be referenced within the 17608assembler code. These names are specified inside square brackets 17609preceding the constraint string, and can be referenced inside the 17610assembler code using `%[NAME]' instead of a percentage sign followed by 17611the operand number. Using named operands the above example could look 17612like: 17613 17614 asm ("fsinx %[angle],%[output]" 17615 : [output] "=f" (result) 17616 : [angle] "f" (angle)); 17617 17618Note that the symbolic operand names have no relation whatsoever to 17619other C identifiers. You may use any name you like, even those of 17620existing C symbols, but you must ensure that no two operands within the 17621same assembler construct use the same symbolic name. 17622 17623 Output operand expressions must be lvalues; the compiler can check 17624this. The input operands need not be lvalues. The compiler cannot 17625check whether the operands have data types that are reasonable for the 17626instruction being executed. It does not parse the assembler instruction 17627template and does not know what it means or even whether it is valid 17628assembler input. The extended `asm' feature is most often used for 17629machine instructions the compiler itself does not know exist. If the 17630output expression cannot be directly addressed (for example, it is a 17631bit-field), your constraint must allow a register. In that case, GCC 17632will use the register as the output of the `asm', and then store that 17633register into the output. 17634 17635 The ordinary output operands must be write-only; GCC will assume that 17636the values in these operands before the instruction are dead and need 17637not be generated. Extended asm supports input-output or read-write 17638operands. Use the constraint character `+' to indicate such an operand 17639and list it with the output operands. You should only use read-write 17640operands when the constraints for the operand (or the operand in which 17641only some of the bits are to be changed) allow a register. 17642 17643 You may, as an alternative, logically split its function into two 17644separate operands, one input operand and one write-only output operand. 17645The connection between them is expressed by constraints which say they 17646need to be in the same location when the instruction executes. You can 17647use the same C expression for both operands, or different expressions. 17648For example, here we write the (fictitious) `combine' instruction with 17649`bar' as its read-only source operand and `foo' as its read-write 17650destination: 17651 17652 asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar)); 17653 17654The constraint `"0"' for operand 1 says that it must occupy the same 17655location as operand 0. A number in constraint is allowed only in an 17656input operand and it must refer to an output operand. 17657 17658 Only a number in the constraint can guarantee that one operand will be 17659in the same place as another. The mere fact that `foo' is the value of 17660both operands is not enough to guarantee that they will be in the same 17661place in the generated assembler code. The following would not work 17662reliably: 17663 17664 asm ("combine %2,%0" : "=r" (foo) : "r" (foo), "g" (bar)); 17665 17666 Various optimizations or reloading could cause operands 0 and 1 to be 17667in different registers; GCC knows no reason not to do so. For example, 17668the compiler might find a copy of the value of `foo' in one register and 17669use it for operand 1, but generate the output operand 0 in a different 17670register (copying it afterward to `foo''s own address). Of course, 17671since the register for operand 1 is not even mentioned in the assembler 17672code, the result will not work, but GCC can't tell that. 17673 17674 As of GCC version 3.1, one may write `[NAME]' instead of the operand 17675number for a matching constraint. For example: 17676 17677 asm ("cmoveq %1,%2,%[result]" 17678 : [result] "=r"(result) 17679 : "r" (test), "r"(new), "[result]"(old)); 17680 17681 Sometimes you need to make an `asm' operand be a specific register, 17682but there's no matching constraint letter for that register _by 17683itself_. To force the operand into that register, use a local variable 17684for the operand and specify the register in the variable declaration. 17685*Note Explicit Reg Vars::. Then for the `asm' operand, use any 17686register constraint letter that matches the register: 17687 17688 register int *p1 asm ("r0") = ...; 17689 register int *p2 asm ("r1") = ...; 17690 register int *result asm ("r0"); 17691 asm ("sysint" : "=r" (result) : "0" (p1), "r" (p2)); 17692 17693 In the above example, beware that a register that is call-clobbered by 17694the target ABI will be overwritten by any function call in the 17695assignment, including library calls for arithmetic operators. Assuming 17696it is a call-clobbered register, this may happen to `r0' above by the 17697assignment to `p2'. If you have to use such a register, use temporary 17698variables for expressions between the register assignment and use: 17699 17700 int t1 = ...; 17701 register int *p1 asm ("r0") = ...; 17702 register int *p2 asm ("r1") = t1; 17703 register int *result asm ("r0"); 17704 asm ("sysint" : "=r" (result) : "0" (p1), "r" (p2)); 17705 17706 Some instructions clobber specific hard registers. To describe this, 17707write a third colon after the input operands, followed by the names of 17708the clobbered hard registers (given as strings). Here is a realistic 17709example for the VAX: 17710 17711 asm volatile ("movc3 %0,%1,%2" 17712 : /* no outputs */ 17713 : "g" (from), "g" (to), "g" (count) 17714 : "r0", "r1", "r2", "r3", "r4", "r5"); 17715 17716 You may not write a clobber description in a way that overlaps with an 17717input or output operand. For example, you may not have an operand 17718describing a register class with one member if you mention that register 17719in the clobber list. Variables declared to live in specific registers 17720(*note Explicit Reg Vars::), and used as asm input or output operands 17721must have no part mentioned in the clobber description. There is no 17722way for you to specify that an input operand is modified without also 17723specifying it as an output operand. Note that if all the output 17724operands you specify are for this purpose (and hence unused), you will 17725then also need to specify `volatile' for the `asm' construct, as 17726described below, to prevent GCC from deleting the `asm' statement as 17727unused. 17728 17729 If you refer to a particular hardware register from the assembler code, 17730you will probably have to list the register after the third colon to 17731tell the compiler the register's value is modified. In some assemblers, 17732the register names begin with `%'; to produce one `%' in the assembler 17733code, you must write `%%' in the input. 17734 17735 If your assembler instruction can alter the condition code register, 17736add `cc' to the list of clobbered registers. GCC on some machines 17737represents the condition codes as a specific hardware register; `cc' 17738serves to name this register. On other machines, the condition code is 17739handled differently, and specifying `cc' has no effect. But it is 17740valid no matter what the machine. 17741 17742 If your assembler instructions access memory in an unpredictable 17743fashion, add `memory' to the list of clobbered registers. This will 17744cause GCC to not keep memory values cached in registers across the 17745assembler instruction and not optimize stores or loads to that memory. 17746You will also want to add the `volatile' keyword if the memory affected 17747is not listed in the inputs or outputs of the `asm', as the `memory' 17748clobber does not count as a side-effect of the `asm'. If you know how 17749large the accessed memory is, you can add it as input or output but if 17750this is not known, you should add `memory'. As an example, if you 17751access ten bytes of a string, you can use a memory input like: 17752 17753 {"m"( ({ struct { char x[10]; } *p = (void *)ptr ; *p; }) )}. 17754 17755 Note that in the following example the memory input is necessary, 17756otherwise GCC might optimize the store to `x' away: 17757 int foo () 17758 { 17759 int x = 42; 17760 int *y = &x; 17761 int result; 17762 asm ("magic stuff accessing an 'int' pointed to by '%1'" 17763 "=&d" (r) : "a" (y), "m" (*y)); 17764 return result; 17765 } 17766 17767 You can put multiple assembler instructions together in a single `asm' 17768template, separated by the characters normally used in assembly code 17769for the system. A combination that works in most places is a newline 17770to break the line, plus a tab character to move to the instruction field 17771(written as `\n\t'). Sometimes semicolons can be used, if the 17772assembler allows semicolons as a line-breaking character. Note that 17773some assembler dialects use semicolons to start a comment. The input 17774operands are guaranteed not to use any of the clobbered registers, and 17775neither will the output operands' addresses, so you can read and write 17776the clobbered registers as many times as you like. Here is an example 17777of multiple instructions in a template; it assumes the subroutine 17778`_foo' accepts arguments in registers 9 and 10: 17779 17780 asm ("movl %0,r9\n\tmovl %1,r10\n\tcall _foo" 17781 : /* no outputs */ 17782 : "g" (from), "g" (to) 17783 : "r9", "r10"); 17784 17785 Unless an output operand has the `&' constraint modifier, GCC may 17786allocate it in the same register as an unrelated input operand, on the 17787assumption the inputs are consumed before the outputs are produced. 17788This assumption may be false if the assembler code actually consists of 17789more than one instruction. In such a case, use `&' for each output 17790operand that may not overlap an input. *Note Modifiers::. 17791 17792 If you want to test the condition code produced by an assembler 17793instruction, you must include a branch and a label in the `asm' 17794construct, as follows: 17795 17796 asm ("clr %0\n\tfrob %1\n\tbeq 0f\n\tmov #1,%0\n0:" 17797 : "g" (result) 17798 : "g" (input)); 17799 17800This assumes your assembler supports local labels, as the GNU assembler 17801and most Unix assemblers do. 17802 17803 Speaking of labels, jumps from one `asm' to another are not supported. 17804The compiler's optimizers do not know about these jumps, and therefore 17805they cannot take account of them when deciding how to optimize. 17806 17807 Usually the most convenient way to use these `asm' instructions is to 17808encapsulate them in macros that look like functions. For example, 17809 17810 #define sin(x) \ 17811 ({ double __value, __arg = (x); \ 17812 asm ("fsinx %1,%0": "=f" (__value): "f" (__arg)); \ 17813 __value; }) 17814 17815Here the variable `__arg' is used to make sure that the instruction 17816operates on a proper `double' value, and to accept only those arguments 17817`x' which can convert automatically to a `double'. 17818 17819 Another way to make sure the instruction operates on the correct data 17820type is to use a cast in the `asm'. This is different from using a 17821variable `__arg' in that it converts more different types. For 17822example, if the desired type were `int', casting the argument to `int' 17823would accept a pointer with no complaint, while assigning the argument 17824to an `int' variable named `__arg' would warn about using a pointer 17825unless the caller explicitly casts it. 17826 17827 If an `asm' has output operands, GCC assumes for optimization purposes 17828the instruction has no side effects except to change the output 17829operands. This does not mean instructions with a side effect cannot be 17830used, but you must be careful, because the compiler may eliminate them 17831if the output operands aren't used, or move them out of loops, or 17832replace two with one if they constitute a common subexpression. Also, 17833if your instruction does have a side effect on a variable that otherwise 17834appears not to change, the old value of the variable may be reused later 17835if it happens to be found in a register. 17836 17837 You can prevent an `asm' instruction from being deleted by writing the 17838keyword `volatile' after the `asm'. For example: 17839 17840 #define get_and_set_priority(new) \ 17841 ({ int __old; \ 17842 asm volatile ("get_and_set_priority %0, %1" \ 17843 : "=g" (__old) : "g" (new)); \ 17844 __old; }) 17845 17846The `volatile' keyword indicates that the instruction has important 17847side-effects. GCC will not delete a volatile `asm' if it is reachable. 17848(The instruction can still be deleted if GCC can prove that 17849control-flow will never reach the location of the instruction.) Note 17850that even a volatile `asm' instruction can be moved relative to other 17851code, including across jump instructions. For example, on many targets 17852there is a system register which can be set to control the rounding 17853mode of floating point operations. You might try setting it with a 17854volatile `asm', like this PowerPC example: 17855 17856 asm volatile("mtfsf 255,%0" : : "f" (fpenv)); 17857 sum = x + y; 17858 17859This will not work reliably, as the compiler may move the addition back 17860before the volatile `asm'. To make it work you need to add an 17861artificial dependency to the `asm' referencing a variable in the code 17862you don't want moved, for example: 17863 17864 asm volatile ("mtfsf 255,%1" : "=X"(sum): "f"(fpenv)); 17865 sum = x + y; 17866 17867 Similarly, you can't expect a sequence of volatile `asm' instructions 17868to remain perfectly consecutive. If you want consecutive output, use a 17869single `asm'. Also, GCC will perform some optimizations across a 17870volatile `asm' instruction; GCC does not "forget everything" when it 17871encounters a volatile `asm' instruction the way some other compilers do. 17872 17873 An `asm' instruction without any output operands will be treated 17874identically to a volatile `asm' instruction. 17875 17876 It is a natural idea to look for a way to give access to the condition 17877code left by the assembler instruction. However, when we attempted to 17878implement this, we found no way to make it work reliably. The problem 17879is that output operands might need reloading, which would result in 17880additional following "store" instructions. On most machines, these 17881instructions would alter the condition code before there was time to 17882test it. This problem doesn't arise for ordinary "test" and "compare" 17883instructions because they don't have any output operands. 17884 17885 For reasons similar to those described above, it is not possible to 17886give an assembler instruction access to the condition code left by 17887previous instructions. 17888 17889 If you are writing a header file that should be includable in ISO C 17890programs, write `__asm__' instead of `asm'. *Note Alternate Keywords::. 17891 178925.35.1 Size of an `asm' 17893----------------------- 17894 17895Some targets require that GCC track the size of each instruction used in 17896order to generate correct code. Because the final length of an `asm' 17897is only known by the assembler, GCC must make an estimate as to how big 17898it will be. The estimate is formed by counting the number of 17899statements in the pattern of the `asm' and multiplying that by the 17900length of the longest instruction on that processor. Statements in the 17901`asm' are identified by newline characters and whatever statement 17902separator characters are supported by the assembler; on most processors 17903this is the ``;'' character. 17904 17905 Normally, GCC's estimate is perfectly adequate to ensure that correct 17906code is generated, but it is possible to confuse the compiler if you use 17907pseudo instructions or assembler macros that expand into multiple real 17908instructions or if you use assembler directives that expand to more 17909space in the object file than would be needed for a single instruction. 17910If this happens then the assembler will produce a diagnostic saying that 17911a label is unreachable. 17912 179135.35.2 i386 floating point asm operands 17914--------------------------------------- 17915 17916There are several rules on the usage of stack-like regs in asm_operands 17917insns. These rules apply only to the operands that are stack-like regs: 17918 17919 1. Given a set of input regs that die in an asm_operands, it is 17920 necessary to know which are implicitly popped by the asm, and 17921 which must be explicitly popped by gcc. 17922 17923 An input reg that is implicitly popped by the asm must be 17924 explicitly clobbered, unless it is constrained to match an output 17925 operand. 17926 17927 2. For any input reg that is implicitly popped by an asm, it is 17928 necessary to know how to adjust the stack to compensate for the 17929 pop. If any non-popped input is closer to the top of the 17930 reg-stack than the implicitly popped reg, it would not be possible 17931 to know what the stack looked like--it's not clear how the rest of 17932 the stack "slides up". 17933 17934 All implicitly popped input regs must be closer to the top of the 17935 reg-stack than any input that is not implicitly popped. 17936 17937 It is possible that if an input dies in an insn, reload might use 17938 the input reg for an output reload. Consider this example: 17939 17940 asm ("foo" : "=t" (a) : "f" (b)); 17941 17942 This asm says that input B is not popped by the asm, and that the 17943 asm pushes a result onto the reg-stack, i.e., the stack is one 17944 deeper after the asm than it was before. But, it is possible that 17945 reload will think that it can use the same reg for both the input 17946 and the output, if input B dies in this insn. 17947 17948 If any input operand uses the `f' constraint, all output reg 17949 constraints must use the `&' earlyclobber. 17950 17951 The asm above would be written as 17952 17953 asm ("foo" : "=&t" (a) : "f" (b)); 17954 17955 3. Some operands need to be in particular places on the stack. All 17956 output operands fall in this category--there is no other way to 17957 know which regs the outputs appear in unless the user indicates 17958 this in the constraints. 17959 17960 Output operands must specifically indicate which reg an output 17961 appears in after an asm. `=f' is not allowed: the operand 17962 constraints must select a class with a single reg. 17963 17964 4. Output operands may not be "inserted" between existing stack regs. 17965 Since no 387 opcode uses a read/write operand, all output operands 17966 are dead before the asm_operands, and are pushed by the 17967 asm_operands. It makes no sense to push anywhere but the top of 17968 the reg-stack. 17969 17970 Output operands must start at the top of the reg-stack: output 17971 operands may not "skip" a reg. 17972 17973 5. Some asm statements may need extra stack space for internal 17974 calculations. This can be guaranteed by clobbering stack registers 17975 unrelated to the inputs and outputs. 17976 17977 17978 Here are a couple of reasonable asms to want to write. This asm takes 17979one input, which is internally popped, and produces two outputs. 17980 17981 asm ("fsincos" : "=t" (cos), "=u" (sin) : "0" (inp)); 17982 17983 This asm takes two inputs, which are popped by the `fyl2xp1' opcode, 17984and replaces them with one output. The user must code the `st(1)' 17985clobber for reg-stack.c to know that `fyl2xp1' pops both inputs. 17986 17987 asm ("fyl2xp1" : "=t" (result) : "0" (x), "u" (y) : "st(1)"); 17988 17989 17990File: gcc.info, Node: Constraints, Next: Asm Labels, Prev: Extended Asm, Up: C Extensions 17991 179925.36 Constraints for `asm' Operands 17993=================================== 17994 17995Here are specific details on what constraint letters you can use with 17996`asm' operands. Constraints can say whether an operand may be in a 17997register, and which kinds of register; whether the operand can be a 17998memory reference, and which kinds of address; whether the operand may 17999be an immediate constant, and which possible values it may have. 18000Constraints can also require two operands to match. 18001 18002* Menu: 18003 18004* Simple Constraints:: Basic use of constraints. 18005* Multi-Alternative:: When an insn has two alternative constraint-patterns. 18006* Modifiers:: More precise control over effects of constraints. 18007* Machine Constraints:: Special constraints for some particular machines. 18008 18009 18010File: gcc.info, Node: Simple Constraints, Next: Multi-Alternative, Up: Constraints 18011 180125.36.1 Simple Constraints 18013------------------------- 18014 18015The simplest kind of constraint is a string full of letters, each of 18016which describes one kind of operand that is permitted. Here are the 18017letters that are allowed: 18018 18019whitespace 18020 Whitespace characters are ignored and can be inserted at any 18021 position except the first. This enables each alternative for 18022 different operands to be visually aligned in the machine 18023 description even if they have different number of constraints and 18024 modifiers. 18025 18026`m' 18027 A memory operand is allowed, with any kind of address that the 18028 machine supports in general. 18029 18030`o' 18031 A memory operand is allowed, but only if the address is 18032 "offsettable". This means that adding a small integer (actually, 18033 the width in bytes of the operand, as determined by its machine 18034 mode) may be added to the address and the result is also a valid 18035 memory address. 18036 18037 For example, an address which is constant is offsettable; so is an 18038 address that is the sum of a register and a constant (as long as a 18039 slightly larger constant is also within the range of 18040 address-offsets supported by the machine); but an autoincrement or 18041 autodecrement address is not offsettable. More complicated 18042 indirect/indexed addresses may or may not be offsettable depending 18043 on the other addressing modes that the machine supports. 18044 18045 Note that in an output operand which can be matched by another 18046 operand, the constraint letter `o' is valid only when accompanied 18047 by both `<' (if the target machine has predecrement addressing) 18048 and `>' (if the target machine has preincrement addressing). 18049 18050`V' 18051 A memory operand that is not offsettable. In other words, 18052 anything that would fit the `m' constraint but not the `o' 18053 constraint. 18054 18055`<' 18056 A memory operand with autodecrement addressing (either 18057 predecrement or postdecrement) is allowed. 18058 18059`>' 18060 A memory operand with autoincrement addressing (either 18061 preincrement or postincrement) is allowed. 18062 18063`r' 18064 A register operand is allowed provided that it is in a general 18065 register. 18066 18067`i' 18068 An immediate integer operand (one with constant value) is allowed. 18069 This includes symbolic constants whose values will be known only at 18070 assembly time or later. 18071 18072`n' 18073 An immediate integer operand with a known numeric value is allowed. 18074 Many systems cannot support assembly-time constants for operands 18075 less than a word wide. Constraints for these operands should use 18076 `n' rather than `i'. 18077 18078`I', `J', `K', ... `P' 18079 Other letters in the range `I' through `P' may be defined in a 18080 machine-dependent fashion to permit immediate integer operands with 18081 explicit integer values in specified ranges. For example, on the 18082 68000, `I' is defined to stand for the range of values 1 to 8. 18083 This is the range permitted as a shift count in the shift 18084 instructions. 18085 18086`E' 18087 An immediate floating operand (expression code `const_double') is 18088 allowed, but only if the target floating point format is the same 18089 as that of the host machine (on which the compiler is running). 18090 18091`F' 18092 An immediate floating operand (expression code `const_double' or 18093 `const_vector') is allowed. 18094 18095`G', `H' 18096 `G' and `H' may be defined in a machine-dependent fashion to 18097 permit immediate floating operands in particular ranges of values. 18098 18099`s' 18100 An immediate integer operand whose value is not an explicit 18101 integer is allowed. 18102 18103 This might appear strange; if an insn allows a constant operand 18104 with a value not known at compile time, it certainly must allow 18105 any known value. So why use `s' instead of `i'? Sometimes it 18106 allows better code to be generated. 18107 18108 For example, on the 68000 in a fullword instruction it is possible 18109 to use an immediate operand; but if the immediate value is between 18110 -128 and 127, better code results from loading the value into a 18111 register and using the register. This is because the load into 18112 the register can be done with a `moveq' instruction. We arrange 18113 for this to happen by defining the letter `K' to mean "any integer 18114 outside the range -128 to 127", and then specifying `Ks' in the 18115 operand constraints. 18116 18117`g' 18118 Any register, memory or immediate integer operand is allowed, 18119 except for registers that are not general registers. 18120 18121`X' 18122 Any operand whatsoever is allowed. 18123 18124`0', `1', `2', ... `9' 18125 An operand that matches the specified operand number is allowed. 18126 If a digit is used together with letters within the same 18127 alternative, the digit should come last. 18128 18129 This number is allowed to be more than a single digit. If multiple 18130 digits are encountered consecutively, they are interpreted as a 18131 single decimal integer. There is scant chance for ambiguity, 18132 since to-date it has never been desirable that `10' be interpreted 18133 as matching either operand 1 _or_ operand 0. Should this be 18134 desired, one can use multiple alternatives instead. 18135 18136 This is called a "matching constraint" and what it really means is 18137 that the assembler has only a single operand that fills two roles 18138 which `asm' distinguishes. For example, an add instruction uses 18139 two input operands and an output operand, but on most CISC 18140 machines an add instruction really has only two operands, one of 18141 them an input-output operand: 18142 18143 addl #35,r12 18144 18145 Matching constraints are used in these circumstances. More 18146 precisely, the two operands that match must include one input-only 18147 operand and one output-only operand. Moreover, the digit must be a 18148 smaller number than the number of the operand that uses it in the 18149 constraint. 18150 18151`p' 18152 An operand that is a valid memory address is allowed. This is for 18153 "load address" and "push address" instructions. 18154 18155 `p' in the constraint must be accompanied by `address_operand' as 18156 the predicate in the `match_operand'. This predicate interprets 18157 the mode specified in the `match_operand' as the mode of the memory 18158 reference for which the address would be valid. 18159 18160OTHER-LETTERS 18161 Other letters can be defined in machine-dependent fashion to stand 18162 for particular classes of registers or other arbitrary operand 18163 types. `d', `a' and `f' are defined on the 68000/68020 to stand 18164 for data, address and floating point registers. 18165 18166 18167File: gcc.info, Node: Multi-Alternative, Next: Modifiers, Prev: Simple Constraints, Up: Constraints 18168 181695.36.2 Multiple Alternative Constraints 18170--------------------------------------- 18171 18172Sometimes a single instruction has multiple alternative sets of possible 18173operands. For example, on the 68000, a logical-or instruction can 18174combine register or an immediate value into memory, or it can combine 18175any kind of operand into a register; but it cannot combine one memory 18176location into another. 18177 18178 These constraints are represented as multiple alternatives. An 18179alternative can be described by a series of letters for each operand. 18180The overall constraint for an operand is made from the letters for this 18181operand from the first alternative, a comma, the letters for this 18182operand from the second alternative, a comma, and so on until the last 18183alternative. 18184 18185 If all the operands fit any one alternative, the instruction is valid. 18186Otherwise, for each alternative, the compiler counts how many 18187instructions must be added to copy the operands so that that 18188alternative applies. The alternative requiring the least copying is 18189chosen. If two alternatives need the same amount of copying, the one 18190that comes first is chosen. These choices can be altered with the `?' 18191and `!' characters: 18192 18193`?' 18194 Disparage slightly the alternative that the `?' appears in, as a 18195 choice when no alternative applies exactly. The compiler regards 18196 this alternative as one unit more costly for each `?' that appears 18197 in it. 18198 18199`!' 18200 Disparage severely the alternative that the `!' appears in. This 18201 alternative can still be used if it fits without reloading, but if 18202 reloading is needed, some other alternative will be used. 18203 18204 18205File: gcc.info, Node: Modifiers, Next: Machine Constraints, Prev: Multi-Alternative, Up: Constraints 18206 182075.36.3 Constraint Modifier Characters 18208------------------------------------- 18209 18210Here are constraint modifier characters. 18211 18212`=' 18213 Means that this operand is write-only for this instruction: the 18214 previous value is discarded and replaced by output data. 18215 18216`+' 18217 Means that this operand is both read and written by the 18218 instruction. 18219 18220 When the compiler fixes up the operands to satisfy the constraints, 18221 it needs to know which operands are inputs to the instruction and 18222 which are outputs from it. `=' identifies an output; `+' 18223 identifies an operand that is both input and output; all other 18224 operands are assumed to be input only. 18225 18226 If you specify `=' or `+' in a constraint, you put it in the first 18227 character of the constraint string. 18228 18229`&' 18230 Means (in a particular alternative) that this operand is an 18231 "earlyclobber" operand, which is modified before the instruction is 18232 finished using the input operands. Therefore, this operand may 18233 not lie in a register that is used as an input operand or as part 18234 of any memory address. 18235 18236 `&' applies only to the alternative in which it is written. In 18237 constraints with multiple alternatives, sometimes one alternative 18238 requires `&' while others do not. See, for example, the `movdf' 18239 insn of the 68000. 18240 18241 An input operand can be tied to an earlyclobber operand if its only 18242 use as an input occurs before the early result is written. Adding 18243 alternatives of this form often allows GCC to produce better code 18244 when only some of the inputs can be affected by the earlyclobber. 18245 See, for example, the `mulsi3' insn of the ARM. 18246 18247 `&' does not obviate the need to write `='. 18248 18249`%' 18250 Declares the instruction to be commutative for this operand and the 18251 following operand. This means that the compiler may interchange 18252 the two operands if that is the cheapest way to make all operands 18253 fit the constraints. GCC can only handle one commutative pair in 18254 an asm; if you use more, the compiler may fail. Note that you 18255 need not use the modifier if the two alternatives are strictly 18256 identical; this would only waste time in the reload pass. The 18257 modifier is not operational after register allocation, so the 18258 result of `define_peephole2' and `define_split's performed after 18259 reload cannot rely on `%' to make the intended insn match. 18260 18261`#' 18262 Says that all following characters, up to the next comma, are to be 18263 ignored as a constraint. They are significant only for choosing 18264 register preferences. 18265 18266`*' 18267 Says that the following character should be ignored when choosing 18268 register preferences. `*' has no effect on the meaning of the 18269 constraint as a constraint, and no effect on reloading. 18270 18271 18272 18273File: gcc.info, Node: Machine Constraints, Prev: Modifiers, Up: Constraints 18274 182755.36.4 Constraints for Particular Machines 18276------------------------------------------ 18277 18278Whenever possible, you should use the general-purpose constraint letters 18279in `asm' arguments, since they will convey meaning more readily to 18280people reading your code. Failing that, use the constraint letters 18281that usually have very similar meanings across architectures. The most 18282commonly used constraints are `m' and `r' (for memory and 18283general-purpose registers respectively; *note Simple Constraints::), and 18284`I', usually the letter indicating the most common immediate-constant 18285format. 18286 18287 Each architecture defines additional constraints. These constraints 18288are used by the compiler itself for instruction generation, as well as 18289for `asm' statements; therefore, some of the constraints are not 18290particularly useful for `asm'. Here is a summary of some of the 18291machine-dependent constraints available on some particular machines; it 18292includes both constraints that are useful for `asm' and constraints 18293that aren't. The compiler source file mentioned in the table heading 18294for each architecture is the definitive reference for the meanings of 18295that architecture's constraints. 18296 18297_ARM family--`config/arm/arm.h'_ 18298 18299 `f' 18300 Floating-point register 18301 18302 `w' 18303 VFP floating-point register 18304 18305 `F' 18306 One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0, 18307 4.0, 5.0 or 10.0 18308 18309 `G' 18310 Floating-point constant that would satisfy the constraint `F' 18311 if it were negated 18312 18313 `I' 18314 Integer that is valid as an immediate operand in a data 18315 processing instruction. That is, an integer in the range 0 18316 to 255 rotated by a multiple of 2 18317 18318 `J' 18319 Integer in the range -4095 to 4095 18320 18321 `K' 18322 Integer that satisfies constraint `I' when inverted (ones 18323 complement) 18324 18325 `L' 18326 Integer that satisfies constraint `I' when negated (twos 18327 complement) 18328 18329 `M' 18330 Integer in the range 0 to 32 18331 18332 `Q' 18333 A memory reference where the exact address is in a single 18334 register (``m'' is preferable for `asm' statements) 18335 18336 `R' 18337 An item in the constant pool 18338 18339 `S' 18340 A symbol in the text segment of the current file 18341 18342 `Uv' 18343 A memory reference suitable for VFP load/store insns 18344 (reg+constant offset) 18345 18346 `Uy' 18347 A memory reference suitable for iWMMXt load/store 18348 instructions. 18349 18350 `Uq' 18351 A memory reference suitable for the ARMv4 ldrsb instruction. 18352 18353_AVR family--`config/avr/constraints.md'_ 18354 18355 `l' 18356 Registers from r0 to r15 18357 18358 `a' 18359 Registers from r16 to r23 18360 18361 `d' 18362 Registers from r16 to r31 18363 18364 `w' 18365 Registers from r24 to r31. These registers can be used in 18366 `adiw' command 18367 18368 `e' 18369 Pointer register (r26-r31) 18370 18371 `b' 18372 Base pointer register (r28-r31) 18373 18374 `q' 18375 Stack pointer register (SPH:SPL) 18376 18377 `t' 18378 Temporary register r0 18379 18380 `x' 18381 Register pair X (r27:r26) 18382 18383 `y' 18384 Register pair Y (r29:r28) 18385 18386 `z' 18387 Register pair Z (r31:r30) 18388 18389 `I' 18390 Constant greater than -1, less than 64 18391 18392 `J' 18393 Constant greater than -64, less than 1 18394 18395 `K' 18396 Constant integer 2 18397 18398 `L' 18399 Constant integer 0 18400 18401 `M' 18402 Constant that fits in 8 bits 18403 18404 `N' 18405 Constant integer -1 18406 18407 `O' 18408 Constant integer 8, 16, or 24 18409 18410 `P' 18411 Constant integer 1 18412 18413 `G' 18414 A floating point constant 0.0 18415 18416_CRX Architecture--`config/crx/crx.h'_ 18417 18418 `b' 18419 Registers from r0 to r14 (registers without stack pointer) 18420 18421 `l' 18422 Register r16 (64-bit accumulator lo register) 18423 18424 `h' 18425 Register r17 (64-bit accumulator hi register) 18426 18427 `k' 18428 Register pair r16-r17. (64-bit accumulator lo-hi pair) 18429 18430 `I' 18431 Constant that fits in 3 bits 18432 18433 `J' 18434 Constant that fits in 4 bits 18435 18436 `K' 18437 Constant that fits in 5 bits 18438 18439 `L' 18440 Constant that is one of -1, 4, -4, 7, 8, 12, 16, 20, 32, 48 18441 18442 `G' 18443 Floating point constant that is legal for store immediate 18444 18445_PowerPC and IBM RS6000--`config/rs6000/rs6000.h'_ 18446 18447 `b' 18448 Address base register 18449 18450 `f' 18451 Floating point register 18452 18453 `v' 18454 Vector register 18455 18456 `h' 18457 `MQ', `CTR', or `LINK' register 18458 18459 `q' 18460 `MQ' register 18461 18462 `c' 18463 `CTR' register 18464 18465 `l' 18466 `LINK' register 18467 18468 `x' 18469 `CR' register (condition register) number 0 18470 18471 `y' 18472 `CR' register (condition register) 18473 18474 `z' 18475 `FPMEM' stack memory for FPR-GPR transfers 18476 18477 `I' 18478 Signed 16-bit constant 18479 18480 `J' 18481 Unsigned 16-bit constant shifted left 16 bits (use `L' 18482 instead for `SImode' constants) 18483 18484 `K' 18485 Unsigned 16-bit constant 18486 18487 `L' 18488 Signed 16-bit constant shifted left 16 bits 18489 18490 `M' 18491 Constant larger than 31 18492 18493 `N' 18494 Exact power of 2 18495 18496 `O' 18497 Zero 18498 18499 `P' 18500 Constant whose negation is a signed 16-bit constant 18501 18502 `G' 18503 Floating point constant that can be loaded into a register 18504 with one instruction per word 18505 18506 `Q' 18507 Memory operand that is an offset from a register (`m' is 18508 preferable for `asm' statements) 18509 18510 `R' 18511 AIX TOC entry 18512 18513 `S' 18514 Constant suitable as a 64-bit mask operand 18515 18516 `T' 18517 Constant suitable as a 32-bit mask operand 18518 18519 `U' 18520 System V Release 4 small data area reference 18521 18522_MorphoTech family--`config/mt/mt.h'_ 18523 18524 `I' 18525 Constant for an arithmetic insn (16-bit signed integer). 18526 18527 `J' 18528 The constant 0. 18529 18530 `K' 18531 Constant for a logical insn (16-bit zero-extended integer). 18532 18533 `L' 18534 A constant that can be loaded with `lui' (i.e. the bottom 16 18535 bits are zero). 18536 18537 `M' 18538 A constant that takes two words to load (i.e. not matched by 18539 `I', `K', or `L'). 18540 18541 `N' 18542 Negative 16-bit constants other than -65536. 18543 18544 `O' 18545 A 15-bit signed integer constant. 18546 18547 `P' 18548 A positive 16-bit constant. 18549 18550_Intel 386--`config/i386/constraints.md'_ 18551 18552 `R' 18553 Legacy register--the eight integer registers available on all 18554 i386 processors (`a', `b', `c', `d', `si', `di', `bp', `sp'). 18555 18556 `q' 18557 Any register accessible as `Rl'. In 32-bit mode, `a', `b', 18558 `c', and `d'; in 64-bit mode, any integer register. 18559 18560 `Q' 18561 Any register accessible as `Rh': `a', `b', `c', and `d'. 18562 18563 `a' 18564 The `a' register. 18565 18566 `b' 18567 The `b' register. 18568 18569 `c' 18570 The `c' register. 18571 18572 `d' 18573 The `d' register. 18574 18575 `S' 18576 The `si' register. 18577 18578 `D' 18579 The `di' register. 18580 18581 `A' 18582 The `a' and `d' registers, as a pair (for instructions that 18583 return half the result in one and half in the other). 18584 18585 `f' 18586 Any 80387 floating-point (stack) register. 18587 18588 `t' 18589 Top of 80387 floating-point stack (`%st(0)'). 18590 18591 `u' 18592 Second from top of 80387 floating-point stack (`%st(1)'). 18593 18594 `y' 18595 Any MMX register. 18596 18597 `x' 18598 Any SSE register. 18599 18600 `I' 18601 Integer constant in the range 0 ... 31, for 32-bit shifts. 18602 18603 `J' 18604 Integer constant in the range 0 ... 63, for 64-bit shifts. 18605 18606 `K' 18607 Signed 8-bit integer constant. 18608 18609 `L' 18610 `0xFF' or `0xFFFF', for andsi as a zero-extending move. 18611 18612 `M' 18613 0, 1, 2, or 3 (shifts for the `lea' instruction). 18614 18615 `N' 18616 Unsigned 8-bit integer constant (for `in' and `out' 18617 instructions). 18618 18619 `G' 18620 Standard 80387 floating point constant. 18621 18622 `C' 18623 Standard SSE floating point constant. 18624 18625 `e' 18626 32-bit signed integer constant, or a symbolic reference known 18627 to fit that range (for immediate operands in sign-extending 18628 x86-64 instructions). 18629 18630 `Z' 18631 32-bit unsigned integer constant, or a symbolic reference 18632 known to fit that range (for immediate operands in 18633 zero-extending x86-64 instructions). 18634 18635 18636_Intel IA-64--`config/ia64/ia64.h'_ 18637 18638 `a' 18639 General register `r0' to `r3' for `addl' instruction 18640 18641 `b' 18642 Branch register 18643 18644 `c' 18645 Predicate register (`c' as in "conditional") 18646 18647 `d' 18648 Application register residing in M-unit 18649 18650 `e' 18651 Application register residing in I-unit 18652 18653 `f' 18654 Floating-point register 18655 18656 `m' 18657 Memory operand. Remember that `m' allows postincrement and 18658 postdecrement which require printing with `%Pn' on IA-64. 18659 Use `S' to disallow postincrement and postdecrement. 18660 18661 `G' 18662 Floating-point constant 0.0 or 1.0 18663 18664 `I' 18665 14-bit signed integer constant 18666 18667 `J' 18668 22-bit signed integer constant 18669 18670 `K' 18671 8-bit signed integer constant for logical instructions 18672 18673 `L' 18674 8-bit adjusted signed integer constant for compare pseudo-ops 18675 18676 `M' 18677 6-bit unsigned integer constant for shift counts 18678 18679 `N' 18680 9-bit signed integer constant for load and store 18681 postincrements 18682 18683 `O' 18684 The constant zero 18685 18686 `P' 18687 0 or -1 for `dep' instruction 18688 18689 `Q' 18690 Non-volatile memory for floating-point loads and stores 18691 18692 `R' 18693 Integer constant in the range 1 to 4 for `shladd' instruction 18694 18695 `S' 18696 Memory operand except postincrement and postdecrement 18697 18698_FRV--`config/frv/frv.h'_ 18699 18700 `a' 18701 Register in the class `ACC_REGS' (`acc0' to `acc7'). 18702 18703 `b' 18704 Register in the class `EVEN_ACC_REGS' (`acc0' to `acc7'). 18705 18706 `c' 18707 Register in the class `CC_REGS' (`fcc0' to `fcc3' and `icc0' 18708 to `icc3'). 18709 18710 `d' 18711 Register in the class `GPR_REGS' (`gr0' to `gr63'). 18712 18713 `e' 18714 Register in the class `EVEN_REGS' (`gr0' to `gr63'). Odd 18715 registers are excluded not in the class but through the use 18716 of a machine mode larger than 4 bytes. 18717 18718 `f' 18719 Register in the class `FPR_REGS' (`fr0' to `fr63'). 18720 18721 `h' 18722 Register in the class `FEVEN_REGS' (`fr0' to `fr63'). Odd 18723 registers are excluded not in the class but through the use 18724 of a machine mode larger than 4 bytes. 18725 18726 `l' 18727 Register in the class `LR_REG' (the `lr' register). 18728 18729 `q' 18730 Register in the class `QUAD_REGS' (`gr2' to `gr63'). 18731 Register numbers not divisible by 4 are excluded not in the 18732 class but through the use of a machine mode larger than 8 18733 bytes. 18734 18735 `t' 18736 Register in the class `ICC_REGS' (`icc0' to `icc3'). 18737 18738 `u' 18739 Register in the class `FCC_REGS' (`fcc0' to `fcc3'). 18740 18741 `v' 18742 Register in the class `ICR_REGS' (`cc4' to `cc7'). 18743 18744 `w' 18745 Register in the class `FCR_REGS' (`cc0' to `cc3'). 18746 18747 `x' 18748 Register in the class `QUAD_FPR_REGS' (`fr0' to `fr63'). 18749 Register numbers not divisible by 4 are excluded not in the 18750 class but through the use of a machine mode larger than 8 18751 bytes. 18752 18753 `z' 18754 Register in the class `SPR_REGS' (`lcr' and `lr'). 18755 18756 `A' 18757 Register in the class `QUAD_ACC_REGS' (`acc0' to `acc7'). 18758 18759 `B' 18760 Register in the class `ACCG_REGS' (`accg0' to `accg7'). 18761 18762 `C' 18763 Register in the class `CR_REGS' (`cc0' to `cc7'). 18764 18765 `G' 18766 Floating point constant zero 18767 18768 `I' 18769 6-bit signed integer constant 18770 18771 `J' 18772 10-bit signed integer constant 18773 18774 `L' 18775 16-bit signed integer constant 18776 18777 `M' 18778 16-bit unsigned integer constant 18779 18780 `N' 18781 12-bit signed integer constant that is negative--i.e. in the 18782 range of -2048 to -1 18783 18784 `O' 18785 Constant zero 18786 18787 `P' 18788 12-bit signed integer constant that is greater than 18789 zero--i.e. in the range of 1 to 2047. 18790 18791 18792_Blackfin family--`config/bfin/bfin.h'_ 18793 18794 `a' 18795 P register 18796 18797 `d' 18798 D register 18799 18800 `z' 18801 A call clobbered P register. 18802 18803 `D' 18804 Even-numbered D register 18805 18806 `W' 18807 Odd-numbered D register 18808 18809 `e' 18810 Accumulator register. 18811 18812 `A' 18813 Even-numbered accumulator register. 18814 18815 `B' 18816 Odd-numbered accumulator register. 18817 18818 `b' 18819 I register 18820 18821 `v' 18822 B register 18823 18824 `f' 18825 M register 18826 18827 `c' 18828 Registers used for circular buffering, i.e. I, B, or L 18829 registers. 18830 18831 `C' 18832 The CC register. 18833 18834 `t' 18835 LT0 or LT1. 18836 18837 `k' 18838 LC0 or LC1. 18839 18840 `u' 18841 LB0 or LB1. 18842 18843 `x' 18844 Any D, P, B, M, I or L register. 18845 18846 `y' 18847 Additional registers typically used only in prologues and 18848 epilogues: RETS, RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and 18849 USP. 18850 18851 `w' 18852 Any register except accumulators or CC. 18853 18854 `Ksh' 18855 Signed 16 bit integer (in the range -32768 to 32767) 18856 18857 `Kuh' 18858 Unsigned 16 bit integer (in the range 0 to 65535) 18859 18860 `Ks7' 18861 Signed 7 bit integer (in the range -64 to 63) 18862 18863 `Ku7' 18864 Unsigned 7 bit integer (in the range 0 to 127) 18865 18866 `Ku5' 18867 Unsigned 5 bit integer (in the range 0 to 31) 18868 18869 `Ks4' 18870 Signed 4 bit integer (in the range -8 to 7) 18871 18872 `Ks3' 18873 Signed 3 bit integer (in the range -3 to 4) 18874 18875 `Ku3' 18876 Unsigned 3 bit integer (in the range 0 to 7) 18877 18878 `PN' 18879 Constant N, where N is a single-digit constant in the range 0 18880 to 4. 18881 18882 `M1' 18883 Constant 255. 18884 18885 `M2' 18886 Constant 65535. 18887 18888 `J' 18889 An integer constant with exactly a single bit set. 18890 18891 `L' 18892 An integer constant with all bits set except exactly one. 18893 18894 `H' 18895 18896 `Q' 18897 Any SYMBOL_REF. 18898 18899_M32C--`config/m32c/m32c.c'_ 18900 18901 `Rsp' 18902 `Rfb' 18903 `Rsb' 18904 `$sp', `$fb', `$sb'. 18905 18906 `Rcr' 18907 Any control register, when they're 16 bits wide (nothing if 18908 control registers are 24 bits wide) 18909 18910 `Rcl' 18911 Any control register, when they're 24 bits wide. 18912 18913 `R0w' 18914 `R1w' 18915 `R2w' 18916 `R3w' 18917 $r0, $r1, $r2, $r3. 18918 18919 `R02' 18920 $r0 or $r2, or $r2r0 for 32 bit values. 18921 18922 `R13' 18923 $r1 or $r3, or $r3r1 for 32 bit values. 18924 18925 `Rdi' 18926 A register that can hold a 64 bit value. 18927 18928 `Rhl' 18929 $r0 or $r1 (registers with addressable high/low bytes) 18930 18931 `R23' 18932 $r2 or $r3 18933 18934 `Raa' 18935 Address registers 18936 18937 `Raw' 18938 Address registers when they're 16 bits wide. 18939 18940 `Ral' 18941 Address registers when they're 24 bits wide. 18942 18943 `Rqi' 18944 Registers that can hold QI values. 18945 18946 `Rad' 18947 Registers that can be used with displacements ($a0, $a1, $sb). 18948 18949 `Rsi' 18950 Registers that can hold 32 bit values. 18951 18952 `Rhi' 18953 Registers that can hold 16 bit values. 18954 18955 `Rhc' 18956 Registers chat can hold 16 bit values, including all control 18957 registers. 18958 18959 `Rra' 18960 $r0 through R1, plus $a0 and $a1. 18961 18962 `Rfl' 18963 The flags register. 18964 18965 `Rmm' 18966 The memory-based pseudo-registers $mem0 through $mem15. 18967 18968 `Rpi' 18969 Registers that can hold pointers (16 bit registers for r8c, 18970 m16c; 24 bit registers for m32cm, m32c). 18971 18972 `Rpa' 18973 Matches multiple registers in a PARALLEL to form a larger 18974 register. Used to match function return values. 18975 18976 `Is3' 18977 -8 ... 7 18978 18979 `IS1' 18980 -128 ... 127 18981 18982 `IS2' 18983 -32768 ... 32767 18984 18985 `IU2' 18986 0 ... 65535 18987 18988 `In4' 18989 -8 ... -1 or 1 ... 8 18990 18991 `In5' 18992 -16 ... -1 or 1 ... 16 18993 18994 `In6' 18995 -32 ... -1 or 1 ... 32 18996 18997 `IM2' 18998 -65536 ... -1 18999 19000 `Ilb' 19001 An 8 bit value with exactly one bit set. 19002 19003 `Ilw' 19004 A 16 bit value with exactly one bit set. 19005 19006 `Sd' 19007 The common src/dest memory addressing modes. 19008 19009 `Sa' 19010 Memory addressed using $a0 or $a1. 19011 19012 `Si' 19013 Memory addressed with immediate addresses. 19014 19015 `Ss' 19016 Memory addressed using the stack pointer ($sp). 19017 19018 `Sf' 19019 Memory addressed using the frame base register ($fb). 19020 19021 `Ss' 19022 Memory addressed using the small base register ($sb). 19023 19024 `S1' 19025 $r1h 19026 19027_MIPS--`config/mips/constraints.md'_ 19028 19029 `d' 19030 An address register. This is equivalent to `r' unless 19031 generating MIPS16 code. 19032 19033 `f' 19034 A floating-point register (if available). 19035 19036 `h' 19037 The `hi' register. 19038 19039 `l' 19040 The `lo' register. 19041 19042 `x' 19043 The `hi' and `lo' registers. 19044 19045 `c' 19046 A register suitable for use in an indirect jump. This will 19047 always be `$25' for `-mabicalls'. 19048 19049 `y' 19050 Equivalent to `r'; retained for backwards compatibility. 19051 19052 `z' 19053 A floating-point condition code register. 19054 19055 `I' 19056 A signed 16-bit constant (for arithmetic instructions). 19057 19058 `J' 19059 Integer zero. 19060 19061 `K' 19062 An unsigned 16-bit constant (for logic instructions). 19063 19064 `L' 19065 A signed 32-bit constant in which the lower 16 bits are zero. 19066 Such constants can be loaded using `lui'. 19067 19068 `M' 19069 A constant that cannot be loaded using `lui', `addiu' or 19070 `ori'. 19071 19072 `N' 19073 A constant in the range -65535 to -1 (inclusive). 19074 19075 `O' 19076 A signed 15-bit constant. 19077 19078 `P' 19079 A constant in the range 1 to 65535 (inclusive). 19080 19081 `G' 19082 Floating-point zero. 19083 19084 `R' 19085 An address that can be used in a non-macro load or store. 19086 19087_Motorola 680x0--`config/m68k/m68k.h'_ 19088 19089 `a' 19090 Address register 19091 19092 `d' 19093 Data register 19094 19095 `f' 19096 68881 floating-point register, if available 19097 19098 `I' 19099 Integer in the range 1 to 8 19100 19101 `J' 19102 16-bit signed number 19103 19104 `K' 19105 Signed number whose magnitude is greater than 0x80 19106 19107 `L' 19108 Integer in the range -8 to -1 19109 19110 `M' 19111 Signed number whose magnitude is greater than 0x100 19112 19113 `G' 19114 Floating point constant that is not a 68881 constant 19115 19116_Motorola 68HC11 & 68HC12 families--`config/m68hc11/m68hc11.h'_ 19117 19118 `a' 19119 Register `a' 19120 19121 `b' 19122 Register `b' 19123 19124 `d' 19125 Register `d' 19126 19127 `q' 19128 An 8-bit register 19129 19130 `t' 19131 Temporary soft register _.tmp 19132 19133 `u' 19134 A soft register _.d1 to _.d31 19135 19136 `w' 19137 Stack pointer register 19138 19139 `x' 19140 Register `x' 19141 19142 `y' 19143 Register `y' 19144 19145 `z' 19146 Pseudo register `z' (replaced by `x' or `y' at the end) 19147 19148 `A' 19149 An address register: x, y or z 19150 19151 `B' 19152 An address register: x or y 19153 19154 `D' 19155 Register pair (x:d) to form a 32-bit value 19156 19157 `L' 19158 Constants in the range -65536 to 65535 19159 19160 `M' 19161 Constants whose 16-bit low part is zero 19162 19163 `N' 19164 Constant integer 1 or -1 19165 19166 `O' 19167 Constant integer 16 19168 19169 `P' 19170 Constants in the range -8 to 2 19171 19172 19173_SPARC--`config/sparc/sparc.h'_ 19174 19175 `f' 19176 Floating-point register on the SPARC-V8 architecture and 19177 lower floating-point register on the SPARC-V9 architecture. 19178 19179 `e' 19180 Floating-point register. It is equivalent to `f' on the 19181 SPARC-V8 architecture and contains both lower and upper 19182 floating-point registers on the SPARC-V9 architecture. 19183 19184 `c' 19185 Floating-point condition code register. 19186 19187 `d' 19188 Lower floating-point register. It is only valid on the 19189 SPARC-V9 architecture when the Visual Instruction Set is 19190 available. 19191 19192 `b' 19193 Floating-point register. It is only valid on the SPARC-V9 19194 architecture when the Visual Instruction Set is available. 19195 19196 `h' 19197 64-bit global or out register for the SPARC-V8+ architecture. 19198 19199 `I' 19200 Signed 13-bit constant 19201 19202 `J' 19203 Zero 19204 19205 `K' 19206 32-bit constant with the low 12 bits clear (a constant that 19207 can be loaded with the `sethi' instruction) 19208 19209 `L' 19210 A constant in the range supported by `movcc' instructions 19211 19212 `M' 19213 A constant in the range supported by `movrcc' instructions 19214 19215 `N' 19216 Same as `K', except that it verifies that bits that are not 19217 in the lower 32-bit range are all zero. Must be used instead 19218 of `K' for modes wider than `SImode' 19219 19220 `O' 19221 The constant 4096 19222 19223 `G' 19224 Floating-point zero 19225 19226 `H' 19227 Signed 13-bit constant, sign-extended to 32 or 64 bits 19228 19229 `Q' 19230 Floating-point constant whose integral representation can be 19231 moved into an integer register using a single sethi 19232 instruction 19233 19234 `R' 19235 Floating-point constant whose integral representation can be 19236 moved into an integer register using a single mov instruction 19237 19238 `S' 19239 Floating-point constant whose integral representation can be 19240 moved into an integer register using a high/lo_sum 19241 instruction sequence 19242 19243 `T' 19244 Memory address aligned to an 8-byte boundary 19245 19246 `U' 19247 Even register 19248 19249 `W' 19250 Memory address for `e' constraint registers 19251 19252 `Y' 19253 Vector zero 19254 19255 19256_TMS320C3x/C4x--`config/c4x/c4x.h'_ 19257 19258 `a' 19259 Auxiliary (address) register (ar0-ar7) 19260 19261 `b' 19262 Stack pointer register (sp) 19263 19264 `c' 19265 Standard (32-bit) precision integer register 19266 19267 `f' 19268 Extended (40-bit) precision register (r0-r11) 19269 19270 `k' 19271 Block count register (bk) 19272 19273 `q' 19274 Extended (40-bit) precision low register (r0-r7) 19275 19276 `t' 19277 Extended (40-bit) precision register (r0-r1) 19278 19279 `u' 19280 Extended (40-bit) precision register (r2-r3) 19281 19282 `v' 19283 Repeat count register (rc) 19284 19285 `x' 19286 Index register (ir0-ir1) 19287 19288 `y' 19289 Status (condition code) register (st) 19290 19291 `z' 19292 Data page register (dp) 19293 19294 `G' 19295 Floating-point zero 19296 19297 `H' 19298 Immediate 16-bit floating-point constant 19299 19300 `I' 19301 Signed 16-bit constant 19302 19303 `J' 19304 Signed 8-bit constant 19305 19306 `K' 19307 Signed 5-bit constant 19308 19309 `L' 19310 Unsigned 16-bit constant 19311 19312 `M' 19313 Unsigned 8-bit constant 19314 19315 `N' 19316 Ones complement of unsigned 16-bit constant 19317 19318 `O' 19319 High 16-bit constant (32-bit constant with 16 LSBs zero) 19320 19321 `Q' 19322 Indirect memory reference with signed 8-bit or index register 19323 displacement 19324 19325 `R' 19326 Indirect memory reference with unsigned 5-bit displacement 19327 19328 `S' 19329 Indirect memory reference with 1 bit or index register 19330 displacement 19331 19332 `T' 19333 Direct memory reference 19334 19335 `U' 19336 Symbolic address 19337 19338 19339_S/390 and zSeries--`config/s390/s390.h'_ 19340 19341 `a' 19342 Address register (general purpose register except r0) 19343 19344 `c' 19345 Condition code register 19346 19347 `d' 19348 Data register (arbitrary general purpose register) 19349 19350 `f' 19351 Floating-point register 19352 19353 `I' 19354 Unsigned 8-bit constant (0-255) 19355 19356 `J' 19357 Unsigned 12-bit constant (0-4095) 19358 19359 `K' 19360 Signed 16-bit constant (-32768-32767) 19361 19362 `L' 19363 Value appropriate as displacement. 19364 `(0..4095)' 19365 for short displacement 19366 19367 `(-524288..524287)' 19368 for long displacement 19369 19370 `M' 19371 Constant integer with a value of 0x7fffffff. 19372 19373 `N' 19374 Multiple letter constraint followed by 4 parameter letters. 19375 `0..9:' 19376 number of the part counting from most to least 19377 significant 19378 19379 `H,Q:' 19380 mode of the part 19381 19382 `D,S,H:' 19383 mode of the containing operand 19384 19385 `0,F:' 19386 value of the other parts (F--all bits set) 19387 The constraint matches if the specified part of a constant 19388 has a value different from it's other parts. 19389 19390 `Q' 19391 Memory reference without index register and with short 19392 displacement. 19393 19394 `R' 19395 Memory reference with index register and short displacement. 19396 19397 `S' 19398 Memory reference without index register but with long 19399 displacement. 19400 19401 `T' 19402 Memory reference with index register and long displacement. 19403 19404 `U' 19405 Pointer with short displacement. 19406 19407 `W' 19408 Pointer with long displacement. 19409 19410 `Y' 19411 Shift count operand. 19412 19413 19414_Score family--`config/score/score.h'_ 19415 19416 `d' 19417 Registers from r0 to r32. 19418 19419 `e' 19420 Registers from r0 to r16. 19421 19422 `t' 19423 r8--r11 or r22--r27 registers. 19424 19425 `h' 19426 hi register. 19427 19428 `l' 19429 lo register. 19430 19431 `x' 19432 hi + lo register. 19433 19434 `q' 19435 cnt register. 19436 19437 `y' 19438 lcb register. 19439 19440 `z' 19441 scb register. 19442 19443 `a' 19444 cnt + lcb + scb register. 19445 19446 `c' 19447 cr0--cr15 register. 19448 19449 `b' 19450 cp1 registers. 19451 19452 `f' 19453 cp2 registers. 19454 19455 `i' 19456 cp3 registers. 19457 19458 `j' 19459 cp1 + cp2 + cp3 registers. 19460 19461 `I' 19462 High 16-bit constant (32-bit constant with 16 LSBs zero). 19463 19464 `J' 19465 Unsigned 5 bit integer (in the range 0 to 31). 19466 19467 `K' 19468 Unsigned 16 bit integer (in the range 0 to 65535). 19469 19470 `L' 19471 Signed 16 bit integer (in the range -32768 to 32767). 19472 19473 `M' 19474 Unsigned 14 bit integer (in the range 0 to 16383). 19475 19476 `N' 19477 Signed 14 bit integer (in the range -8192 to 8191). 19478 19479 `Z' 19480 Any SYMBOL_REF. 19481 19482_Xstormy16--`config/stormy16/stormy16.h'_ 19483 19484 `a' 19485 Register r0. 19486 19487 `b' 19488 Register r1. 19489 19490 `c' 19491 Register r2. 19492 19493 `d' 19494 Register r8. 19495 19496 `e' 19497 Registers r0 through r7. 19498 19499 `t' 19500 Registers r0 and r1. 19501 19502 `y' 19503 The carry register. 19504 19505 `z' 19506 Registers r8 and r9. 19507 19508 `I' 19509 A constant between 0 and 3 inclusive. 19510 19511 `J' 19512 A constant that has exactly one bit set. 19513 19514 `K' 19515 A constant that has exactly one bit clear. 19516 19517 `L' 19518 A constant between 0 and 255 inclusive. 19519 19520 `M' 19521 A constant between -255 and 0 inclusive. 19522 19523 `N' 19524 A constant between -3 and 0 inclusive. 19525 19526 `O' 19527 A constant between 1 and 4 inclusive. 19528 19529 `P' 19530 A constant between -4 and -1 inclusive. 19531 19532 `Q' 19533 A memory reference that is a stack push. 19534 19535 `R' 19536 A memory reference that is a stack pop. 19537 19538 `S' 19539 A memory reference that refers to a constant address of known 19540 value. 19541 19542 `T' 19543 The register indicated by Rx (not implemented yet). 19544 19545 `U' 19546 A constant that is not between 2 and 15 inclusive. 19547 19548 `Z' 19549 The constant 0. 19550 19551 19552_Xtensa--`config/xtensa/xtensa.h'_ 19553 19554 `a' 19555 General-purpose 32-bit register 19556 19557 `b' 19558 One-bit boolean register 19559 19560 `A' 19561 MAC16 40-bit accumulator register 19562 19563 `I' 19564 Signed 12-bit integer constant, for use in MOVI instructions 19565 19566 `J' 19567 Signed 8-bit integer constant, for use in ADDI instructions 19568 19569 `K' 19570 Integer constant valid for BccI instructions 19571 19572 `L' 19573 Unsigned constant valid for BccUI instructions 19574 19575 19576 19577 19578File: gcc.info, Node: Asm Labels, Next: Explicit Reg Vars, Prev: Constraints, Up: C Extensions 19579 195805.37 Controlling Names Used in Assembler Code 19581============================================= 19582 19583You can specify the name to be used in the assembler code for a C 19584function or variable by writing the `asm' (or `__asm__') keyword after 19585the declarator as follows: 19586 19587 int foo asm ("myfoo") = 2; 19588 19589This specifies that the name to be used for the variable `foo' in the 19590assembler code should be `myfoo' rather than the usual `_foo'. 19591 19592 On systems where an underscore is normally prepended to the name of a C 19593function or variable, this feature allows you to define names for the 19594linker that do not start with an underscore. 19595 19596 It does not make sense to use this feature with a non-static local 19597variable since such variables do not have assembler names. If you are 19598trying to put the variable in a particular register, see *Note Explicit 19599Reg Vars::. GCC presently accepts such code with a warning, but will 19600probably be changed to issue an error, rather than a warning, in the 19601future. 19602 19603 You cannot use `asm' in this way in a function _definition_; but you 19604can get the same effect by writing a declaration for the function 19605before its definition and putting `asm' there, like this: 19606 19607 extern func () asm ("FUNC"); 19608 19609 func (x, y) 19610 int x, y; 19611 /* ... */ 19612 19613 It is up to you to make sure that the assembler names you choose do not 19614conflict with any other assembler symbols. Also, you must not use a 19615register name; that would produce completely invalid assembler code. 19616GCC does not as yet have the ability to store static variables in 19617registers. Perhaps that will be added. 19618 19619 19620File: gcc.info, Node: Explicit Reg Vars, Next: Alternate Keywords, Prev: Asm Labels, Up: C Extensions 19621 196225.38 Variables in Specified Registers 19623===================================== 19624 19625GNU C allows you to put a few global variables into specified hardware 19626registers. You can also specify the register in which an ordinary 19627register variable should be allocated. 19628 19629 * Global register variables reserve registers throughout the program. 19630 This may be useful in programs such as programming language 19631 interpreters which have a couple of global variables that are 19632 accessed very often. 19633 19634 * Local register variables in specific registers do not reserve the 19635 registers, except at the point where they are used as input or 19636 output operands in an `asm' statement and the `asm' statement 19637 itself is not deleted. The compiler's data flow analysis is 19638 capable of determining where the specified registers contain live 19639 values, and where they are available for other uses. Stores into 19640 local register variables may be deleted when they appear to be 19641 dead according to dataflow analysis. References to local register 19642 variables may be deleted or moved or simplified. 19643 19644 These local variables are sometimes convenient for use with the 19645 extended `asm' feature (*note Extended Asm::), if you want to 19646 write one output of the assembler instruction directly into a 19647 particular register. (This will work provided the register you 19648 specify fits the constraints specified for that operand in the 19649 `asm'.) 19650 19651* Menu: 19652 19653* Global Reg Vars:: 19654* Local Reg Vars:: 19655 19656 19657File: gcc.info, Node: Global Reg Vars, Next: Local Reg Vars, Up: Explicit Reg Vars 19658 196595.38.1 Defining Global Register Variables 19660----------------------------------------- 19661 19662You can define a global register variable in GNU C like this: 19663 19664 register int *foo asm ("a5"); 19665 19666Here `a5' is the name of the register which should be used. Choose a 19667register which is normally saved and restored by function calls on your 19668machine, so that library routines will not clobber it. 19669 19670 Naturally the register name is cpu-dependent, so you would need to 19671conditionalize your program according to cpu type. The register `a5' 19672would be a good choice on a 68000 for a variable of pointer type. On 19673machines with register windows, be sure to choose a "global" register 19674that is not affected magically by the function call mechanism. 19675 19676 In addition, operating systems on one type of cpu may differ in how 19677they name the registers; then you would need additional conditionals. 19678For example, some 68000 operating systems call this register `%a5'. 19679 19680 Eventually there may be a way of asking the compiler to choose a 19681register automatically, but first we need to figure out how it should 19682choose and how to enable you to guide the choice. No solution is 19683evident. 19684 19685 Defining a global register variable in a certain register reserves that 19686register entirely for this use, at least within the current compilation. 19687The register will not be allocated for any other purpose in the 19688functions in the current compilation. The register will not be saved 19689and restored by these functions. Stores into this register are never 19690deleted even if they would appear to be dead, but references may be 19691deleted or moved or simplified. 19692 19693 It is not safe to access the global register variables from signal 19694handlers, or from more than one thread of control, because the system 19695library routines may temporarily use the register for other things 19696(unless you recompile them specially for the task at hand). 19697 19698 It is not safe for one function that uses a global register variable to 19699call another such function `foo' by way of a third function `lose' that 19700was compiled without knowledge of this variable (i.e. in a different 19701source file in which the variable wasn't declared). This is because 19702`lose' might save the register and put some other value there. For 19703example, you can't expect a global register variable to be available in 19704the comparison-function that you pass to `qsort', since `qsort' might 19705have put something else in that register. (If you are prepared to 19706recompile `qsort' with the same global register variable, you can solve 19707this problem.) 19708 19709 If you want to recompile `qsort' or other source files which do not 19710actually use your global register variable, so that they will not use 19711that register for any other purpose, then it suffices to specify the 19712compiler option `-ffixed-REG'. You need not actually add a global 19713register declaration to their source code. 19714 19715 A function which can alter the value of a global register variable 19716cannot safely be called from a function compiled without this variable, 19717because it could clobber the value the caller expects to find there on 19718return. Therefore, the function which is the entry point into the part 19719of the program that uses the global register variable must explicitly 19720save and restore the value which belongs to its caller. 19721 19722 On most machines, `longjmp' will restore to each global register 19723variable the value it had at the time of the `setjmp'. On some 19724machines, however, `longjmp' will not change the value of global 19725register variables. To be portable, the function that called `setjmp' 19726should make other arrangements to save the values of the global register 19727variables, and to restore them in a `longjmp'. This way, the same 19728thing will happen regardless of what `longjmp' does. 19729 19730 All global register variable declarations must precede all function 19731definitions. If such a declaration could appear after function 19732definitions, the declaration would be too late to prevent the register 19733from being used for other purposes in the preceding functions. 19734 19735 Global register variables may not have initial values, because an 19736executable file has no means to supply initial contents for a register. 19737 19738 On the SPARC, there are reports that g3 ... g7 are suitable registers, 19739but certain library functions, such as `getwd', as well as the 19740subroutines for division and remainder, modify g3 and g4. g1 and g2 19741are local temporaries. 19742 19743 On the 68000, a2 ... a5 should be suitable, as should d2 ... d7. Of 19744course, it will not do to use more than a few of those. 19745 19746 19747File: gcc.info, Node: Local Reg Vars, Prev: Global Reg Vars, Up: Explicit Reg Vars 19748 197495.38.2 Specifying Registers for Local Variables 19750----------------------------------------------- 19751 19752You can define a local register variable with a specified register like 19753this: 19754 19755 register int *foo asm ("a5"); 19756 19757Here `a5' is the name of the register which should be used. Note that 19758this is the same syntax used for defining global register variables, 19759but for a local variable it would appear within a function. 19760 19761 Naturally the register name is cpu-dependent, but this is not a 19762problem, since specific registers are most often useful with explicit 19763assembler instructions (*note Extended Asm::). Both of these things 19764generally require that you conditionalize your program according to cpu 19765type. 19766 19767 In addition, operating systems on one type of cpu may differ in how 19768they name the registers; then you would need additional conditionals. 19769For example, some 68000 operating systems call this register `%a5'. 19770 19771 Defining such a register variable does not reserve the register; it 19772remains available for other uses in places where flow control determines 19773the variable's value is not live. 19774 19775 This option does not guarantee that GCC will generate code that has 19776this variable in the register you specify at all times. You may not 19777code an explicit reference to this register in the _assembler 19778instruction template_ part of an `asm' statement and assume it will 19779always refer to this variable. However, using the variable as an `asm' 19780_operand_ guarantees that the specified register is used for the 19781operand. 19782 19783 Stores into local register variables may be deleted when they appear 19784to be dead according to dataflow analysis. References to local 19785register variables may be deleted or moved or simplified. 19786 19787 As for global register variables, it's recommended that you choose a 19788register which is normally saved and restored by function calls on your 19789machine, so that library routines will not clobber it. A common 19790pitfall is to initialize multiple call-clobbered registers with 19791arbitrary expressions, where a function call or library call for an 19792arithmetic operator will overwrite a register value from a previous 19793assignment, for example `r0' below: 19794 register int *p1 asm ("r0") = ...; 19795 register int *p2 asm ("r1") = ...; 19796 In those cases, a solution is to use a temporary variable for each 19797arbitrary expression. *Note Example of asm with clobbered asm reg::. 19798 19799 19800File: gcc.info, Node: Alternate Keywords, Next: Incomplete Enums, Prev: Explicit Reg Vars, Up: C Extensions 19801 198025.39 Alternate Keywords 19803======================= 19804 19805`-ansi' and the various `-std' options disable certain keywords. This 19806causes trouble when you want to use GNU C extensions, or a 19807general-purpose header file that should be usable by all programs, 19808including ISO C programs. The keywords `asm', `typeof' and `inline' 19809are not available in programs compiled with `-ansi' or `-std' (although 19810`inline' can be used in a program compiled with `-std=c99'). The ISO 19811C99 keyword `restrict' is only available when `-std=gnu99' (which will 19812eventually be the default) or `-std=c99' (or the equivalent 19813`-std=iso9899:1999') is used. 19814 19815 The way to solve these problems is to put `__' at the beginning and 19816end of each problematical keyword. For example, use `__asm__' instead 19817of `asm', and `__inline__' instead of `inline'. 19818 19819 Other C compilers won't accept these alternative keywords; if you want 19820to compile with another compiler, you can define the alternate keywords 19821as macros to replace them with the customary keywords. It looks like 19822this: 19823 19824 #ifndef __GNUC__ 19825 #define __asm__ asm 19826 #endif 19827 19828 `-pedantic' and other options cause warnings for many GNU C extensions. 19829You can prevent such warnings within one expression by writing 19830`__extension__' before the expression. `__extension__' has no effect 19831aside from this. 19832 19833 19834File: gcc.info, Node: Incomplete Enums, Next: Function Names, Prev: Alternate Keywords, Up: C Extensions 19835 198365.40 Incomplete `enum' Types 19837============================ 19838 19839You can define an `enum' tag without specifying its possible values. 19840This results in an incomplete type, much like what you get if you write 19841`struct foo' without describing the elements. A later declaration 19842which does specify the possible values completes the type. 19843 19844 You can't allocate variables or storage using the type while it is 19845incomplete. However, you can work with pointers to that type. 19846 19847 This extension may not be very useful, but it makes the handling of 19848`enum' more consistent with the way `struct' and `union' are handled. 19849 19850 This extension is not supported by GNU C++. 19851 19852 19853File: gcc.info, Node: Function Names, Next: Return Address, Prev: Incomplete Enums, Up: C Extensions 19854 198555.41 Function Names as Strings 19856============================== 19857 19858GCC provides three magic variables which hold the name of the current 19859function, as a string. The first of these is `__func__', which is part 19860of the C99 standard: 19861 19862 The identifier `__func__' is implicitly declared by the translator 19863 as if, immediately following the opening brace of each function 19864 definition, the declaration 19865 static const char __func__[] = "function-name"; 19866 19867 appeared, where function-name is the name of the lexically-enclosing 19868 function. This name is the unadorned name of the function. 19869 19870 `__FUNCTION__' is another name for `__func__'. Older versions of GCC 19871recognize only this name. However, it is not standardized. For 19872maximum portability, we recommend you use `__func__', but provide a 19873fallback definition with the preprocessor: 19874 19875 #if __STDC_VERSION__ < 199901L 19876 # if __GNUC__ >= 2 19877 # define __func__ __FUNCTION__ 19878 # else 19879 # define __func__ "<unknown>" 19880 # endif 19881 #endif 19882 19883 In C, `__PRETTY_FUNCTION__' is yet another name for `__func__'. 19884However, in C++, `__PRETTY_FUNCTION__' contains the type signature of 19885the function as well as its bare name. For example, this program: 19886 19887 extern "C" { 19888 extern int printf (char *, ...); 19889 } 19890 19891 class a { 19892 public: 19893 void sub (int i) 19894 { 19895 printf ("__FUNCTION__ = %s\n", __FUNCTION__); 19896 printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__); 19897 } 19898 }; 19899 19900 int 19901 main (void) 19902 { 19903 a ax; 19904 ax.sub (0); 19905 return 0; 19906 } 19907 19908gives this output: 19909 19910 __FUNCTION__ = sub 19911 __PRETTY_FUNCTION__ = void a::sub(int) 19912 19913 These identifiers are not preprocessor macros. In GCC 3.3 and 19914earlier, in C only, `__FUNCTION__' and `__PRETTY_FUNCTION__' were 19915treated as string literals; they could be used to initialize `char' 19916arrays, and they could be concatenated with other string literals. GCC 199173.4 and later treat them as variables, like `__func__'. In C++, 19918`__FUNCTION__' and `__PRETTY_FUNCTION__' have always been variables. 19919 19920 19921File: gcc.info, Node: Return Address, Next: Vector Extensions, Prev: Function Names, Up: C Extensions 19922 199235.42 Getting the Return or Frame Address of a Function 19924====================================================== 19925 19926These functions may be used to get information about the callers of a 19927function. 19928 19929 -- Built-in Function: void * __builtin_return_address (unsigned int 19930 LEVEL) 19931 This function returns the return address of the current function, 19932 or of one of its callers. The LEVEL argument is number of frames 19933 to scan up the call stack. A value of `0' yields the return 19934 address of the current function, a value of `1' yields the return 19935 address of the caller of the current function, and so forth. When 19936 inlining the expected behavior is that the function will return 19937 the address of the function that will be returned to. To work 19938 around this behavior use the `noinline' function attribute. 19939 19940 The LEVEL argument must be a constant integer. 19941 19942 On some machines it may be impossible to determine the return 19943 address of any function other than the current one; in such cases, 19944 or when the top of the stack has been reached, this function will 19945 return `0' or a random value. In addition, 19946 `__builtin_frame_address' may be used to determine if the top of 19947 the stack has been reached. 19948 19949 This function should only be used with a nonzero argument for 19950 debugging purposes. 19951 19952 -- Built-in Function: void * __builtin_frame_address (unsigned int 19953 LEVEL) 19954 This function is similar to `__builtin_return_address', but it 19955 returns the address of the function frame rather than the return 19956 address of the function. Calling `__builtin_frame_address' with a 19957 value of `0' yields the frame address of the current function, a 19958 value of `1' yields the frame address of the caller of the current 19959 function, and so forth. 19960 19961 The frame is the area on the stack which holds local variables and 19962 saved registers. The frame address is normally the address of the 19963 first word pushed on to the stack by the function. However, the 19964 exact definition depends upon the processor and the calling 19965 convention. If the processor has a dedicated frame pointer 19966 register, and the function has a frame, then 19967 `__builtin_frame_address' will return the value of the frame 19968 pointer register. 19969 19970 On some machines it may be impossible to determine the frame 19971 address of any function other than the current one; in such cases, 19972 or when the top of the stack has been reached, this function will 19973 return `0' if the first frame pointer is properly initialized by 19974 the startup code. 19975 19976 This function should only be used with a nonzero argument for 19977 debugging purposes. 19978 19979 19980File: gcc.info, Node: Vector Extensions, Next: Offsetof, Prev: Return Address, Up: C Extensions 19981 199825.43 Using vector instructions through built-in functions 19983========================================================= 19984 19985On some targets, the instruction set contains SIMD vector instructions 19986that operate on multiple values contained in one large register at the 19987same time. For example, on the i386 the MMX, 3Dnow! and SSE extensions 19988can be used this way. 19989 19990 The first step in using these extensions is to provide the necessary 19991data types. This should be done using an appropriate `typedef': 19992 19993 typedef int v4si __attribute__ ((vector_size (16))); 19994 19995 The `int' type specifies the base type, while the attribute specifies 19996the vector size for the variable, measured in bytes. For example, the 19997declaration above causes the compiler to set the mode for the `v4si' 19998type to be 16 bytes wide and divided into `int' sized units. For a 1999932-bit `int' this means a vector of 4 units of 4 bytes, and the 20000corresponding mode of `foo' will be V4SI. 20001 20002 The `vector_size' attribute is only applicable to integral and float 20003scalars, although arrays, pointers, and function return values are 20004allowed in conjunction with this construct. 20005 20006 All the basic integer types can be used as base types, both as signed 20007and as unsigned: `char', `short', `int', `long', `long long'. In 20008addition, `float' and `double' can be used to build floating-point 20009vector types. 20010 20011 Specifying a combination that is not valid for the current architecture 20012will cause GCC to synthesize the instructions using a narrower mode. 20013For example, if you specify a variable of type `V4SI' and your 20014architecture does not allow for this specific SIMD type, GCC will 20015produce code that uses 4 `SIs'. 20016 20017 The types defined in this manner can be used with a subset of normal C 20018operations. Currently, GCC will allow using the following operators on 20019these types: `+, -, *, /, unary minus, ^, |, &, ~'. 20020 20021 The operations behave like C++ `valarrays'. Addition is defined as 20022the addition of the corresponding elements of the operands. For 20023example, in the code below, each of the 4 elements in A will be added 20024to the corresponding 4 elements in B and the resulting vector will be 20025stored in C. 20026 20027 typedef int v4si __attribute__ ((vector_size (16))); 20028 20029 v4si a, b, c; 20030 20031 c = a + b; 20032 20033 Subtraction, multiplication, division, and the logical operations 20034operate in a similar manner. Likewise, the result of using the unary 20035minus or complement operators on a vector type is a vector whose 20036elements are the negative or complemented values of the corresponding 20037elements in the operand. 20038 20039 You can declare variables and use them in function calls and returns, 20040as well as in assignments and some casts. You can specify a vector 20041type as a return type for a function. Vector types can also be used as 20042function arguments. It is possible to cast from one vector type to 20043another, provided they are of the same size (in fact, you can also cast 20044vectors to and from other datatypes of the same size). 20045 20046 You cannot operate between vectors of different lengths or different 20047signedness without a cast. 20048 20049 A port that supports hardware vector operations, usually provides a set 20050of built-in functions that can be used to operate on vectors. For 20051example, a function to add two vectors and multiply the result by a 20052third could look like this: 20053 20054 v4si f (v4si a, v4si b, v4si c) 20055 { 20056 v4si tmp = __builtin_addv4si (a, b); 20057 return __builtin_mulv4si (tmp, c); 20058 } 20059 20060 20061File: gcc.info, Node: Offsetof, Next: Atomic Builtins, Prev: Vector Extensions, Up: C Extensions 20062 200635.44 Offsetof 20064============= 20065 20066GCC implements for both C and C++ a syntactic extension to implement 20067the `offsetof' macro. 20068 20069 primary: 20070 "__builtin_offsetof" "(" `typename' "," offsetof_member_designator ")" 20071 20072 offsetof_member_designator: 20073 `identifier' 20074 | offsetof_member_designator "." `identifier' 20075 | offsetof_member_designator "[" `expr' "]" 20076 20077 This extension is sufficient such that 20078 20079 #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) 20080 20081 is a suitable definition of the `offsetof' macro. In C++, TYPE may be 20082dependent. In either case, MEMBER may consist of a single identifier, 20083or a sequence of member accesses and array references. 20084 20085 20086File: gcc.info, Node: Atomic Builtins, Next: Object Size Checking, Prev: Offsetof, Up: C Extensions 20087 200885.45 Built-in functions for atomic memory access 20089================================================ 20090 20091The following builtins are intended to be compatible with those 20092described in the `Intel Itanium Processor-specific Application Binary 20093Interface', section 7.4. As such, they depart from the normal GCC 20094practice of using the "__builtin_" prefix, and further that they are 20095overloaded such that they work on multiple types. 20096 20097 The definition given in the Intel documentation allows only for the 20098use of the types `int', `long', `long long' as well as their unsigned 20099counterparts. GCC will allow any integral scalar or pointer type that 20100is 1, 2, 4 or 8 bytes in length. 20101 20102 Not all operations are supported by all target processors. If a 20103particular operation cannot be implemented on the target processor, a 20104warning will be generated and a call an external function will be 20105generated. The external function will carry the same name as the 20106builtin, with an additional suffix `_N' where N is the size of the data 20107type. 20108 20109 In most cases, these builtins are considered a "full barrier". That 20110is, no memory operand will be moved across the operation, either 20111forward or backward. Further, instructions will be issued as necessary 20112to prevent the processor from speculating loads across the operation 20113and from queuing stores after the operation. 20114 20115 All of the routines are are described in the Intel documentation to 20116take "an optional list of variables protected by the memory barrier". 20117It's not clear what is meant by that; it could mean that _only_ the 20118following variables are protected, or it could mean that these variables 20119should in addition be protected. At present GCC ignores this list and 20120protects all variables which are globally accessible. If in the future 20121we make some use of this list, an empty list will continue to mean all 20122globally accessible variables. 20123 20124`TYPE __sync_fetch_and_add (TYPE *ptr, TYPE value, ...)' 20125`TYPE __sync_fetch_and_sub (TYPE *ptr, TYPE value, ...)' 20126`TYPE __sync_fetch_and_or (TYPE *ptr, TYPE value, ...)' 20127`TYPE __sync_fetch_and_and (TYPE *ptr, TYPE value, ...)' 20128`TYPE __sync_fetch_and_xor (TYPE *ptr, TYPE value, ...)' 20129`TYPE __sync_fetch_and_nand (TYPE *ptr, TYPE value, ...)' 20130 These builtins perform the operation suggested by the name, and 20131 returns the value that had previously been in memory. That is, 20132 20133 { tmp = *ptr; *ptr OP= value; return tmp; } 20134 { tmp = *ptr; *ptr = ~tmp & value; return tmp; } // nand 20135 20136`TYPE __sync_add_and_fetch (TYPE *ptr, TYPE value, ...)' 20137`TYPE __sync_sub_and_fetch (TYPE *ptr, TYPE value, ...)' 20138`TYPE __sync_or_and_fetch (TYPE *ptr, TYPE value, ...)' 20139`TYPE __sync_and_and_fetch (TYPE *ptr, TYPE value, ...)' 20140`TYPE __sync_xor_and_fetch (TYPE *ptr, TYPE value, ...)' 20141`TYPE __sync_nand_and_fetch (TYPE *ptr, TYPE value, ...)' 20142 These builtins perform the operation suggested by the name, and 20143 return the new value. That is, 20144 20145 { *ptr OP= value; return *ptr; } 20146 { *ptr = ~*ptr & value; return *ptr; } // nand 20147 20148`bool __sync_bool_compare_and_swap (TYPE *ptr, TYPE oldval TYPE newval, ...)' 20149`TYPE __sync_val_compare_and_swap (TYPE *ptr, TYPE oldval TYPE newval, ...)' 20150 These builtins perform an atomic compare and swap. That is, if 20151 the current value of `*PTR' is OLDVAL, then write NEWVAL into 20152 `*PTR'. 20153 20154 The "bool" version returns true if the comparison is successful and 20155 NEWVAL was written. The "val" version returns the contents of 20156 `*PTR' before the operation. 20157 20158`__sync_synchronize (...)' 20159 This builtin issues a full memory barrier. 20160 20161`TYPE __sync_lock_test_and_set (TYPE *ptr, TYPE value, ...)' 20162 This builtin, as described by Intel, is not a traditional 20163 test-and-set operation, but rather an atomic exchange operation. 20164 It writes VALUE into `*PTR', and returns the previous contents of 20165 `*PTR'. 20166 20167 Many targets have only minimal support for such locks, and do not 20168 support a full exchange operation. In this case, a target may 20169 support reduced functionality here by which the _only_ valid value 20170 to store is the immediate constant 1. The exact value actually 20171 stored in `*PTR' is implementation defined. 20172 20173 This builtin is not a full barrier, but rather an "acquire 20174 barrier". This means that references after the builtin cannot 20175 move to (or be speculated to) before the builtin, but previous 20176 memory stores may not be globally visible yet, and previous memory 20177 loads may not yet be satisfied. 20178 20179`void __sync_lock_release (TYPE *ptr, ...)' 20180 This builtin releases the lock acquired by 20181 `__sync_lock_test_and_set'. Normally this means writing the 20182 constant 0 to `*PTR'. 20183 20184 This builtin is not a full barrier, but rather a "release barrier". 20185 This means that all previous memory stores are globally visible, 20186 and all previous memory loads have been satisfied, but following 20187 memory reads are not prevented from being speculated to before the 20188 barrier. 20189 20190 20191File: gcc.info, Node: Object Size Checking, Next: Other Builtins, Prev: Atomic Builtins, Up: C Extensions 20192 201935.46 Object Size Checking Builtins 20194================================== 20195 20196GCC implements a limited buffer overflow protection mechanism that can 20197prevent some buffer overflow attacks. 20198 20199 -- Built-in Function: size_t __builtin_object_size (void * PTR, int 20200 TYPE) 20201 is a built-in construct that returns a constant number of bytes 20202 from PTR to the end of the object PTR pointer points to (if known 20203 at compile time). `__builtin_object_size' never evaluates its 20204 arguments for side-effects. If there are any side-effects in 20205 them, it returns `(size_t) -1' for TYPE 0 or 1 and `(size_t) 0' 20206 for TYPE 2 or 3. If there are multiple objects PTR can point to 20207 and all of them are known at compile time, the returned number is 20208 the maximum of remaining byte counts in those objects if TYPE & 2 20209 is 0 and minimum if nonzero. If it is not possible to determine 20210 which objects PTR points to at compile time, 20211 `__builtin_object_size' should return `(size_t) -1' for TYPE 0 or 20212 1 and `(size_t) 0' for TYPE 2 or 3. 20213 20214 TYPE is an integer constant from 0 to 3. If the least significant 20215 bit is clear, objects are whole variables, if it is set, a closest 20216 surrounding subobject is considered the object a pointer points to. 20217 The second bit determines if maximum or minimum of remaining bytes 20218 is computed. 20219 20220 struct V { char buf1[10]; int b; char buf2[10]; } var; 20221 char *p = &var.buf1[1], *q = &var.b; 20222 20223 /* Here the object p points to is var. */ 20224 assert (__builtin_object_size (p, 0) == sizeof (var) - 1); 20225 /* The subobject p points to is var.buf1. */ 20226 assert (__builtin_object_size (p, 1) == sizeof (var.buf1) - 1); 20227 /* The object q points to is var. */ 20228 assert (__builtin_object_size (q, 0) 20229 == (char *) (&var + 1) - (char *) &var.b); 20230 /* The subobject q points to is var.b. */ 20231 assert (__builtin_object_size (q, 1) == sizeof (var.b)); 20232 20233 There are built-in functions added for many common string operation 20234functions, e.g. for `memcpy' `__builtin___memcpy_chk' built-in is 20235provided. This built-in has an additional last argument, which is the 20236number of bytes remaining in object the DEST argument points to or 20237`(size_t) -1' if the size is not known. 20238 20239 The built-in functions are optimized into the normal string functions 20240like `memcpy' if the last argument is `(size_t) -1' or if it is known 20241at compile time that the destination object will not be overflown. If 20242the compiler can determine at compile time the object will be always 20243overflown, it issues a warning. 20244 20245 The intended use can be e.g. 20246 20247 #undef memcpy 20248 #define bos0(dest) __builtin_object_size (dest, 0) 20249 #define memcpy(dest, src, n) \ 20250 __builtin___memcpy_chk (dest, src, n, bos0 (dest)) 20251 20252 char *volatile p; 20253 char buf[10]; 20254 /* It is unknown what object p points to, so this is optimized 20255 into plain memcpy - no checking is possible. */ 20256 memcpy (p, "abcde", n); 20257 /* Destination is known and length too. It is known at compile 20258 time there will be no overflow. */ 20259 memcpy (&buf[5], "abcde", 5); 20260 /* Destination is known, but the length is not known at compile time. 20261 This will result in __memcpy_chk call that can check for overflow 20262 at runtime. */ 20263 memcpy (&buf[5], "abcde", n); 20264 /* Destination is known and it is known at compile time there will 20265 be overflow. There will be a warning and __memcpy_chk call that 20266 will abort the program at runtime. */ 20267 memcpy (&buf[6], "abcde", 5); 20268 20269 Such built-in functions are provided for `memcpy', `mempcpy', 20270`memmove', `memset', `strcpy', `stpcpy', `strncpy', `strcat' and 20271`strncat'. 20272 20273 There are also checking built-in functions for formatted output 20274functions. 20275 int __builtin___sprintf_chk (char *s, int flag, size_t os, const char *fmt, ...); 20276 int __builtin___snprintf_chk (char *s, size_t maxlen, int flag, size_t os, 20277 const char *fmt, ...); 20278 int __builtin___vsprintf_chk (char *s, int flag, size_t os, const char *fmt, 20279 va_list ap); 20280 int __builtin___vsnprintf_chk (char *s, size_t maxlen, int flag, size_t os, 20281 const char *fmt, va_list ap); 20282 20283 The added FLAG argument is passed unchanged to `__sprintf_chk' etc. 20284functions and can contain implementation specific flags on what 20285additional security measures the checking function might take, such as 20286handling `%n' differently. 20287 20288 The OS argument is the object size S points to, like in the other 20289built-in functions. There is a small difference in the behavior 20290though, if OS is `(size_t) -1', the built-in functions are optimized 20291into the non-checking functions only if FLAG is 0, otherwise the 20292checking function is called with OS argument set to `(size_t) -1'. 20293 20294 In addition to this, there are checking built-in functions 20295`__builtin___printf_chk', `__builtin___vprintf_chk', 20296`__builtin___fprintf_chk' and `__builtin___vfprintf_chk'. These have 20297just one additional argument, FLAG, right before format string FMT. If 20298the compiler is able to optimize them to `fputc' etc. functions, it 20299will, otherwise the checking function should be called and the FLAG 20300argument passed to it. 20301 20302 20303File: gcc.info, Node: Other Builtins, Next: Target Builtins, Prev: Object Size Checking, Up: C Extensions 20304 203055.47 Other built-in functions provided by GCC 20306============================================= 20307 20308GCC provides a large number of built-in functions other than the ones 20309mentioned above. Some of these are for internal use in the processing 20310of exceptions or variable-length argument lists and will not be 20311documented here because they may change from time to time; we do not 20312recommend general use of these functions. 20313 20314 The remaining functions are provided for optimization purposes. 20315 20316 GCC includes built-in versions of many of the functions in the standard 20317C library. The versions prefixed with `__builtin_' will always be 20318treated as having the same meaning as the C library function even if you 20319specify the `-fno-builtin' option. (*note C Dialect Options::) Many of 20320these functions are only optimized in certain cases; if they are not 20321optimized in a particular case, a call to the library function will be 20322emitted. 20323 20324 Outside strict ISO C mode (`-ansi', `-std=c89' or `-std=c99'), the 20325functions `_exit', `alloca', `bcmp', `bzero', `dcgettext', `dgettext', 20326`dremf', `dreml', `drem', `exp10f', `exp10l', `exp10', `ffsll', `ffsl', 20327`ffs', `fprintf_unlocked', `fputs_unlocked', `gammaf', `gammal', 20328`gamma', `gettext', `index', `isascii', `j0f', `j0l', `j0', `j1f', 20329`j1l', `j1', `jnf', `jnl', `jn', `mempcpy', `pow10f', `pow10l', `pow10', 20330`printf_unlocked', `rindex', `scalbf', `scalbl', `scalb', `signbit', 20331`signbitf', `signbitl', `significandf', `significandl', `significand', 20332`sincosf', `sincosl', `sincos', `stpcpy', `stpncpy', `strcasecmp', 20333`strdup', `strfmon', `strncasecmp', `strndup', `toascii', `y0f', `y0l', 20334`y0', `y1f', `y1l', `y1', `ynf', `ynl' and `yn' may be handled as 20335built-in functions. All these functions have corresponding versions 20336prefixed with `__builtin_', which may be used even in strict C89 mode. 20337 20338 The ISO C99 functions `_Exit', `acoshf', `acoshl', `acosh', `asinhf', 20339`asinhl', `asinh', `atanhf', `atanhl', `atanh', `cabsf', `cabsl', 20340`cabs', `cacosf', `cacoshf', `cacoshl', `cacosh', `cacosl', `cacos', 20341`cargf', `cargl', `carg', `casinf', `casinhf', `casinhl', `casinh', 20342`casinl', `casin', `catanf', `catanhf', `catanhl', `catanh', `catanl', 20343`catan', `cbrtf', `cbrtl', `cbrt', `ccosf', `ccoshf', `ccoshl', 20344`ccosh', `ccosl', `ccos', `cexpf', `cexpl', `cexp', `cimagf', `cimagl', 20345`cimag', `clogf', `clogl', `clog', `conjf', `conjl', `conj', 20346`copysignf', `copysignl', `copysign', `cpowf', `cpowl', `cpow', 20347`cprojf', `cprojl', `cproj', `crealf', `creall', `creal', `csinf', 20348`csinhf', `csinhl', `csinh', `csinl', `csin', `csqrtf', `csqrtl', 20349`csqrt', `ctanf', `ctanhf', `ctanhl', `ctanh', `ctanl', `ctan', 20350`erfcf', `erfcl', `erfc', `erff', `erfl', `erf', `exp2f', `exp2l', 20351`exp2', `expm1f', `expm1l', `expm1', `fdimf', `fdiml', `fdim', `fmaf', 20352`fmal', `fmaxf', `fmaxl', `fmax', `fma', `fminf', `fminl', `fmin', 20353`hypotf', `hypotl', `hypot', `ilogbf', `ilogbl', `ilogb', `imaxabs', 20354`isblank', `iswblank', `lgammaf', `lgammal', `lgamma', `llabs', 20355`llrintf', `llrintl', `llrint', `llroundf', `llroundl', `llround', 20356`log1pf', `log1pl', `log1p', `log2f', `log2l', `log2', `logbf', 20357`logbl', `logb', `lrintf', `lrintl', `lrint', `lroundf', `lroundl', 20358`lround', `nearbyintf', `nearbyintl', `nearbyint', `nextafterf', 20359`nextafterl', `nextafter', `nexttowardf', `nexttowardl', `nexttoward', 20360`remainderf', `remainderl', `remainder', `remquof', `remquol', 20361`remquo', `rintf', `rintl', `rint', `roundf', `roundl', `round', 20362`scalblnf', `scalblnl', `scalbln', `scalbnf', `scalbnl', `scalbn', 20363`snprintf', `tgammaf', `tgammal', `tgamma', `truncf', `truncl', `trunc', 20364`vfscanf', `vscanf', `vsnprintf' and `vsscanf' are handled as built-in 20365functions except in strict ISO C90 mode (`-ansi' or `-std=c89'). 20366 20367 There are also built-in versions of the ISO C99 functions `acosf', 20368`acosl', `asinf', `asinl', `atan2f', `atan2l', `atanf', `atanl', 20369`ceilf', `ceill', `cosf', `coshf', `coshl', `cosl', `expf', `expl', 20370`fabsf', `fabsl', `floorf', `floorl', `fmodf', `fmodl', `frexpf', 20371`frexpl', `ldexpf', `ldexpl', `log10f', `log10l', `logf', `logl', 20372`modfl', `modf', `powf', `powl', `sinf', `sinhf', `sinhl', `sinl', 20373`sqrtf', `sqrtl', `tanf', `tanhf', `tanhl' and `tanl' that are 20374recognized in any mode since ISO C90 reserves these names for the 20375purpose to which ISO C99 puts them. All these functions have 20376corresponding versions prefixed with `__builtin_'. 20377 20378 The ISO C94 functions `iswalnum', `iswalpha', `iswcntrl', `iswdigit', 20379`iswgraph', `iswlower', `iswprint', `iswpunct', `iswspace', `iswupper', 20380`iswxdigit', `towlower' and `towupper' are handled as built-in functions 20381except in strict ISO C90 mode (`-ansi' or `-std=c89'). 20382 20383 The ISO C90 functions `abort', `abs', `acos', `asin', `atan2', `atan', 20384`calloc', `ceil', `cosh', `cos', `exit', `exp', `fabs', `floor', `fmod', 20385`fprintf', `fputs', `frexp', `fscanf', `isalnum', `isalpha', `iscntrl', 20386`isdigit', `isgraph', `islower', `isprint', `ispunct', `isspace', 20387`isupper', `isxdigit', `tolower', `toupper', `labs', `ldexp', `log10', 20388`log', `malloc', `memcmp', `memcpy', `memset', `modf', `pow', `printf', 20389`putchar', `puts', `scanf', `sinh', `sin', `snprintf', `sprintf', 20390`sqrt', `sscanf', `strcat', `strchr', `strcmp', `strcpy', `strcspn', 20391`strlen', `strncat', `strncmp', `strncpy', `strpbrk', `strrchr', 20392`strspn', `strstr', `tanh', `tan', `vfprintf', `vprintf' and `vsprintf' 20393are all recognized as built-in functions unless `-fno-builtin' is 20394specified (or `-fno-builtin-FUNCTION' is specified for an individual 20395function). All of these functions have corresponding versions prefixed 20396with `__builtin_'. 20397 20398 GCC provides built-in versions of the ISO C99 floating point comparison 20399macros that avoid raising exceptions for unordered operands. They have 20400the same names as the standard macros ( `isgreater', `isgreaterequal', 20401`isless', `islessequal', `islessgreater', and `isunordered') , with 20402`__builtin_' prefixed. We intend for a library implementor to be able 20403to simply `#define' each standard macro to its built-in equivalent. 20404 20405 -- Built-in Function: int __builtin_types_compatible_p (TYPE1, TYPE2) 20406 You can use the built-in function `__builtin_types_compatible_p' to 20407 determine whether two types are the same. 20408 20409 This built-in function returns 1 if the unqualified versions of the 20410 types TYPE1 and TYPE2 (which are types, not expressions) are 20411 compatible, 0 otherwise. The result of this built-in function can 20412 be used in integer constant expressions. 20413 20414 This built-in function ignores top level qualifiers (e.g., `const', 20415 `volatile'). For example, `int' is equivalent to `const int'. 20416 20417 The type `int[]' and `int[5]' are compatible. On the other hand, 20418 `int' and `char *' are not compatible, even if the size of their 20419 types, on the particular architecture are the same. Also, the 20420 amount of pointer indirection is taken into account when 20421 determining similarity. Consequently, `short *' is not similar to 20422 `short **'. Furthermore, two types that are typedefed are 20423 considered compatible if their underlying types are compatible. 20424 20425 An `enum' type is not considered to be compatible with another 20426 `enum' type even if both are compatible with the same integer 20427 type; this is what the C standard specifies. For example, `enum 20428 {foo, bar}' is not similar to `enum {hot, dog}'. 20429 20430 You would typically use this function in code whose execution 20431 varies depending on the arguments' types. For example: 20432 20433 #define foo(x) \ 20434 ({ \ 20435 typeof (x) tmp = (x); \ 20436 if (__builtin_types_compatible_p (typeof (x), long double)) \ 20437 tmp = foo_long_double (tmp); \ 20438 else if (__builtin_types_compatible_p (typeof (x), double)) \ 20439 tmp = foo_double (tmp); \ 20440 else if (__builtin_types_compatible_p (typeof (x), float)) \ 20441 tmp = foo_float (tmp); \ 20442 else \ 20443 abort (); \ 20444 tmp; \ 20445 }) 20446 20447 _Note:_ This construct is only available for C. 20448 20449 20450 -- Built-in Function: TYPE __builtin_choose_expr (CONST_EXP, EXP1, 20451 EXP2) 20452 You can use the built-in function `__builtin_choose_expr' to 20453 evaluate code depending on the value of a constant expression. 20454 This built-in function returns EXP1 if CONST_EXP, which is a 20455 constant expression that must be able to be determined at compile 20456 time, is nonzero. Otherwise it returns 0. 20457 20458 This built-in function is analogous to the `? :' operator in C, 20459 except that the expression returned has its type unaltered by 20460 promotion rules. Also, the built-in function does not evaluate 20461 the expression that was not chosen. For example, if CONST_EXP 20462 evaluates to true, EXP2 is not evaluated even if it has 20463 side-effects. 20464 20465 This built-in function can return an lvalue if the chosen argument 20466 is an lvalue. 20467 20468 If EXP1 is returned, the return type is the same as EXP1's type. 20469 Similarly, if EXP2 is returned, its return type is the same as 20470 EXP2. 20471 20472 Example: 20473 20474 #define foo(x) \ 20475 __builtin_choose_expr ( \ 20476 __builtin_types_compatible_p (typeof (x), double), \ 20477 foo_double (x), \ 20478 __builtin_choose_expr ( \ 20479 __builtin_types_compatible_p (typeof (x), float), \ 20480 foo_float (x), \ 20481 /* The void expression results in a compile-time error \ 20482 when assigning the result to something. */ \ 20483 (void)0)) 20484 20485 _Note:_ This construct is only available for C. Furthermore, the 20486 unused expression (EXP1 or EXP2 depending on the value of 20487 CONST_EXP) may still generate syntax errors. This may change in 20488 future revisions. 20489 20490 20491 -- Built-in Function: int __builtin_constant_p (EXP) 20492 You can use the built-in function `__builtin_constant_p' to 20493 determine if a value is known to be constant at compile-time and 20494 hence that GCC can perform constant-folding on expressions 20495 involving that value. The argument of the function is the value 20496 to test. The function returns the integer 1 if the argument is 20497 known to be a compile-time constant and 0 if it is not known to be 20498 a compile-time constant. A return of 0 does not indicate that the 20499 value is _not_ a constant, but merely that GCC cannot prove it is 20500 a constant with the specified value of the `-O' option. 20501 20502 You would typically use this function in an embedded application 20503 where memory was a critical resource. If you have some complex 20504 calculation, you may want it to be folded if it involves 20505 constants, but need to call a function if it does not. For 20506 example: 20507 20508 #define Scale_Value(X) \ 20509 (__builtin_constant_p (X) \ 20510 ? ((X) * SCALE + OFFSET) : Scale (X)) 20511 20512 You may use this built-in function in either a macro or an inline 20513 function. However, if you use it in an inlined function and pass 20514 an argument of the function as the argument to the built-in, GCC 20515 will never return 1 when you call the inline function with a 20516 string constant or compound literal (*note Compound Literals::) 20517 and will not return 1 when you pass a constant numeric value to 20518 the inline function unless you specify the `-O' option. 20519 20520 You may also use `__builtin_constant_p' in initializers for static 20521 data. For instance, you can write 20522 20523 static const int table[] = { 20524 __builtin_constant_p (EXPRESSION) ? (EXPRESSION) : -1, 20525 /* ... */ 20526 }; 20527 20528 This is an acceptable initializer even if EXPRESSION is not a 20529 constant expression. GCC must be more conservative about 20530 evaluating the built-in in this case, because it has no 20531 opportunity to perform optimization. 20532 20533 Previous versions of GCC did not accept this built-in in data 20534 initializers. The earliest version where it is completely safe is 20535 3.0.1. 20536 20537 -- Built-in Function: long __builtin_expect (long EXP, long C) 20538 You may use `__builtin_expect' to provide the compiler with branch 20539 prediction information. In general, you should prefer to use 20540 actual profile feedback for this (`-fprofile-arcs'), as 20541 programmers are notoriously bad at predicting how their programs 20542 actually perform. However, there are applications in which this 20543 data is hard to collect. 20544 20545 The return value is the value of EXP, which should be an integral 20546 expression. The value of C must be a compile-time constant. The 20547 semantics of the built-in are that it is expected that EXP == C. 20548 For example: 20549 20550 if (__builtin_expect (x, 0)) 20551 foo (); 20552 20553 would indicate that we do not expect to call `foo', since we 20554 expect `x' to be zero. Since you are limited to integral 20555 expressions for EXP, you should use constructions such as 20556 20557 if (__builtin_expect (ptr != NULL, 1)) 20558 error (); 20559 20560 when testing pointer or floating-point values. 20561 20562 -- Built-in Function: void __builtin_prefetch (const void *ADDR, ...) 20563 This function is used to minimize cache-miss latency by moving 20564 data into a cache before it is accessed. You can insert calls to 20565 `__builtin_prefetch' into code for which you know addresses of 20566 data in memory that is likely to be accessed soon. If the target 20567 supports them, data prefetch instructions will be generated. If 20568 the prefetch is done early enough before the access then the data 20569 will be in the cache by the time it is accessed. 20570 20571 The value of ADDR is the address of the memory to prefetch. There 20572 are two optional arguments, RW and LOCALITY. The value of RW is a 20573 compile-time constant one or zero; one means that the prefetch is 20574 preparing for a write to the memory address and zero, the default, 20575 means that the prefetch is preparing for a read. The value 20576 LOCALITY must be a compile-time constant integer between zero and 20577 three. A value of zero means that the data has no temporal 20578 locality, so it need not be left in the cache after the access. A 20579 value of three means that the data has a high degree of temporal 20580 locality and should be left in all levels of cache possible. 20581 Values of one and two mean, respectively, a low or moderate degree 20582 of temporal locality. The default is three. 20583 20584 for (i = 0; i < n; i++) 20585 { 20586 a[i] = a[i] + b[i]; 20587 __builtin_prefetch (&a[i+j], 1, 1); 20588 __builtin_prefetch (&b[i+j], 0, 1); 20589 /* ... */ 20590 } 20591 20592 Data prefetch does not generate faults if ADDR is invalid, but the 20593 address expression itself must be valid. For example, a prefetch 20594 of `p->next' will not fault if `p->next' is not a valid address, 20595 but evaluation will fault if `p' is not a valid address. 20596 20597 If the target does not support data prefetch, the address 20598 expression is evaluated if it includes side effects but no other 20599 code is generated and GCC does not issue a warning. 20600 20601 -- Built-in Function: double __builtin_huge_val (void) 20602 Returns a positive infinity, if supported by the floating-point 20603 format, else `DBL_MAX'. This function is suitable for 20604 implementing the ISO C macro `HUGE_VAL'. 20605 20606 -- Built-in Function: float __builtin_huge_valf (void) 20607 Similar to `__builtin_huge_val', except the return type is `float'. 20608 20609 -- Built-in Function: long double __builtin_huge_vall (void) 20610 Similar to `__builtin_huge_val', except the return type is `long 20611 double'. 20612 20613 -- Built-in Function: double __builtin_inf (void) 20614 Similar to `__builtin_huge_val', except a warning is generated if 20615 the target floating-point format does not support infinities. 20616 20617 -- Built-in Function: _Decimal32 __builtin_infd32 (void) 20618 Similar to `__builtin_inf', except the return type is `_Decimal32'. 20619 20620 -- Built-in Function: _Decimal64 __builtin_infd64 (void) 20621 Similar to `__builtin_inf', except the return type is `_Decimal64'. 20622 20623 -- Built-in Function: _Decimal128 __builtin_infd128 (void) 20624 Similar to `__builtin_inf', except the return type is 20625 `_Decimal128'. 20626 20627 -- Built-in Function: float __builtin_inff (void) 20628 Similar to `__builtin_inf', except the return type is `float'. 20629 This function is suitable for implementing the ISO C99 macro 20630 `INFINITY'. 20631 20632 -- Built-in Function: long double __builtin_infl (void) 20633 Similar to `__builtin_inf', except the return type is `long 20634 double'. 20635 20636 -- Built-in Function: double __builtin_nan (const char *str) 20637 This is an implementation of the ISO C99 function `nan'. 20638 20639 Since ISO C99 defines this function in terms of `strtod', which we 20640 do not implement, a description of the parsing is in order. The 20641 string is parsed as by `strtol'; that is, the base is recognized by 20642 leading `0' or `0x' prefixes. The number parsed is placed in the 20643 significand such that the least significant bit of the number is 20644 at the least significant bit of the significand. The number is 20645 truncated to fit the significand field provided. The significand 20646 is forced to be a quiet NaN. 20647 20648 This function, if given a string literal all of which would have 20649 been consumed by strtol, is evaluated early enough that it is 20650 considered a compile-time constant. 20651 20652 -- Built-in Function: _Decimal32 __builtin_nand32 (const char *str) 20653 Similar to `__builtin_nan', except the return type is `_Decimal32'. 20654 20655 -- Built-in Function: _Decimal64 __builtin_nand64 (const char *str) 20656 Similar to `__builtin_nan', except the return type is `_Decimal64'. 20657 20658 -- Built-in Function: _Decimal128 __builtin_nand128 (const char *str) 20659 Similar to `__builtin_nan', except the return type is 20660 `_Decimal128'. 20661 20662 -- Built-in Function: float __builtin_nanf (const char *str) 20663 Similar to `__builtin_nan', except the return type is `float'. 20664 20665 -- Built-in Function: long double __builtin_nanl (const char *str) 20666 Similar to `__builtin_nan', except the return type is `long 20667 double'. 20668 20669 -- Built-in Function: double __builtin_nans (const char *str) 20670 Similar to `__builtin_nan', except the significand is forced to be 20671 a signaling NaN. The `nans' function is proposed by WG14 N965. 20672 20673 -- Built-in Function: float __builtin_nansf (const char *str) 20674 Similar to `__builtin_nans', except the return type is `float'. 20675 20676 -- Built-in Function: long double __builtin_nansl (const char *str) 20677 Similar to `__builtin_nans', except the return type is `long 20678 double'. 20679 20680 -- Built-in Function: int __builtin_ffs (unsigned int x) 20681 Returns one plus the index of the least significant 1-bit of X, or 20682 if X is zero, returns zero. 20683 20684 -- Built-in Function: int __builtin_clz (unsigned int x) 20685 Returns the number of leading 0-bits in X, starting at the most 20686 significant bit position. If X is 0, the result is undefined. 20687 20688 -- Built-in Function: int __builtin_ctz (unsigned int x) 20689 Returns the number of trailing 0-bits in X, starting at the least 20690 significant bit position. If X is 0, the result is undefined. 20691 20692 -- Built-in Function: int __builtin_popcount (unsigned int x) 20693 Returns the number of 1-bits in X. 20694 20695 -- Built-in Function: int __builtin_parity (unsigned int x) 20696 Returns the parity of X, i.e. the number of 1-bits in X modulo 2. 20697 20698 -- Built-in Function: int __builtin_ffsl (unsigned long) 20699 Similar to `__builtin_ffs', except the argument type is `unsigned 20700 long'. 20701 20702 -- Built-in Function: int __builtin_clzl (unsigned long) 20703 Similar to `__builtin_clz', except the argument type is `unsigned 20704 long'. 20705 20706 -- Built-in Function: int __builtin_ctzl (unsigned long) 20707 Similar to `__builtin_ctz', except the argument type is `unsigned 20708 long'. 20709 20710 -- Built-in Function: int __builtin_popcountl (unsigned long) 20711 Similar to `__builtin_popcount', except the argument type is 20712 `unsigned long'. 20713 20714 -- Built-in Function: int __builtin_parityl (unsigned long) 20715 Similar to `__builtin_parity', except the argument type is 20716 `unsigned long'. 20717 20718 -- Built-in Function: int __builtin_ffsll (unsigned long long) 20719 Similar to `__builtin_ffs', except the argument type is `unsigned 20720 long long'. 20721 20722 -- Built-in Function: int __builtin_clzll (unsigned long long) 20723 Similar to `__builtin_clz', except the argument type is `unsigned 20724 long long'. 20725 20726 -- Built-in Function: int __builtin_ctzll (unsigned long long) 20727 Similar to `__builtin_ctz', except the argument type is `unsigned 20728 long long'. 20729 20730 -- Built-in Function: int __builtin_popcountll (unsigned long long) 20731 Similar to `__builtin_popcount', except the argument type is 20732 `unsigned long long'. 20733 20734 -- Built-in Function: int __builtin_parityll (unsigned long long) 20735 Similar to `__builtin_parity', except the argument type is 20736 `unsigned long long'. 20737 20738 -- Built-in Function: double __builtin_powi (double, int) 20739 Returns the first argument raised to the power of the second. 20740 Unlike the `pow' function no guarantees about precision and 20741 rounding are made. 20742 20743 -- Built-in Function: float __builtin_powif (float, int) 20744 Similar to `__builtin_powi', except the argument and return types 20745 are `float'. 20746 20747 -- Built-in Function: long double __builtin_powil (long double, int) 20748 Similar to `__builtin_powi', except the argument and return types 20749 are `long double'. 20750 20751 20752File: gcc.info, Node: Target Builtins, Next: Target Format Checks, Prev: Other Builtins, Up: C Extensions 20753 207545.48 Built-in Functions Specific to Particular Target Machines 20755============================================================== 20756 20757On some target machines, GCC supports many built-in functions specific 20758to those machines. Generally these generate calls to specific machine 20759instructions, but allow the compiler to schedule those calls. 20760 20761* Menu: 20762 20763* Alpha Built-in Functions:: 20764* ARM Built-in Functions:: 20765* Blackfin Built-in Functions:: 20766* FR-V Built-in Functions:: 20767* X86 Built-in Functions:: 20768* MIPS DSP Built-in Functions:: 20769* MIPS Paired-Single Support:: 20770* PowerPC AltiVec Built-in Functions:: 20771* SPARC VIS Built-in Functions:: 20772 20773 20774File: gcc.info, Node: Alpha Built-in Functions, Next: ARM Built-in Functions, Up: Target Builtins 20775 207765.48.1 Alpha Built-in Functions 20777------------------------------- 20778 20779These built-in functions are available for the Alpha family of 20780processors, depending on the command-line switches used. 20781 20782 The following built-in functions are always available. They all 20783generate the machine instruction that is part of the name. 20784 20785 long __builtin_alpha_implver (void) 20786 long __builtin_alpha_rpcc (void) 20787 long __builtin_alpha_amask (long) 20788 long __builtin_alpha_cmpbge (long, long) 20789 long __builtin_alpha_extbl (long, long) 20790 long __builtin_alpha_extwl (long, long) 20791 long __builtin_alpha_extll (long, long) 20792 long __builtin_alpha_extql (long, long) 20793 long __builtin_alpha_extwh (long, long) 20794 long __builtin_alpha_extlh (long, long) 20795 long __builtin_alpha_extqh (long, long) 20796 long __builtin_alpha_insbl (long, long) 20797 long __builtin_alpha_inswl (long, long) 20798 long __builtin_alpha_insll (long, long) 20799 long __builtin_alpha_insql (long, long) 20800 long __builtin_alpha_inswh (long, long) 20801 long __builtin_alpha_inslh (long, long) 20802 long __builtin_alpha_insqh (long, long) 20803 long __builtin_alpha_mskbl (long, long) 20804 long __builtin_alpha_mskwl (long, long) 20805 long __builtin_alpha_mskll (long, long) 20806 long __builtin_alpha_mskql (long, long) 20807 long __builtin_alpha_mskwh (long, long) 20808 long __builtin_alpha_msklh (long, long) 20809 long __builtin_alpha_mskqh (long, long) 20810 long __builtin_alpha_umulh (long, long) 20811 long __builtin_alpha_zap (long, long) 20812 long __builtin_alpha_zapnot (long, long) 20813 20814 The following built-in functions are always with `-mmax' or 20815`-mcpu=CPU' where CPU is `pca56' or later. They all generate the 20816machine instruction that is part of the name. 20817 20818 long __builtin_alpha_pklb (long) 20819 long __builtin_alpha_pkwb (long) 20820 long __builtin_alpha_unpkbl (long) 20821 long __builtin_alpha_unpkbw (long) 20822 long __builtin_alpha_minub8 (long, long) 20823 long __builtin_alpha_minsb8 (long, long) 20824 long __builtin_alpha_minuw4 (long, long) 20825 long __builtin_alpha_minsw4 (long, long) 20826 long __builtin_alpha_maxub8 (long, long) 20827 long __builtin_alpha_maxsb8 (long, long) 20828 long __builtin_alpha_maxuw4 (long, long) 20829 long __builtin_alpha_maxsw4 (long, long) 20830 long __builtin_alpha_perr (long, long) 20831 20832 The following built-in functions are always with `-mcix' or 20833`-mcpu=CPU' where CPU is `ev67' or later. They all generate the 20834machine instruction that is part of the name. 20835 20836 long __builtin_alpha_cttz (long) 20837 long __builtin_alpha_ctlz (long) 20838 long __builtin_alpha_ctpop (long) 20839 20840 The following builtins are available on systems that use the OSF/1 20841PALcode. Normally they invoke the `rduniq' and `wruniq' PAL calls, but 20842when invoked with `-mtls-kernel', they invoke `rdval' and `wrval'. 20843 20844 void *__builtin_thread_pointer (void) 20845 void __builtin_set_thread_pointer (void *) 20846 20847 20848File: gcc.info, Node: ARM Built-in Functions, Next: Blackfin Built-in Functions, Prev: Alpha Built-in Functions, Up: Target Builtins 20849 208505.48.2 ARM Built-in Functions 20851----------------------------- 20852 20853These built-in functions are available for the ARM family of 20854processors, when the `-mcpu=iwmmxt' switch is used: 20855 20856 typedef int v2si __attribute__ ((vector_size (8))); 20857 typedef short v4hi __attribute__ ((vector_size (8))); 20858 typedef char v8qi __attribute__ ((vector_size (8))); 20859 20860 int __builtin_arm_getwcx (int) 20861 void __builtin_arm_setwcx (int, int) 20862 int __builtin_arm_textrmsb (v8qi, int) 20863 int __builtin_arm_textrmsh (v4hi, int) 20864 int __builtin_arm_textrmsw (v2si, int) 20865 int __builtin_arm_textrmub (v8qi, int) 20866 int __builtin_arm_textrmuh (v4hi, int) 20867 int __builtin_arm_textrmuw (v2si, int) 20868 v8qi __builtin_arm_tinsrb (v8qi, int) 20869 v4hi __builtin_arm_tinsrh (v4hi, int) 20870 v2si __builtin_arm_tinsrw (v2si, int) 20871 long long __builtin_arm_tmia (long long, int, int) 20872 long long __builtin_arm_tmiabb (long long, int, int) 20873 long long __builtin_arm_tmiabt (long long, int, int) 20874 long long __builtin_arm_tmiaph (long long, int, int) 20875 long long __builtin_arm_tmiatb (long long, int, int) 20876 long long __builtin_arm_tmiatt (long long, int, int) 20877 int __builtin_arm_tmovmskb (v8qi) 20878 int __builtin_arm_tmovmskh (v4hi) 20879 int __builtin_arm_tmovmskw (v2si) 20880 long long __builtin_arm_waccb (v8qi) 20881 long long __builtin_arm_wacch (v4hi) 20882 long long __builtin_arm_waccw (v2si) 20883 v8qi __builtin_arm_waddb (v8qi, v8qi) 20884 v8qi __builtin_arm_waddbss (v8qi, v8qi) 20885 v8qi __builtin_arm_waddbus (v8qi, v8qi) 20886 v4hi __builtin_arm_waddh (v4hi, v4hi) 20887 v4hi __builtin_arm_waddhss (v4hi, v4hi) 20888 v4hi __builtin_arm_waddhus (v4hi, v4hi) 20889 v2si __builtin_arm_waddw (v2si, v2si) 20890 v2si __builtin_arm_waddwss (v2si, v2si) 20891 v2si __builtin_arm_waddwus (v2si, v2si) 20892 v8qi __builtin_arm_walign (v8qi, v8qi, int) 20893 long long __builtin_arm_wand(long long, long long) 20894 long long __builtin_arm_wandn (long long, long long) 20895 v8qi __builtin_arm_wavg2b (v8qi, v8qi) 20896 v8qi __builtin_arm_wavg2br (v8qi, v8qi) 20897 v4hi __builtin_arm_wavg2h (v4hi, v4hi) 20898 v4hi __builtin_arm_wavg2hr (v4hi, v4hi) 20899 v8qi __builtin_arm_wcmpeqb (v8qi, v8qi) 20900 v4hi __builtin_arm_wcmpeqh (v4hi, v4hi) 20901 v2si __builtin_arm_wcmpeqw (v2si, v2si) 20902 v8qi __builtin_arm_wcmpgtsb (v8qi, v8qi) 20903 v4hi __builtin_arm_wcmpgtsh (v4hi, v4hi) 20904 v2si __builtin_arm_wcmpgtsw (v2si, v2si) 20905 v8qi __builtin_arm_wcmpgtub (v8qi, v8qi) 20906 v4hi __builtin_arm_wcmpgtuh (v4hi, v4hi) 20907 v2si __builtin_arm_wcmpgtuw (v2si, v2si) 20908 long long __builtin_arm_wmacs (long long, v4hi, v4hi) 20909 long long __builtin_arm_wmacsz (v4hi, v4hi) 20910 long long __builtin_arm_wmacu (long long, v4hi, v4hi) 20911 long long __builtin_arm_wmacuz (v4hi, v4hi) 20912 v4hi __builtin_arm_wmadds (v4hi, v4hi) 20913 v4hi __builtin_arm_wmaddu (v4hi, v4hi) 20914 v8qi __builtin_arm_wmaxsb (v8qi, v8qi) 20915 v4hi __builtin_arm_wmaxsh (v4hi, v4hi) 20916 v2si __builtin_arm_wmaxsw (v2si, v2si) 20917 v8qi __builtin_arm_wmaxub (v8qi, v8qi) 20918 v4hi __builtin_arm_wmaxuh (v4hi, v4hi) 20919 v2si __builtin_arm_wmaxuw (v2si, v2si) 20920 v8qi __builtin_arm_wminsb (v8qi, v8qi) 20921 v4hi __builtin_arm_wminsh (v4hi, v4hi) 20922 v2si __builtin_arm_wminsw (v2si, v2si) 20923 v8qi __builtin_arm_wminub (v8qi, v8qi) 20924 v4hi __builtin_arm_wminuh (v4hi, v4hi) 20925 v2si __builtin_arm_wminuw (v2si, v2si) 20926 v4hi __builtin_arm_wmulsm (v4hi, v4hi) 20927 v4hi __builtin_arm_wmulul (v4hi, v4hi) 20928 v4hi __builtin_arm_wmulum (v4hi, v4hi) 20929 long long __builtin_arm_wor (long long, long long) 20930 v2si __builtin_arm_wpackdss (long long, long long) 20931 v2si __builtin_arm_wpackdus (long long, long long) 20932 v8qi __builtin_arm_wpackhss (v4hi, v4hi) 20933 v8qi __builtin_arm_wpackhus (v4hi, v4hi) 20934 v4hi __builtin_arm_wpackwss (v2si, v2si) 20935 v4hi __builtin_arm_wpackwus (v2si, v2si) 20936 long long __builtin_arm_wrord (long long, long long) 20937 long long __builtin_arm_wrordi (long long, int) 20938 v4hi __builtin_arm_wrorh (v4hi, long long) 20939 v4hi __builtin_arm_wrorhi (v4hi, int) 20940 v2si __builtin_arm_wrorw (v2si, long long) 20941 v2si __builtin_arm_wrorwi (v2si, int) 20942 v2si __builtin_arm_wsadb (v8qi, v8qi) 20943 v2si __builtin_arm_wsadbz (v8qi, v8qi) 20944 v2si __builtin_arm_wsadh (v4hi, v4hi) 20945 v2si __builtin_arm_wsadhz (v4hi, v4hi) 20946 v4hi __builtin_arm_wshufh (v4hi, int) 20947 long long __builtin_arm_wslld (long long, long long) 20948 long long __builtin_arm_wslldi (long long, int) 20949 v4hi __builtin_arm_wsllh (v4hi, long long) 20950 v4hi __builtin_arm_wsllhi (v4hi, int) 20951 v2si __builtin_arm_wsllw (v2si, long long) 20952 v2si __builtin_arm_wsllwi (v2si, int) 20953 long long __builtin_arm_wsrad (long long, long long) 20954 long long __builtin_arm_wsradi (long long, int) 20955 v4hi __builtin_arm_wsrah (v4hi, long long) 20956 v4hi __builtin_arm_wsrahi (v4hi, int) 20957 v2si __builtin_arm_wsraw (v2si, long long) 20958 v2si __builtin_arm_wsrawi (v2si, int) 20959 long long __builtin_arm_wsrld (long long, long long) 20960 long long __builtin_arm_wsrldi (long long, int) 20961 v4hi __builtin_arm_wsrlh (v4hi, long long) 20962 v4hi __builtin_arm_wsrlhi (v4hi, int) 20963 v2si __builtin_arm_wsrlw (v2si, long long) 20964 v2si __builtin_arm_wsrlwi (v2si, int) 20965 v8qi __builtin_arm_wsubb (v8qi, v8qi) 20966 v8qi __builtin_arm_wsubbss (v8qi, v8qi) 20967 v8qi __builtin_arm_wsubbus (v8qi, v8qi) 20968 v4hi __builtin_arm_wsubh (v4hi, v4hi) 20969 v4hi __builtin_arm_wsubhss (v4hi, v4hi) 20970 v4hi __builtin_arm_wsubhus (v4hi, v4hi) 20971 v2si __builtin_arm_wsubw (v2si, v2si) 20972 v2si __builtin_arm_wsubwss (v2si, v2si) 20973 v2si __builtin_arm_wsubwus (v2si, v2si) 20974 v4hi __builtin_arm_wunpckehsb (v8qi) 20975 v2si __builtin_arm_wunpckehsh (v4hi) 20976 long long __builtin_arm_wunpckehsw (v2si) 20977 v4hi __builtin_arm_wunpckehub (v8qi) 20978 v2si __builtin_arm_wunpckehuh (v4hi) 20979 long long __builtin_arm_wunpckehuw (v2si) 20980 v4hi __builtin_arm_wunpckelsb (v8qi) 20981 v2si __builtin_arm_wunpckelsh (v4hi) 20982 long long __builtin_arm_wunpckelsw (v2si) 20983 v4hi __builtin_arm_wunpckelub (v8qi) 20984 v2si __builtin_arm_wunpckeluh (v4hi) 20985 long long __builtin_arm_wunpckeluw (v2si) 20986 v8qi __builtin_arm_wunpckihb (v8qi, v8qi) 20987 v4hi __builtin_arm_wunpckihh (v4hi, v4hi) 20988 v2si __builtin_arm_wunpckihw (v2si, v2si) 20989 v8qi __builtin_arm_wunpckilb (v8qi, v8qi) 20990 v4hi __builtin_arm_wunpckilh (v4hi, v4hi) 20991 v2si __builtin_arm_wunpckilw (v2si, v2si) 20992 long long __builtin_arm_wxor (long long, long long) 20993 long long __builtin_arm_wzero () 20994 20995 20996File: gcc.info, Node: Blackfin Built-in Functions, Next: FR-V Built-in Functions, Prev: ARM Built-in Functions, Up: Target Builtins 20997 209985.48.3 Blackfin Built-in Functions 20999---------------------------------- 21000 21001Currently, there are two Blackfin-specific built-in functions. These 21002are used for generating `CSYNC' and `SSYNC' machine insns without using 21003inline assembly; by using these built-in functions the compiler can 21004automatically add workarounds for hardware errata involving these 21005instructions. These functions are named as follows: 21006 21007 void __builtin_bfin_csync (void) 21008 void __builtin_bfin_ssync (void) 21009 21010 21011File: gcc.info, Node: FR-V Built-in Functions, Next: X86 Built-in Functions, Prev: Blackfin Built-in Functions, Up: Target Builtins 21012 210135.48.4 FR-V Built-in Functions 21014------------------------------ 21015 21016GCC provides many FR-V-specific built-in functions. In general, these 21017functions are intended to be compatible with those described by `FR-V 21018Family, Softune C/C++ Compiler Manual (V6), Fujitsu Semiconductor'. 21019The two exceptions are `__MDUNPACKH' and `__MBTOHE', the gcc forms of 21020which pass 128-bit values by pointer rather than by value. 21021 21022 Most of the functions are named after specific FR-V instructions. 21023Such functions are said to be "directly mapped" and are summarized here 21024in tabular form. 21025 21026* Menu: 21027 21028* Argument Types:: 21029* Directly-mapped Integer Functions:: 21030* Directly-mapped Media Functions:: 21031* Raw read/write Functions:: 21032* Other Built-in Functions:: 21033 21034 21035File: gcc.info, Node: Argument Types, Next: Directly-mapped Integer Functions, Up: FR-V Built-in Functions 21036 210375.48.4.1 Argument Types 21038....................... 21039 21040The arguments to the built-in functions can be divided into three 21041groups: register numbers, compile-time constants and run-time values. 21042In order to make this classification clear at a glance, the arguments 21043and return values are given the following pseudo types: 21044 21045Pseudo type Real C type Constant? Description 21046`uh' `unsigned short' No an unsigned halfword 21047`uw1' `unsigned int' No an unsigned word 21048`sw1' `int' No a signed word 21049`uw2' `unsigned long long' No an unsigned doubleword 21050`sw2' `long long' No a signed doubleword 21051`const' `int' Yes an integer constant 21052`acc' `int' Yes an ACC register number 21053`iacc' `int' Yes an IACC register number 21054 21055 These pseudo types are not defined by GCC, they are simply a notational 21056convenience used in this manual. 21057 21058 Arguments of type `uh', `uw1', `sw1', `uw2' and `sw2' are evaluated at 21059run time. They correspond to register operands in the underlying FR-V 21060instructions. 21061 21062 `const' arguments represent immediate operands in the underlying FR-V 21063instructions. They must be compile-time constants. 21064 21065 `acc' arguments are evaluated at compile time and specify the number 21066of an accumulator register. For example, an `acc' argument of 2 will 21067select the ACC2 register. 21068 21069 `iacc' arguments are similar to `acc' arguments but specify the number 21070of an IACC register. See *note Other Built-in Functions:: for more 21071details. 21072 21073 21074File: gcc.info, Node: Directly-mapped Integer Functions, Next: Directly-mapped Media Functions, Prev: Argument Types, Up: FR-V Built-in Functions 21075 210765.48.4.2 Directly-mapped Integer Functions 21077.......................................... 21078 21079The functions listed below map directly to FR-V I-type instructions. 21080 21081Function prototype Example usage Assembly output 21082`sw1 __ADDSS (sw1, sw1)' `C = __ADDSS (A, B)' `ADDSS A,B,C' 21083`sw1 __SCAN (sw1, sw1)' `C = __SCAN (A, B)' `SCAN A,B,C' 21084`sw1 __SCUTSS (sw1)' `B = __SCUTSS (A)' `SCUTSS A,B' 21085`sw1 __SLASS (sw1, sw1)' `C = __SLASS (A, B)' `SLASS A,B,C' 21086`void __SMASS (sw1, sw1)' `__SMASS (A, B)' `SMASS A,B' 21087`void __SMSSS (sw1, sw1)' `__SMSSS (A, B)' `SMSSS A,B' 21088`void __SMU (sw1, sw1)' `__SMU (A, B)' `SMU A,B' 21089`sw2 __SMUL (sw1, sw1)' `C = __SMUL (A, B)' `SMUL A,B,C' 21090`sw1 __SUBSS (sw1, sw1)' `C = __SUBSS (A, B)' `SUBSS A,B,C' 21091`uw2 __UMUL (uw1, uw1)' `C = __UMUL (A, B)' `UMUL A,B,C' 21092 21093 21094File: gcc.info, Node: Directly-mapped Media Functions, Next: Raw read/write Functions, Prev: Directly-mapped Integer Functions, Up: FR-V Built-in Functions 21095 210965.48.4.3 Directly-mapped Media Functions 21097........................................ 21098 21099The functions listed below map directly to FR-V M-type instructions. 21100 21101Function prototype Example usage Assembly output 21102`uw1 __MABSHS (sw1)' `B = __MABSHS (A)' `MABSHS A,B' 21103`void __MADDACCS (acc, acc)' `__MADDACCS (B, A)' `MADDACCS A,B' 21104`sw1 __MADDHSS (sw1, sw1)' `C = __MADDHSS (A, B)' `MADDHSS A,B,C' 21105`uw1 __MADDHUS (uw1, uw1)' `C = __MADDHUS (A, B)' `MADDHUS A,B,C' 21106`uw1 __MAND (uw1, uw1)' `C = __MAND (A, B)' `MAND A,B,C' 21107`void __MASACCS (acc, acc)' `__MASACCS (B, A)' `MASACCS A,B' 21108`uw1 __MAVEH (uw1, uw1)' `C = __MAVEH (A, B)' `MAVEH A,B,C' 21109`uw2 __MBTOH (uw1)' `B = __MBTOH (A)' `MBTOH A,B' 21110`void __MBTOHE (uw1 *, uw1)' `__MBTOHE (&B, A)' `MBTOHE A,B' 21111`void __MCLRACC (acc)' `__MCLRACC (A)' `MCLRACC A' 21112`void __MCLRACCA (void)' `__MCLRACCA ()' `MCLRACCA' 21113`uw1 __Mcop1 (uw1, uw1)' `C = __Mcop1 (A, B)' `Mcop1 A,B,C' 21114`uw1 __Mcop2 (uw1, uw1)' `C = __Mcop2 (A, B)' `Mcop2 A,B,C' 21115`uw1 __MCPLHI (uw2, const)' `C = __MCPLHI (A, B)' `MCPLHI A,#B,C' 21116`uw1 __MCPLI (uw2, const)' `C = __MCPLI (A, B)' `MCPLI A,#B,C' 21117`void __MCPXIS (acc, sw1, sw1)' `__MCPXIS (C, A, B)' `MCPXIS A,B,C' 21118`void __MCPXIU (acc, uw1, uw1)' `__MCPXIU (C, A, B)' `MCPXIU A,B,C' 21119`void __MCPXRS (acc, sw1, sw1)' `__MCPXRS (C, A, B)' `MCPXRS A,B,C' 21120`void __MCPXRU (acc, uw1, uw1)' `__MCPXRU (C, A, B)' `MCPXRU A,B,C' 21121`uw1 __MCUT (acc, uw1)' `C = __MCUT (A, B)' `MCUT A,B,C' 21122`uw1 __MCUTSS (acc, sw1)' `C = __MCUTSS (A, B)' `MCUTSS A,B,C' 21123`void __MDADDACCS (acc, acc)' `__MDADDACCS (B, A)' `MDADDACCS A,B' 21124`void __MDASACCS (acc, acc)' `__MDASACCS (B, A)' `MDASACCS A,B' 21125`uw2 __MDCUTSSI (acc, const)' `C = __MDCUTSSI (A, B)' `MDCUTSSI A,#B,C' 21126`uw2 __MDPACKH (uw2, uw2)' `C = __MDPACKH (A, B)' `MDPACKH A,B,C' 21127`uw2 __MDROTLI (uw2, const)' `C = __MDROTLI (A, B)' `MDROTLI A,#B,C' 21128`void __MDSUBACCS (acc, acc)' `__MDSUBACCS (B, A)' `MDSUBACCS A,B' 21129`void __MDUNPACKH (uw1 *, uw2)' `__MDUNPACKH (&B, A)' `MDUNPACKH A,B' 21130`uw2 __MEXPDHD (uw1, const)' `C = __MEXPDHD (A, B)' `MEXPDHD A,#B,C' 21131`uw1 __MEXPDHW (uw1, const)' `C = __MEXPDHW (A, B)' `MEXPDHW A,#B,C' 21132`uw1 __MHDSETH (uw1, const)' `C = __MHDSETH (A, B)' `MHDSETH A,#B,C' 21133`sw1 __MHDSETS (const)' `B = __MHDSETS (A)' `MHDSETS #A,B' 21134`uw1 __MHSETHIH (uw1, const)' `B = __MHSETHIH (B, A)' `MHSETHIH #A,B' 21135`sw1 __MHSETHIS (sw1, const)' `B = __MHSETHIS (B, A)' `MHSETHIS #A,B' 21136`uw1 __MHSETLOH (uw1, const)' `B = __MHSETLOH (B, A)' `MHSETLOH #A,B' 21137`sw1 __MHSETLOS (sw1, const)' `B = __MHSETLOS (B, A)' `MHSETLOS #A,B' 21138`uw1 __MHTOB (uw2)' `B = __MHTOB (A)' `MHTOB A,B' 21139`void __MMACHS (acc, sw1, sw1)' `__MMACHS (C, A, B)' `MMACHS A,B,C' 21140`void __MMACHU (acc, uw1, uw1)' `__MMACHU (C, A, B)' `MMACHU A,B,C' 21141`void __MMRDHS (acc, sw1, sw1)' `__MMRDHS (C, A, B)' `MMRDHS A,B,C' 21142`void __MMRDHU (acc, uw1, uw1)' `__MMRDHU (C, A, B)' `MMRDHU A,B,C' 21143`void __MMULHS (acc, sw1, sw1)' `__MMULHS (C, A, B)' `MMULHS A,B,C' 21144`void __MMULHU (acc, uw1, uw1)' `__MMULHU (C, A, B)' `MMULHU A,B,C' 21145`void __MMULXHS (acc, sw1, sw1)' `__MMULXHS (C, A, B)' `MMULXHS A,B,C' 21146`void __MMULXHU (acc, uw1, uw1)' `__MMULXHU (C, A, B)' `MMULXHU A,B,C' 21147`uw1 __MNOT (uw1)' `B = __MNOT (A)' `MNOT A,B' 21148`uw1 __MOR (uw1, uw1)' `C = __MOR (A, B)' `MOR A,B,C' 21149`uw1 __MPACKH (uh, uh)' `C = __MPACKH (A, B)' `MPACKH A,B,C' 21150`sw2 __MQADDHSS (sw2, sw2)' `C = __MQADDHSS (A, B)' `MQADDHSS A,B,C' 21151`uw2 __MQADDHUS (uw2, uw2)' `C = __MQADDHUS (A, B)' `MQADDHUS A,B,C' 21152`void __MQCPXIS (acc, sw2, sw2)' `__MQCPXIS (C, A, B)' `MQCPXIS A,B,C' 21153`void __MQCPXIU (acc, uw2, uw2)' `__MQCPXIU (C, A, B)' `MQCPXIU A,B,C' 21154`void __MQCPXRS (acc, sw2, sw2)' `__MQCPXRS (C, A, B)' `MQCPXRS A,B,C' 21155`void __MQCPXRU (acc, uw2, uw2)' `__MQCPXRU (C, A, B)' `MQCPXRU A,B,C' 21156`sw2 __MQLCLRHS (sw2, sw2)' `C = __MQLCLRHS (A, B)' `MQLCLRHS A,B,C' 21157`sw2 __MQLMTHS (sw2, sw2)' `C = __MQLMTHS (A, B)' `MQLMTHS A,B,C' 21158`void __MQMACHS (acc, sw2, sw2)' `__MQMACHS (C, A, B)' `MQMACHS A,B,C' 21159`void __MQMACHU (acc, uw2, uw2)' `__MQMACHU (C, A, B)' `MQMACHU A,B,C' 21160`void __MQMACXHS (acc, sw2, `__MQMACXHS (C, A, B)' `MQMACXHS A,B,C' 21161sw2)' 21162`void __MQMULHS (acc, sw2, sw2)' `__MQMULHS (C, A, B)' `MQMULHS A,B,C' 21163`void __MQMULHU (acc, uw2, uw2)' `__MQMULHU (C, A, B)' `MQMULHU A,B,C' 21164`void __MQMULXHS (acc, sw2, `__MQMULXHS (C, A, B)' `MQMULXHS A,B,C' 21165sw2)' 21166`void __MQMULXHU (acc, uw2, `__MQMULXHU (C, A, B)' `MQMULXHU A,B,C' 21167uw2)' 21168`sw2 __MQSATHS (sw2, sw2)' `C = __MQSATHS (A, B)' `MQSATHS A,B,C' 21169`uw2 __MQSLLHI (uw2, int)' `C = __MQSLLHI (A, B)' `MQSLLHI A,B,C' 21170`sw2 __MQSRAHI (sw2, int)' `C = __MQSRAHI (A, B)' `MQSRAHI A,B,C' 21171`sw2 __MQSUBHSS (sw2, sw2)' `C = __MQSUBHSS (A, B)' `MQSUBHSS A,B,C' 21172`uw2 __MQSUBHUS (uw2, uw2)' `C = __MQSUBHUS (A, B)' `MQSUBHUS A,B,C' 21173`void __MQXMACHS (acc, sw2, `__MQXMACHS (C, A, B)' `MQXMACHS A,B,C' 21174sw2)' 21175`void __MQXMACXHS (acc, sw2, `__MQXMACXHS (C, A, B)' `MQXMACXHS A,B,C' 21176sw2)' 21177`uw1 __MRDACC (acc)' `B = __MRDACC (A)' `MRDACC A,B' 21178`uw1 __MRDACCG (acc)' `B = __MRDACCG (A)' `MRDACCG A,B' 21179`uw1 __MROTLI (uw1, const)' `C = __MROTLI (A, B)' `MROTLI A,#B,C' 21180`uw1 __MROTRI (uw1, const)' `C = __MROTRI (A, B)' `MROTRI A,#B,C' 21181`sw1 __MSATHS (sw1, sw1)' `C = __MSATHS (A, B)' `MSATHS A,B,C' 21182`uw1 __MSATHU (uw1, uw1)' `C = __MSATHU (A, B)' `MSATHU A,B,C' 21183`uw1 __MSLLHI (uw1, const)' `C = __MSLLHI (A, B)' `MSLLHI A,#B,C' 21184`sw1 __MSRAHI (sw1, const)' `C = __MSRAHI (A, B)' `MSRAHI A,#B,C' 21185`uw1 __MSRLHI (uw1, const)' `C = __MSRLHI (A, B)' `MSRLHI A,#B,C' 21186`void __MSUBACCS (acc, acc)' `__MSUBACCS (B, A)' `MSUBACCS A,B' 21187`sw1 __MSUBHSS (sw1, sw1)' `C = __MSUBHSS (A, B)' `MSUBHSS A,B,C' 21188`uw1 __MSUBHUS (uw1, uw1)' `C = __MSUBHUS (A, B)' `MSUBHUS A,B,C' 21189`void __MTRAP (void)' `__MTRAP ()' `MTRAP' 21190`uw2 __MUNPACKH (uw1)' `B = __MUNPACKH (A)' `MUNPACKH A,B' 21191`uw1 __MWCUT (uw2, uw1)' `C = __MWCUT (A, B)' `MWCUT A,B,C' 21192`void __MWTACC (acc, uw1)' `__MWTACC (B, A)' `MWTACC A,B' 21193`void __MWTACCG (acc, uw1)' `__MWTACCG (B, A)' `MWTACCG A,B' 21194`uw1 __MXOR (uw1, uw1)' `C = __MXOR (A, B)' `MXOR A,B,C' 21195 21196 21197File: gcc.info, Node: Raw read/write Functions, Next: Other Built-in Functions, Prev: Directly-mapped Media Functions, Up: FR-V Built-in Functions 21198 211995.48.4.4 Raw read/write Functions 21200................................. 21201 21202This sections describes built-in functions related to read and write 21203instructions to access memory. These functions generate `membar' 21204instructions to flush the I/O load and stores where appropriate, as 21205described in Fujitsu's manual described above. 21206 21207`unsigned char __builtin_read8 (void *DATA)' 21208 21209`unsigned short __builtin_read16 (void *DATA)' 21210 21211`unsigned long __builtin_read32 (void *DATA)' 21212 21213`unsigned long long __builtin_read64 (void *DATA)' 21214 21215`void __builtin_write8 (void *DATA, unsigned char DATUM)' 21216 21217`void __builtin_write16 (void *DATA, unsigned short DATUM)' 21218 21219`void __builtin_write32 (void *DATA, unsigned long DATUM)' 21220 21221`void __builtin_write64 (void *DATA, unsigned long long DATUM)' 21222 21223 21224File: gcc.info, Node: Other Built-in Functions, Prev: Raw read/write Functions, Up: FR-V Built-in Functions 21225 212265.48.4.5 Other Built-in Functions 21227................................. 21228 21229This section describes built-in functions that are not named after a 21230specific FR-V instruction. 21231 21232`sw2 __IACCreadll (iacc REG)' 21233 Return the full 64-bit value of IACC0. The REG argument is 21234 reserved for future expansion and must be 0. 21235 21236`sw1 __IACCreadl (iacc REG)' 21237 Return the value of IACC0H if REG is 0 and IACC0L if REG is 1. 21238 Other values of REG are rejected as invalid. 21239 21240`void __IACCsetll (iacc REG, sw2 X)' 21241 Set the full 64-bit value of IACC0 to X. The REG argument is 21242 reserved for future expansion and must be 0. 21243 21244`void __IACCsetl (iacc REG, sw1 X)' 21245 Set IACC0H to X if REG is 0 and IACC0L to X if REG is 1. Other 21246 values of REG are rejected as invalid. 21247 21248`void __data_prefetch0 (const void *X)' 21249 Use the `dcpl' instruction to load the contents of address X into 21250 the data cache. 21251 21252`void __data_prefetch (const void *X)' 21253 Use the `nldub' instruction to load the contents of address X into 21254 the data cache. The instruction will be issued in slot I1. 21255 21256 21257File: gcc.info, Node: X86 Built-in Functions, Next: MIPS DSP Built-in Functions, Prev: FR-V Built-in Functions, Up: Target Builtins 21258 212595.48.5 X86 Built-in Functions 21260----------------------------- 21261 21262These built-in functions are available for the i386 and x86-64 family 21263of computers, depending on the command-line switches used. 21264 21265 Note that, if you specify command-line switches such as `-msse', the 21266compiler could use the extended instruction sets even if the built-ins 21267are not used explicitly in the program. For this reason, applications 21268which perform runtime CPU detection must compile separate files for each 21269supported architecture, using the appropriate flags. In particular, 21270the file containing the CPU detection code should be compiled without 21271these options. 21272 21273 The following machine modes are available for use with MMX built-in 21274functions (*note Vector Extensions::): `V2SI' for a vector of two 2127532-bit integers, `V4HI' for a vector of four 16-bit integers, and 21276`V8QI' for a vector of eight 8-bit integers. Some of the built-in 21277functions operate on MMX registers as a whole 64-bit entity, these use 21278`DI' as their mode. 21279 21280 If 3Dnow extensions are enabled, `V2SF' is used as a mode for a vector 21281of two 32-bit floating point values. 21282 21283 If SSE extensions are enabled, `V4SF' is used for a vector of four 2128432-bit floating point values. Some instructions use a vector of four 2128532-bit integers, these use `V4SI'. Finally, some instructions operate 21286on an entire vector register, interpreting it as a 128-bit integer, 21287these use mode `TI'. 21288 21289 The following built-in functions are made available by `-mmmx'. All 21290of them generate the machine instruction that is part of the name. 21291 21292 v8qi __builtin_ia32_paddb (v8qi, v8qi) 21293 v4hi __builtin_ia32_paddw (v4hi, v4hi) 21294 v2si __builtin_ia32_paddd (v2si, v2si) 21295 v8qi __builtin_ia32_psubb (v8qi, v8qi) 21296 v4hi __builtin_ia32_psubw (v4hi, v4hi) 21297 v2si __builtin_ia32_psubd (v2si, v2si) 21298 v8qi __builtin_ia32_paddsb (v8qi, v8qi) 21299 v4hi __builtin_ia32_paddsw (v4hi, v4hi) 21300 v8qi __builtin_ia32_psubsb (v8qi, v8qi) 21301 v4hi __builtin_ia32_psubsw (v4hi, v4hi) 21302 v8qi __builtin_ia32_paddusb (v8qi, v8qi) 21303 v4hi __builtin_ia32_paddusw (v4hi, v4hi) 21304 v8qi __builtin_ia32_psubusb (v8qi, v8qi) 21305 v4hi __builtin_ia32_psubusw (v4hi, v4hi) 21306 v4hi __builtin_ia32_pmullw (v4hi, v4hi) 21307 v4hi __builtin_ia32_pmulhw (v4hi, v4hi) 21308 di __builtin_ia32_pand (di, di) 21309 di __builtin_ia32_pandn (di,di) 21310 di __builtin_ia32_por (di, di) 21311 di __builtin_ia32_pxor (di, di) 21312 v8qi __builtin_ia32_pcmpeqb (v8qi, v8qi) 21313 v4hi __builtin_ia32_pcmpeqw (v4hi, v4hi) 21314 v2si __builtin_ia32_pcmpeqd (v2si, v2si) 21315 v8qi __builtin_ia32_pcmpgtb (v8qi, v8qi) 21316 v4hi __builtin_ia32_pcmpgtw (v4hi, v4hi) 21317 v2si __builtin_ia32_pcmpgtd (v2si, v2si) 21318 v8qi __builtin_ia32_punpckhbw (v8qi, v8qi) 21319 v4hi __builtin_ia32_punpckhwd (v4hi, v4hi) 21320 v2si __builtin_ia32_punpckhdq (v2si, v2si) 21321 v8qi __builtin_ia32_punpcklbw (v8qi, v8qi) 21322 v4hi __builtin_ia32_punpcklwd (v4hi, v4hi) 21323 v2si __builtin_ia32_punpckldq (v2si, v2si) 21324 v8qi __builtin_ia32_packsswb (v4hi, v4hi) 21325 v4hi __builtin_ia32_packssdw (v2si, v2si) 21326 v8qi __builtin_ia32_packuswb (v4hi, v4hi) 21327 21328 The following built-in functions are made available either with 21329`-msse', or with a combination of `-m3dnow' and `-march=athlon'. All 21330of them generate the machine instruction that is part of the name. 21331 21332 v4hi __builtin_ia32_pmulhuw (v4hi, v4hi) 21333 v8qi __builtin_ia32_pavgb (v8qi, v8qi) 21334 v4hi __builtin_ia32_pavgw (v4hi, v4hi) 21335 v4hi __builtin_ia32_psadbw (v8qi, v8qi) 21336 v8qi __builtin_ia32_pmaxub (v8qi, v8qi) 21337 v4hi __builtin_ia32_pmaxsw (v4hi, v4hi) 21338 v8qi __builtin_ia32_pminub (v8qi, v8qi) 21339 v4hi __builtin_ia32_pminsw (v4hi, v4hi) 21340 int __builtin_ia32_pextrw (v4hi, int) 21341 v4hi __builtin_ia32_pinsrw (v4hi, int, int) 21342 int __builtin_ia32_pmovmskb (v8qi) 21343 void __builtin_ia32_maskmovq (v8qi, v8qi, char *) 21344 void __builtin_ia32_movntq (di *, di) 21345 void __builtin_ia32_sfence (void) 21346 21347 The following built-in functions are available when `-msse' is used. 21348All of them generate the machine instruction that is part of the name. 21349 21350 int __builtin_ia32_comieq (v4sf, v4sf) 21351 int __builtin_ia32_comineq (v4sf, v4sf) 21352 int __builtin_ia32_comilt (v4sf, v4sf) 21353 int __builtin_ia32_comile (v4sf, v4sf) 21354 int __builtin_ia32_comigt (v4sf, v4sf) 21355 int __builtin_ia32_comige (v4sf, v4sf) 21356 int __builtin_ia32_ucomieq (v4sf, v4sf) 21357 int __builtin_ia32_ucomineq (v4sf, v4sf) 21358 int __builtin_ia32_ucomilt (v4sf, v4sf) 21359 int __builtin_ia32_ucomile (v4sf, v4sf) 21360 int __builtin_ia32_ucomigt (v4sf, v4sf) 21361 int __builtin_ia32_ucomige (v4sf, v4sf) 21362 v4sf __builtin_ia32_addps (v4sf, v4sf) 21363 v4sf __builtin_ia32_subps (v4sf, v4sf) 21364 v4sf __builtin_ia32_mulps (v4sf, v4sf) 21365 v4sf __builtin_ia32_divps (v4sf, v4sf) 21366 v4sf __builtin_ia32_addss (v4sf, v4sf) 21367 v4sf __builtin_ia32_subss (v4sf, v4sf) 21368 v4sf __builtin_ia32_mulss (v4sf, v4sf) 21369 v4sf __builtin_ia32_divss (v4sf, v4sf) 21370 v4si __builtin_ia32_cmpeqps (v4sf, v4sf) 21371 v4si __builtin_ia32_cmpltps (v4sf, v4sf) 21372 v4si __builtin_ia32_cmpleps (v4sf, v4sf) 21373 v4si __builtin_ia32_cmpgtps (v4sf, v4sf) 21374 v4si __builtin_ia32_cmpgeps (v4sf, v4sf) 21375 v4si __builtin_ia32_cmpunordps (v4sf, v4sf) 21376 v4si __builtin_ia32_cmpneqps (v4sf, v4sf) 21377 v4si __builtin_ia32_cmpnltps (v4sf, v4sf) 21378 v4si __builtin_ia32_cmpnleps (v4sf, v4sf) 21379 v4si __builtin_ia32_cmpngtps (v4sf, v4sf) 21380 v4si __builtin_ia32_cmpngeps (v4sf, v4sf) 21381 v4si __builtin_ia32_cmpordps (v4sf, v4sf) 21382 v4si __builtin_ia32_cmpeqss (v4sf, v4sf) 21383 v4si __builtin_ia32_cmpltss (v4sf, v4sf) 21384 v4si __builtin_ia32_cmpless (v4sf, v4sf) 21385 v4si __builtin_ia32_cmpunordss (v4sf, v4sf) 21386 v4si __builtin_ia32_cmpneqss (v4sf, v4sf) 21387 v4si __builtin_ia32_cmpnlts (v4sf, v4sf) 21388 v4si __builtin_ia32_cmpnless (v4sf, v4sf) 21389 v4si __builtin_ia32_cmpordss (v4sf, v4sf) 21390 v4sf __builtin_ia32_maxps (v4sf, v4sf) 21391 v4sf __builtin_ia32_maxss (v4sf, v4sf) 21392 v4sf __builtin_ia32_minps (v4sf, v4sf) 21393 v4sf __builtin_ia32_minss (v4sf, v4sf) 21394 v4sf __builtin_ia32_andps (v4sf, v4sf) 21395 v4sf __builtin_ia32_andnps (v4sf, v4sf) 21396 v4sf __builtin_ia32_orps (v4sf, v4sf) 21397 v4sf __builtin_ia32_xorps (v4sf, v4sf) 21398 v4sf __builtin_ia32_movss (v4sf, v4sf) 21399 v4sf __builtin_ia32_movhlps (v4sf, v4sf) 21400 v4sf __builtin_ia32_movlhps (v4sf, v4sf) 21401 v4sf __builtin_ia32_unpckhps (v4sf, v4sf) 21402 v4sf __builtin_ia32_unpcklps (v4sf, v4sf) 21403 v4sf __builtin_ia32_cvtpi2ps (v4sf, v2si) 21404 v4sf __builtin_ia32_cvtsi2ss (v4sf, int) 21405 v2si __builtin_ia32_cvtps2pi (v4sf) 21406 int __builtin_ia32_cvtss2si (v4sf) 21407 v2si __builtin_ia32_cvttps2pi (v4sf) 21408 int __builtin_ia32_cvttss2si (v4sf) 21409 v4sf __builtin_ia32_rcpps (v4sf) 21410 v4sf __builtin_ia32_rsqrtps (v4sf) 21411 v4sf __builtin_ia32_sqrtps (v4sf) 21412 v4sf __builtin_ia32_rcpss (v4sf) 21413 v4sf __builtin_ia32_rsqrtss (v4sf) 21414 v4sf __builtin_ia32_sqrtss (v4sf) 21415 v4sf __builtin_ia32_shufps (v4sf, v4sf, int) 21416 void __builtin_ia32_movntps (float *, v4sf) 21417 int __builtin_ia32_movmskps (v4sf) 21418 21419 The following built-in functions are available when `-msse' is used. 21420 21421`v4sf __builtin_ia32_loadaps (float *)' 21422 Generates the `movaps' machine instruction as a load from memory. 21423 21424`void __builtin_ia32_storeaps (float *, v4sf)' 21425 Generates the `movaps' machine instruction as a store to memory. 21426 21427`v4sf __builtin_ia32_loadups (float *)' 21428 Generates the `movups' machine instruction as a load from memory. 21429 21430`void __builtin_ia32_storeups (float *, v4sf)' 21431 Generates the `movups' machine instruction as a store to memory. 21432 21433`v4sf __builtin_ia32_loadsss (float *)' 21434 Generates the `movss' machine instruction as a load from memory. 21435 21436`void __builtin_ia32_storess (float *, v4sf)' 21437 Generates the `movss' machine instruction as a store to memory. 21438 21439`v4sf __builtin_ia32_loadhps (v4sf, v2si *)' 21440 Generates the `movhps' machine instruction as a load from memory. 21441 21442`v4sf __builtin_ia32_loadlps (v4sf, v2si *)' 21443 Generates the `movlps' machine instruction as a load from memory 21444 21445`void __builtin_ia32_storehps (v4sf, v2si *)' 21446 Generates the `movhps' machine instruction as a store to memory. 21447 21448`void __builtin_ia32_storelps (v4sf, v2si *)' 21449 Generates the `movlps' machine instruction as a store to memory. 21450 21451 The following built-in functions are available when `-msse2' is used. 21452All of them generate the machine instruction that is part of the name. 21453 21454 int __builtin_ia32_comisdeq (v2df, v2df) 21455 int __builtin_ia32_comisdlt (v2df, v2df) 21456 int __builtin_ia32_comisdle (v2df, v2df) 21457 int __builtin_ia32_comisdgt (v2df, v2df) 21458 int __builtin_ia32_comisdge (v2df, v2df) 21459 int __builtin_ia32_comisdneq (v2df, v2df) 21460 int __builtin_ia32_ucomisdeq (v2df, v2df) 21461 int __builtin_ia32_ucomisdlt (v2df, v2df) 21462 int __builtin_ia32_ucomisdle (v2df, v2df) 21463 int __builtin_ia32_ucomisdgt (v2df, v2df) 21464 int __builtin_ia32_ucomisdge (v2df, v2df) 21465 int __builtin_ia32_ucomisdneq (v2df, v2df) 21466 v2df __builtin_ia32_cmpeqpd (v2df, v2df) 21467 v2df __builtin_ia32_cmpltpd (v2df, v2df) 21468 v2df __builtin_ia32_cmplepd (v2df, v2df) 21469 v2df __builtin_ia32_cmpgtpd (v2df, v2df) 21470 v2df __builtin_ia32_cmpgepd (v2df, v2df) 21471 v2df __builtin_ia32_cmpunordpd (v2df, v2df) 21472 v2df __builtin_ia32_cmpneqpd (v2df, v2df) 21473 v2df __builtin_ia32_cmpnltpd (v2df, v2df) 21474 v2df __builtin_ia32_cmpnlepd (v2df, v2df) 21475 v2df __builtin_ia32_cmpngtpd (v2df, v2df) 21476 v2df __builtin_ia32_cmpngepd (v2df, v2df) 21477 v2df __builtin_ia32_cmpordpd (v2df, v2df) 21478 v2df __builtin_ia32_cmpeqsd (v2df, v2df) 21479 v2df __builtin_ia32_cmpltsd (v2df, v2df) 21480 v2df __builtin_ia32_cmplesd (v2df, v2df) 21481 v2df __builtin_ia32_cmpunordsd (v2df, v2df) 21482 v2df __builtin_ia32_cmpneqsd (v2df, v2df) 21483 v2df __builtin_ia32_cmpnltsd (v2df, v2df) 21484 v2df __builtin_ia32_cmpnlesd (v2df, v2df) 21485 v2df __builtin_ia32_cmpordsd (v2df, v2df) 21486 v2di __builtin_ia32_paddq (v2di, v2di) 21487 v2di __builtin_ia32_psubq (v2di, v2di) 21488 v2df __builtin_ia32_addpd (v2df, v2df) 21489 v2df __builtin_ia32_subpd (v2df, v2df) 21490 v2df __builtin_ia32_mulpd (v2df, v2df) 21491 v2df __builtin_ia32_divpd (v2df, v2df) 21492 v2df __builtin_ia32_addsd (v2df, v2df) 21493 v2df __builtin_ia32_subsd (v2df, v2df) 21494 v2df __builtin_ia32_mulsd (v2df, v2df) 21495 v2df __builtin_ia32_divsd (v2df, v2df) 21496 v2df __builtin_ia32_minpd (v2df, v2df) 21497 v2df __builtin_ia32_maxpd (v2df, v2df) 21498 v2df __builtin_ia32_minsd (v2df, v2df) 21499 v2df __builtin_ia32_maxsd (v2df, v2df) 21500 v2df __builtin_ia32_andpd (v2df, v2df) 21501 v2df __builtin_ia32_andnpd (v2df, v2df) 21502 v2df __builtin_ia32_orpd (v2df, v2df) 21503 v2df __builtin_ia32_xorpd (v2df, v2df) 21504 v2df __builtin_ia32_movsd (v2df, v2df) 21505 v2df __builtin_ia32_unpckhpd (v2df, v2df) 21506 v2df __builtin_ia32_unpcklpd (v2df, v2df) 21507 v16qi __builtin_ia32_paddb128 (v16qi, v16qi) 21508 v8hi __builtin_ia32_paddw128 (v8hi, v8hi) 21509 v4si __builtin_ia32_paddd128 (v4si, v4si) 21510 v2di __builtin_ia32_paddq128 (v2di, v2di) 21511 v16qi __builtin_ia32_psubb128 (v16qi, v16qi) 21512 v8hi __builtin_ia32_psubw128 (v8hi, v8hi) 21513 v4si __builtin_ia32_psubd128 (v4si, v4si) 21514 v2di __builtin_ia32_psubq128 (v2di, v2di) 21515 v8hi __builtin_ia32_pmullw128 (v8hi, v8hi) 21516 v8hi __builtin_ia32_pmulhw128 (v8hi, v8hi) 21517 v2di __builtin_ia32_pand128 (v2di, v2di) 21518 v2di __builtin_ia32_pandn128 (v2di, v2di) 21519 v2di __builtin_ia32_por128 (v2di, v2di) 21520 v2di __builtin_ia32_pxor128 (v2di, v2di) 21521 v16qi __builtin_ia32_pavgb128 (v16qi, v16qi) 21522 v8hi __builtin_ia32_pavgw128 (v8hi, v8hi) 21523 v16qi __builtin_ia32_pcmpeqb128 (v16qi, v16qi) 21524 v8hi __builtin_ia32_pcmpeqw128 (v8hi, v8hi) 21525 v4si __builtin_ia32_pcmpeqd128 (v4si, v4si) 21526 v16qi __builtin_ia32_pcmpgtb128 (v16qi, v16qi) 21527 v8hi __builtin_ia32_pcmpgtw128 (v8hi, v8hi) 21528 v4si __builtin_ia32_pcmpgtd128 (v4si, v4si) 21529 v16qi __builtin_ia32_pmaxub128 (v16qi, v16qi) 21530 v8hi __builtin_ia32_pmaxsw128 (v8hi, v8hi) 21531 v16qi __builtin_ia32_pminub128 (v16qi, v16qi) 21532 v8hi __builtin_ia32_pminsw128 (v8hi, v8hi) 21533 v16qi __builtin_ia32_punpckhbw128 (v16qi, v16qi) 21534 v8hi __builtin_ia32_punpckhwd128 (v8hi, v8hi) 21535 v4si __builtin_ia32_punpckhdq128 (v4si, v4si) 21536 v2di __builtin_ia32_punpckhqdq128 (v2di, v2di) 21537 v16qi __builtin_ia32_punpcklbw128 (v16qi, v16qi) 21538 v8hi __builtin_ia32_punpcklwd128 (v8hi, v8hi) 21539 v4si __builtin_ia32_punpckldq128 (v4si, v4si) 21540 v2di __builtin_ia32_punpcklqdq128 (v2di, v2di) 21541 v16qi __builtin_ia32_packsswb128 (v16qi, v16qi) 21542 v8hi __builtin_ia32_packssdw128 (v8hi, v8hi) 21543 v16qi __builtin_ia32_packuswb128 (v16qi, v16qi) 21544 v8hi __builtin_ia32_pmulhuw128 (v8hi, v8hi) 21545 void __builtin_ia32_maskmovdqu (v16qi, v16qi) 21546 v2df __builtin_ia32_loadupd (double *) 21547 void __builtin_ia32_storeupd (double *, v2df) 21548 v2df __builtin_ia32_loadhpd (v2df, double *) 21549 v2df __builtin_ia32_loadlpd (v2df, double *) 21550 int __builtin_ia32_movmskpd (v2df) 21551 int __builtin_ia32_pmovmskb128 (v16qi) 21552 void __builtin_ia32_movnti (int *, int) 21553 void __builtin_ia32_movntpd (double *, v2df) 21554 void __builtin_ia32_movntdq (v2df *, v2df) 21555 v4si __builtin_ia32_pshufd (v4si, int) 21556 v8hi __builtin_ia32_pshuflw (v8hi, int) 21557 v8hi __builtin_ia32_pshufhw (v8hi, int) 21558 v2di __builtin_ia32_psadbw128 (v16qi, v16qi) 21559 v2df __builtin_ia32_sqrtpd (v2df) 21560 v2df __builtin_ia32_sqrtsd (v2df) 21561 v2df __builtin_ia32_shufpd (v2df, v2df, int) 21562 v2df __builtin_ia32_cvtdq2pd (v4si) 21563 v4sf __builtin_ia32_cvtdq2ps (v4si) 21564 v4si __builtin_ia32_cvtpd2dq (v2df) 21565 v2si __builtin_ia32_cvtpd2pi (v2df) 21566 v4sf __builtin_ia32_cvtpd2ps (v2df) 21567 v4si __builtin_ia32_cvttpd2dq (v2df) 21568 v2si __builtin_ia32_cvttpd2pi (v2df) 21569 v2df __builtin_ia32_cvtpi2pd (v2si) 21570 int __builtin_ia32_cvtsd2si (v2df) 21571 int __builtin_ia32_cvttsd2si (v2df) 21572 long long __builtin_ia32_cvtsd2si64 (v2df) 21573 long long __builtin_ia32_cvttsd2si64 (v2df) 21574 v4si __builtin_ia32_cvtps2dq (v4sf) 21575 v2df __builtin_ia32_cvtps2pd (v4sf) 21576 v4si __builtin_ia32_cvttps2dq (v4sf) 21577 v2df __builtin_ia32_cvtsi2sd (v2df, int) 21578 v2df __builtin_ia32_cvtsi642sd (v2df, long long) 21579 v4sf __builtin_ia32_cvtsd2ss (v4sf, v2df) 21580 v2df __builtin_ia32_cvtss2sd (v2df, v4sf) 21581 void __builtin_ia32_clflush (const void *) 21582 void __builtin_ia32_lfence (void) 21583 void __builtin_ia32_mfence (void) 21584 v16qi __builtin_ia32_loaddqu (const char *) 21585 void __builtin_ia32_storedqu (char *, v16qi) 21586 unsigned long long __builtin_ia32_pmuludq (v2si, v2si) 21587 v2di __builtin_ia32_pmuludq128 (v4si, v4si) 21588 v8hi __builtin_ia32_psllw128 (v8hi, v2di) 21589 v4si __builtin_ia32_pslld128 (v4si, v2di) 21590 v2di __builtin_ia32_psllq128 (v4si, v2di) 21591 v8hi __builtin_ia32_psrlw128 (v8hi, v2di) 21592 v4si __builtin_ia32_psrld128 (v4si, v2di) 21593 v2di __builtin_ia32_psrlq128 (v2di, v2di) 21594 v8hi __builtin_ia32_psraw128 (v8hi, v2di) 21595 v4si __builtin_ia32_psrad128 (v4si, v2di) 21596 v2di __builtin_ia32_pslldqi128 (v2di, int) 21597 v8hi __builtin_ia32_psllwi128 (v8hi, int) 21598 v4si __builtin_ia32_pslldi128 (v4si, int) 21599 v2di __builtin_ia32_psllqi128 (v2di, int) 21600 v2di __builtin_ia32_psrldqi128 (v2di, int) 21601 v8hi __builtin_ia32_psrlwi128 (v8hi, int) 21602 v4si __builtin_ia32_psrldi128 (v4si, int) 21603 v2di __builtin_ia32_psrlqi128 (v2di, int) 21604 v8hi __builtin_ia32_psrawi128 (v8hi, int) 21605 v4si __builtin_ia32_psradi128 (v4si, int) 21606 v4si __builtin_ia32_pmaddwd128 (v8hi, v8hi) 21607 21608 The following built-in functions are available when `-msse3' is used. 21609All of them generate the machine instruction that is part of the name. 21610 21611 v2df __builtin_ia32_addsubpd (v2df, v2df) 21612 v4sf __builtin_ia32_addsubps (v4sf, v4sf) 21613 v2df __builtin_ia32_haddpd (v2df, v2df) 21614 v4sf __builtin_ia32_haddps (v4sf, v4sf) 21615 v2df __builtin_ia32_hsubpd (v2df, v2df) 21616 v4sf __builtin_ia32_hsubps (v4sf, v4sf) 21617 v16qi __builtin_ia32_lddqu (char const *) 21618 void __builtin_ia32_monitor (void *, unsigned int, unsigned int) 21619 v2df __builtin_ia32_movddup (v2df) 21620 v4sf __builtin_ia32_movshdup (v4sf) 21621 v4sf __builtin_ia32_movsldup (v4sf) 21622 void __builtin_ia32_mwait (unsigned int, unsigned int) 21623 21624 The following built-in functions are available when `-msse3' is used. 21625 21626`v2df __builtin_ia32_loadddup (double const *)' 21627 Generates the `movddup' machine instruction as a load from memory. 21628 21629 The following built-in functions are available when `-m3dnow' is used. 21630All of them generate the machine instruction that is part of the name. 21631 21632 void __builtin_ia32_femms (void) 21633 v8qi __builtin_ia32_pavgusb (v8qi, v8qi) 21634 v2si __builtin_ia32_pf2id (v2sf) 21635 v2sf __builtin_ia32_pfacc (v2sf, v2sf) 21636 v2sf __builtin_ia32_pfadd (v2sf, v2sf) 21637 v2si __builtin_ia32_pfcmpeq (v2sf, v2sf) 21638 v2si __builtin_ia32_pfcmpge (v2sf, v2sf) 21639 v2si __builtin_ia32_pfcmpgt (v2sf, v2sf) 21640 v2sf __builtin_ia32_pfmax (v2sf, v2sf) 21641 v2sf __builtin_ia32_pfmin (v2sf, v2sf) 21642 v2sf __builtin_ia32_pfmul (v2sf, v2sf) 21643 v2sf __builtin_ia32_pfrcp (v2sf) 21644 v2sf __builtin_ia32_pfrcpit1 (v2sf, v2sf) 21645 v2sf __builtin_ia32_pfrcpit2 (v2sf, v2sf) 21646 v2sf __builtin_ia32_pfrsqrt (v2sf) 21647 v2sf __builtin_ia32_pfrsqrtit1 (v2sf, v2sf) 21648 v2sf __builtin_ia32_pfsub (v2sf, v2sf) 21649 v2sf __builtin_ia32_pfsubr (v2sf, v2sf) 21650 v2sf __builtin_ia32_pi2fd (v2si) 21651 v4hi __builtin_ia32_pmulhrw (v4hi, v4hi) 21652 21653 The following built-in functions are available when both `-m3dnow' and 21654`-march=athlon' are used. All of them generate the machine instruction 21655that is part of the name. 21656 21657 v2si __builtin_ia32_pf2iw (v2sf) 21658 v2sf __builtin_ia32_pfnacc (v2sf, v2sf) 21659 v2sf __builtin_ia32_pfpnacc (v2sf, v2sf) 21660 v2sf __builtin_ia32_pi2fw (v2si) 21661 v2sf __builtin_ia32_pswapdsf (v2sf) 21662 v2si __builtin_ia32_pswapdsi (v2si) 21663 21664 21665File: gcc.info, Node: MIPS DSP Built-in Functions, Next: MIPS Paired-Single Support, Prev: X86 Built-in Functions, Up: Target Builtins 21666 216675.48.6 MIPS DSP Built-in Functions 21668---------------------------------- 21669 21670The MIPS DSP Application-Specific Extension (ASE) includes new 21671instructions that are designed to improve the performance of DSP and 21672media applications. It provides instructions that operate on packed 216738-bit integer data, Q15 fractional data and Q31 fractional data. 21674 21675 GCC supports MIPS DSP operations using both the generic vector 21676extensions (*note Vector Extensions::) and a collection of 21677MIPS-specific built-in functions. Both kinds of support are enabled by 21678the `-mdsp' command-line option. 21679 21680 At present, GCC only provides support for operations on 32-bit 21681vectors. The vector type associated with 8-bit integer data is usually 21682called `v4i8' and the vector type associated with Q15 is usually called 21683`v2q15'. They can be defined in C as follows: 21684 21685 typedef char v4i8 __attribute__ ((vector_size(4))); 21686 typedef short v2q15 __attribute__ ((vector_size(4))); 21687 21688 `v4i8' and `v2q15' values are initialized in the same way as 21689aggregates. For example: 21690 21691 v4i8 a = {1, 2, 3, 4}; 21692 v4i8 b; 21693 b = (v4i8) {5, 6, 7, 8}; 21694 21695 v2q15 c = {0x0fcb, 0x3a75}; 21696 v2q15 d; 21697 d = (v2q15) {0.1234 * 0x1.0p15, 0.4567 * 0x1.0p15}; 21698 21699 _Note:_ The CPU's endianness determines the order in which values are 21700packed. On little-endian targets, the first value is the least 21701significant and the last value is the most significant. The opposite 21702order applies to big-endian targets. For example, the code above will 21703set the lowest byte of `a' to `1' on little-endian targets and `4' on 21704big-endian targets. 21705 21706 _Note:_ Q15 and Q31 values must be initialized with their integer 21707representation. As shown in this example, the integer representation 21708of a Q15 value can be obtained by multiplying the fractional value by 21709`0x1.0p15'. The equivalent for Q31 values is to multiply by `0x1.0p31'. 21710 21711 The table below lists the `v4i8' and `v2q15' operations for which 21712hardware support exists. `a' and `b' are `v4i8' values, and `c' and 21713`d' are `v2q15' values. 21714 21715C code MIPS instruction 21716`a + b' `addu.qb' 21717`c + d' `addq.ph' 21718`a - b' `subu.qb' 21719`c - d' `subq.ph' 21720 21721 It is easier to describe the DSP built-in functions if we first define 21722the following types: 21723 21724 typedef int q31; 21725 typedef int i32; 21726 typedef long long a64; 21727 21728 `q31' and `i32' are actually the same as `int', but we use `q31' to 21729indicate a Q31 fractional value and `i32' to indicate a 32-bit integer 21730value. Similarly, `a64' is the same as `long long', but we use `a64' 21731to indicate values that will be placed in one of the four DSP 21732accumulators (`$ac0', `$ac1', `$ac2' or `$ac3'). 21733 21734 Also, some built-in functions prefer or require immediate numbers as 21735parameters, because the corresponding DSP instructions accept both 21736immediate numbers and register operands, or accept immediate numbers 21737only. The immediate parameters are listed as follows. 21738 21739 imm0_7: 0 to 7. 21740 imm0_15: 0 to 15. 21741 imm0_31: 0 to 31. 21742 imm0_63: 0 to 63. 21743 imm0_255: 0 to 255. 21744 imm_n32_31: -32 to 31. 21745 imm_n512_511: -512 to 511. 21746 21747 The following built-in functions map directly to a particular MIPS DSP 21748instruction. Please refer to the architecture specification for 21749details on what each instruction does. 21750 21751 v2q15 __builtin_mips_addq_ph (v2q15, v2q15) 21752 v2q15 __builtin_mips_addq_s_ph (v2q15, v2q15) 21753 q31 __builtin_mips_addq_s_w (q31, q31) 21754 v4i8 __builtin_mips_addu_qb (v4i8, v4i8) 21755 v4i8 __builtin_mips_addu_s_qb (v4i8, v4i8) 21756 v2q15 __builtin_mips_subq_ph (v2q15, v2q15) 21757 v2q15 __builtin_mips_subq_s_ph (v2q15, v2q15) 21758 q31 __builtin_mips_subq_s_w (q31, q31) 21759 v4i8 __builtin_mips_subu_qb (v4i8, v4i8) 21760 v4i8 __builtin_mips_subu_s_qb (v4i8, v4i8) 21761 i32 __builtin_mips_addsc (i32, i32) 21762 i32 __builtin_mips_addwc (i32, i32) 21763 i32 __builtin_mips_modsub (i32, i32) 21764 i32 __builtin_mips_raddu_w_qb (v4i8) 21765 v2q15 __builtin_mips_absq_s_ph (v2q15) 21766 q31 __builtin_mips_absq_s_w (q31) 21767 v4i8 __builtin_mips_precrq_qb_ph (v2q15, v2q15) 21768 v2q15 __builtin_mips_precrq_ph_w (q31, q31) 21769 v2q15 __builtin_mips_precrq_rs_ph_w (q31, q31) 21770 v4i8 __builtin_mips_precrqu_s_qb_ph (v2q15, v2q15) 21771 q31 __builtin_mips_preceq_w_phl (v2q15) 21772 q31 __builtin_mips_preceq_w_phr (v2q15) 21773 v2q15 __builtin_mips_precequ_ph_qbl (v4i8) 21774 v2q15 __builtin_mips_precequ_ph_qbr (v4i8) 21775 v2q15 __builtin_mips_precequ_ph_qbla (v4i8) 21776 v2q15 __builtin_mips_precequ_ph_qbra (v4i8) 21777 v2q15 __builtin_mips_preceu_ph_qbl (v4i8) 21778 v2q15 __builtin_mips_preceu_ph_qbr (v4i8) 21779 v2q15 __builtin_mips_preceu_ph_qbla (v4i8) 21780 v2q15 __builtin_mips_preceu_ph_qbra (v4i8) 21781 v4i8 __builtin_mips_shll_qb (v4i8, imm0_7) 21782 v4i8 __builtin_mips_shll_qb (v4i8, i32) 21783 v2q15 __builtin_mips_shll_ph (v2q15, imm0_15) 21784 v2q15 __builtin_mips_shll_ph (v2q15, i32) 21785 v2q15 __builtin_mips_shll_s_ph (v2q15, imm0_15) 21786 v2q15 __builtin_mips_shll_s_ph (v2q15, i32) 21787 q31 __builtin_mips_shll_s_w (q31, imm0_31) 21788 q31 __builtin_mips_shll_s_w (q31, i32) 21789 v4i8 __builtin_mips_shrl_qb (v4i8, imm0_7) 21790 v4i8 __builtin_mips_shrl_qb (v4i8, i32) 21791 v2q15 __builtin_mips_shra_ph (v2q15, imm0_15) 21792 v2q15 __builtin_mips_shra_ph (v2q15, i32) 21793 v2q15 __builtin_mips_shra_r_ph (v2q15, imm0_15) 21794 v2q15 __builtin_mips_shra_r_ph (v2q15, i32) 21795 q31 __builtin_mips_shra_r_w (q31, imm0_31) 21796 q31 __builtin_mips_shra_r_w (q31, i32) 21797 v2q15 __builtin_mips_muleu_s_ph_qbl (v4i8, v2q15) 21798 v2q15 __builtin_mips_muleu_s_ph_qbr (v4i8, v2q15) 21799 v2q15 __builtin_mips_mulq_rs_ph (v2q15, v2q15) 21800 q31 __builtin_mips_muleq_s_w_phl (v2q15, v2q15) 21801 q31 __builtin_mips_muleq_s_w_phr (v2q15, v2q15) 21802 a64 __builtin_mips_dpau_h_qbl (a64, v4i8, v4i8) 21803 a64 __builtin_mips_dpau_h_qbr (a64, v4i8, v4i8) 21804 a64 __builtin_mips_dpsu_h_qbl (a64, v4i8, v4i8) 21805 a64 __builtin_mips_dpsu_h_qbr (a64, v4i8, v4i8) 21806 a64 __builtin_mips_dpaq_s_w_ph (a64, v2q15, v2q15) 21807 a64 __builtin_mips_dpaq_sa_l_w (a64, q31, q31) 21808 a64 __builtin_mips_dpsq_s_w_ph (a64, v2q15, v2q15) 21809 a64 __builtin_mips_dpsq_sa_l_w (a64, q31, q31) 21810 a64 __builtin_mips_mulsaq_s_w_ph (a64, v2q15, v2q15) 21811 a64 __builtin_mips_maq_s_w_phl (a64, v2q15, v2q15) 21812 a64 __builtin_mips_maq_s_w_phr (a64, v2q15, v2q15) 21813 a64 __builtin_mips_maq_sa_w_phl (a64, v2q15, v2q15) 21814 a64 __builtin_mips_maq_sa_w_phr (a64, v2q15, v2q15) 21815 i32 __builtin_mips_bitrev (i32) 21816 i32 __builtin_mips_insv (i32, i32) 21817 v4i8 __builtin_mips_repl_qb (imm0_255) 21818 v4i8 __builtin_mips_repl_qb (i32) 21819 v2q15 __builtin_mips_repl_ph (imm_n512_511) 21820 v2q15 __builtin_mips_repl_ph (i32) 21821 void __builtin_mips_cmpu_eq_qb (v4i8, v4i8) 21822 void __builtin_mips_cmpu_lt_qb (v4i8, v4i8) 21823 void __builtin_mips_cmpu_le_qb (v4i8, v4i8) 21824 i32 __builtin_mips_cmpgu_eq_qb (v4i8, v4i8) 21825 i32 __builtin_mips_cmpgu_lt_qb (v4i8, v4i8) 21826 i32 __builtin_mips_cmpgu_le_qb (v4i8, v4i8) 21827 void __builtin_mips_cmp_eq_ph (v2q15, v2q15) 21828 void __builtin_mips_cmp_lt_ph (v2q15, v2q15) 21829 void __builtin_mips_cmp_le_ph (v2q15, v2q15) 21830 v4i8 __builtin_mips_pick_qb (v4i8, v4i8) 21831 v2q15 __builtin_mips_pick_ph (v2q15, v2q15) 21832 v2q15 __builtin_mips_packrl_ph (v2q15, v2q15) 21833 i32 __builtin_mips_extr_w (a64, imm0_31) 21834 i32 __builtin_mips_extr_w (a64, i32) 21835 i32 __builtin_mips_extr_r_w (a64, imm0_31) 21836 i32 __builtin_mips_extr_s_h (a64, i32) 21837 i32 __builtin_mips_extr_rs_w (a64, imm0_31) 21838 i32 __builtin_mips_extr_rs_w (a64, i32) 21839 i32 __builtin_mips_extr_s_h (a64, imm0_31) 21840 i32 __builtin_mips_extr_r_w (a64, i32) 21841 i32 __builtin_mips_extp (a64, imm0_31) 21842 i32 __builtin_mips_extp (a64, i32) 21843 i32 __builtin_mips_extpdp (a64, imm0_31) 21844 i32 __builtin_mips_extpdp (a64, i32) 21845 a64 __builtin_mips_shilo (a64, imm_n32_31) 21846 a64 __builtin_mips_shilo (a64, i32) 21847 a64 __builtin_mips_mthlip (a64, i32) 21848 void __builtin_mips_wrdsp (i32, imm0_63) 21849 i32 __builtin_mips_rddsp (imm0_63) 21850 i32 __builtin_mips_lbux (void *, i32) 21851 i32 __builtin_mips_lhx (void *, i32) 21852 i32 __builtin_mips_lwx (void *, i32) 21853 i32 __builtin_mips_bposge32 (void) 21854 21855 21856File: gcc.info, Node: MIPS Paired-Single Support, Next: PowerPC AltiVec Built-in Functions, Prev: MIPS DSP Built-in Functions, Up: Target Builtins 21857 218585.48.7 MIPS Paired-Single Support 21859--------------------------------- 21860 21861The MIPS64 architecture includes a number of instructions that operate 21862on pairs of single-precision floating-point values. Each pair is 21863packed into a 64-bit floating-point register, with one element being 21864designated the "upper half" and the other being designated the "lower 21865half". 21866 21867 GCC supports paired-single operations using both the generic vector 21868extensions (*note Vector Extensions::) and a collection of 21869MIPS-specific built-in functions. Both kinds of support are enabled by 21870the `-mpaired-single' command-line option. 21871 21872 The vector type associated with paired-single values is usually called 21873`v2sf'. It can be defined in C as follows: 21874 21875 typedef float v2sf __attribute__ ((vector_size (8))); 21876 21877 `v2sf' values are initialized in the same way as aggregates. For 21878example: 21879 21880 v2sf a = {1.5, 9.1}; 21881 v2sf b; 21882 float e, f; 21883 b = (v2sf) {e, f}; 21884 21885 _Note:_ The CPU's endianness determines which value is stored in the 21886upper half of a register and which value is stored in the lower half. 21887On little-endian targets, the first value is the lower one and the 21888second value is the upper one. The opposite order applies to 21889big-endian targets. For example, the code above will set the lower 21890half of `a' to `1.5' on little-endian targets and `9.1' on big-endian 21891targets. 21892 21893* Menu: 21894 21895* Paired-Single Arithmetic:: 21896* Paired-Single Built-in Functions:: 21897* MIPS-3D Built-in Functions:: 21898 21899 21900File: gcc.info, Node: Paired-Single Arithmetic, Next: Paired-Single Built-in Functions, Up: MIPS Paired-Single Support 21901 219025.48.7.1 Paired-Single Arithmetic 21903................................. 21904 21905The table below lists the `v2sf' operations for which hardware support 21906exists. `a', `b' and `c' are `v2sf' values and `x' is an integral 21907value. 21908 21909C code MIPS instruction 21910`a + b' `add.ps' 21911`a - b' `sub.ps' 21912`-a' `neg.ps' 21913`a * b' `mul.ps' 21914`a * b + c' `madd.ps' 21915`a * b - c' `msub.ps' 21916`-(a * b + c)' `nmadd.ps' 21917`-(a * b - c)' `nmsub.ps' 21918`x ? a : b' `movn.ps'/`movz.ps' 21919 21920 Note that the multiply-accumulate instructions can be disabled using 21921the command-line option `-mno-fused-madd'. 21922 21923 21924File: gcc.info, Node: Paired-Single Built-in Functions, Next: MIPS-3D Built-in Functions, Prev: Paired-Single Arithmetic, Up: MIPS Paired-Single Support 21925 219265.48.7.2 Paired-Single Built-in Functions 21927......................................... 21928 21929The following paired-single functions map directly to a particular MIPS 21930instruction. Please refer to the architecture specification for 21931details on what each instruction does. 21932 21933`v2sf __builtin_mips_pll_ps (v2sf, v2sf)' 21934 Pair lower lower (`pll.ps'). 21935 21936`v2sf __builtin_mips_pul_ps (v2sf, v2sf)' 21937 Pair upper lower (`pul.ps'). 21938 21939`v2sf __builtin_mips_plu_ps (v2sf, v2sf)' 21940 Pair lower upper (`plu.ps'). 21941 21942`v2sf __builtin_mips_puu_ps (v2sf, v2sf)' 21943 Pair upper upper (`puu.ps'). 21944 21945`v2sf __builtin_mips_cvt_ps_s (float, float)' 21946 Convert pair to paired single (`cvt.ps.s'). 21947 21948`float __builtin_mips_cvt_s_pl (v2sf)' 21949 Convert pair lower to single (`cvt.s.pl'). 21950 21951`float __builtin_mips_cvt_s_pu (v2sf)' 21952 Convert pair upper to single (`cvt.s.pu'). 21953 21954`v2sf __builtin_mips_abs_ps (v2sf)' 21955 Absolute value (`abs.ps'). 21956 21957`v2sf __builtin_mips_alnv_ps (v2sf, v2sf, int)' 21958 Align variable (`alnv.ps'). 21959 21960 _Note:_ The value of the third parameter must be 0 or 4 modulo 8, 21961 otherwise the result will be unpredictable. Please read the 21962 instruction description for details. 21963 21964 The following multi-instruction functions are also available. In each 21965case, COND can be any of the 16 floating-point conditions: `f', `un', 21966`eq', `ueq', `olt', `ult', `ole', `ule', `sf', `ngle', `seq', `ngl', 21967`lt', `nge', `le' or `ngt'. 21968 21969`v2sf __builtin_mips_movt_c_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)' 21970`v2sf __builtin_mips_movf_c_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)' 21971 Conditional move based on floating point comparison (`c.COND.ps', 21972 `movt.ps'/`movf.ps'). 21973 21974 The `movt' functions return the value X computed by: 21975 21976 c.COND.ps CC,A,B 21977 mov.ps X,C 21978 movt.ps X,D,CC 21979 21980 The `movf' functions are similar but use `movf.ps' instead of 21981 `movt.ps'. 21982 21983`int __builtin_mips_upper_c_COND_ps (v2sf A, v2sf B)' 21984`int __builtin_mips_lower_c_COND_ps (v2sf A, v2sf B)' 21985 Comparison of two paired-single values (`c.COND.ps', 21986 `bc1t'/`bc1f'). 21987 21988 These functions compare A and B using `c.COND.ps' and return 21989 either the upper or lower half of the result. For example: 21990 21991 v2sf a, b; 21992 if (__builtin_mips_upper_c_eq_ps (a, b)) 21993 upper_halves_are_equal (); 21994 else 21995 upper_halves_are_unequal (); 21996 21997 if (__builtin_mips_lower_c_eq_ps (a, b)) 21998 lower_halves_are_equal (); 21999 else 22000 lower_halves_are_unequal (); 22001 22002 22003File: gcc.info, Node: MIPS-3D Built-in Functions, Prev: Paired-Single Built-in Functions, Up: MIPS Paired-Single Support 22004 220055.48.7.3 MIPS-3D Built-in Functions 22006................................... 22007 22008The MIPS-3D Application-Specific Extension (ASE) includes additional 22009paired-single instructions that are designed to improve the performance 22010of 3D graphics operations. Support for these instructions is controlled 22011by the `-mips3d' command-line option. 22012 22013 The functions listed below map directly to a particular MIPS-3D 22014instruction. Please refer to the architecture specification for more 22015details on what each instruction does. 22016 22017`v2sf __builtin_mips_addr_ps (v2sf, v2sf)' 22018 Reduction add (`addr.ps'). 22019 22020`v2sf __builtin_mips_mulr_ps (v2sf, v2sf)' 22021 Reduction multiply (`mulr.ps'). 22022 22023`v2sf __builtin_mips_cvt_pw_ps (v2sf)' 22024 Convert paired single to paired word (`cvt.pw.ps'). 22025 22026`v2sf __builtin_mips_cvt_ps_pw (v2sf)' 22027 Convert paired word to paired single (`cvt.ps.pw'). 22028 22029`float __builtin_mips_recip1_s (float)' 22030`double __builtin_mips_recip1_d (double)' 22031`v2sf __builtin_mips_recip1_ps (v2sf)' 22032 Reduced precision reciprocal (sequence step 1) (`recip1.FMT'). 22033 22034`float __builtin_mips_recip2_s (float, float)' 22035`double __builtin_mips_recip2_d (double, double)' 22036`v2sf __builtin_mips_recip2_ps (v2sf, v2sf)' 22037 Reduced precision reciprocal (sequence step 2) (`recip2.FMT'). 22038 22039`float __builtin_mips_rsqrt1_s (float)' 22040`double __builtin_mips_rsqrt1_d (double)' 22041`v2sf __builtin_mips_rsqrt1_ps (v2sf)' 22042 Reduced precision reciprocal square root (sequence step 1) 22043 (`rsqrt1.FMT'). 22044 22045`float __builtin_mips_rsqrt2_s (float, float)' 22046`double __builtin_mips_rsqrt2_d (double, double)' 22047`v2sf __builtin_mips_rsqrt2_ps (v2sf, v2sf)' 22048 Reduced precision reciprocal square root (sequence step 2) 22049 (`rsqrt2.FMT'). 22050 22051 The following multi-instruction functions are also available. In each 22052case, COND can be any of the 16 floating-point conditions: `f', `un', 22053`eq', `ueq', `olt', `ult', `ole', `ule', `sf', `ngle', `seq', `ngl', 22054`lt', `nge', `le' or `ngt'. 22055 22056`int __builtin_mips_cabs_COND_s (float A, float B)' 22057`int __builtin_mips_cabs_COND_d (double A, double B)' 22058 Absolute comparison of two scalar values (`cabs.COND.FMT', 22059 `bc1t'/`bc1f'). 22060 22061 These functions compare A and B using `cabs.COND.s' or 22062 `cabs.COND.d' and return the result as a boolean value. For 22063 example: 22064 22065 float a, b; 22066 if (__builtin_mips_cabs_eq_s (a, b)) 22067 true (); 22068 else 22069 false (); 22070 22071`int __builtin_mips_upper_cabs_COND_ps (v2sf A, v2sf B)' 22072`int __builtin_mips_lower_cabs_COND_ps (v2sf A, v2sf B)' 22073 Absolute comparison of two paired-single values (`cabs.COND.ps', 22074 `bc1t'/`bc1f'). 22075 22076 These functions compare A and B using `cabs.COND.ps' and return 22077 either the upper or lower half of the result. For example: 22078 22079 v2sf a, b; 22080 if (__builtin_mips_upper_cabs_eq_ps (a, b)) 22081 upper_halves_are_equal (); 22082 else 22083 upper_halves_are_unequal (); 22084 22085 if (__builtin_mips_lower_cabs_eq_ps (a, b)) 22086 lower_halves_are_equal (); 22087 else 22088 lower_halves_are_unequal (); 22089 22090`v2sf __builtin_mips_movt_cabs_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)' 22091`v2sf __builtin_mips_movf_cabs_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)' 22092 Conditional move based on absolute comparison (`cabs.COND.ps', 22093 `movt.ps'/`movf.ps'). 22094 22095 The `movt' functions return the value X computed by: 22096 22097 cabs.COND.ps CC,A,B 22098 mov.ps X,C 22099 movt.ps X,D,CC 22100 22101 The `movf' functions are similar but use `movf.ps' instead of 22102 `movt.ps'. 22103 22104`int __builtin_mips_any_c_COND_ps (v2sf A, v2sf B)' 22105`int __builtin_mips_all_c_COND_ps (v2sf A, v2sf B)' 22106`int __builtin_mips_any_cabs_COND_ps (v2sf A, v2sf B)' 22107`int __builtin_mips_all_cabs_COND_ps (v2sf A, v2sf B)' 22108 Comparison of two paired-single values (`c.COND.ps'/`cabs.COND.ps', 22109 `bc1any2t'/`bc1any2f'). 22110 22111 These functions compare A and B using `c.COND.ps' or 22112 `cabs.COND.ps'. The `any' forms return true if either result is 22113 true and the `all' forms return true if both results are true. 22114 For example: 22115 22116 v2sf a, b; 22117 if (__builtin_mips_any_c_eq_ps (a, b)) 22118 one_is_true (); 22119 else 22120 both_are_false (); 22121 22122 if (__builtin_mips_all_c_eq_ps (a, b)) 22123 both_are_true (); 22124 else 22125 one_is_false (); 22126 22127`int __builtin_mips_any_c_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)' 22128`int __builtin_mips_all_c_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)' 22129`int __builtin_mips_any_cabs_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)' 22130`int __builtin_mips_all_cabs_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)' 22131 Comparison of four paired-single values 22132 (`c.COND.ps'/`cabs.COND.ps', `bc1any4t'/`bc1any4f'). 22133 22134 These functions use `c.COND.ps' or `cabs.COND.ps' to compare A 22135 with B and to compare C with D. The `any' forms return true if 22136 any of the four results are true and the `all' forms return true 22137 if all four results are true. For example: 22138 22139 v2sf a, b, c, d; 22140 if (__builtin_mips_any_c_eq_4s (a, b, c, d)) 22141 some_are_true (); 22142 else 22143 all_are_false (); 22144 22145 if (__builtin_mips_all_c_eq_4s (a, b, c, d)) 22146 all_are_true (); 22147 else 22148 some_are_false (); 22149 22150 22151File: gcc.info, Node: PowerPC AltiVec Built-in Functions, Next: SPARC VIS Built-in Functions, Prev: MIPS Paired-Single Support, Up: Target Builtins 22152 221535.48.8 PowerPC AltiVec Built-in Functions 22154----------------------------------------- 22155 22156GCC provides an interface for the PowerPC family of processors to access 22157the AltiVec operations described in Motorola's AltiVec Programming 22158Interface Manual. The interface is made available by including 22159`<altivec.h>' and using `-maltivec' and `-mabi=altivec'. The interface 22160supports the following vector types. 22161 22162 vector unsigned char 22163 vector signed char 22164 vector bool char 22165 22166 vector unsigned short 22167 vector signed short 22168 vector bool short 22169 vector pixel 22170 22171 vector unsigned int 22172 vector signed int 22173 vector bool int 22174 vector float 22175 22176 GCC's implementation of the high-level language interface available 22177from C and C++ code differs from Motorola's documentation in several 22178ways. 22179 22180 * A vector constant is a list of constant expressions within curly 22181 braces. 22182 22183 * A vector initializer requires no cast if the vector constant is of 22184 the same type as the variable it is initializing. 22185 22186 * If `signed' or `unsigned' is omitted, the signedness of the vector 22187 type is the default signedness of the base type. The default 22188 varies depending on the operating system, so a portable program 22189 should always specify the signedness. 22190 22191 * Compiling with `-maltivec' adds keywords `__vector', `__pixel', 22192 and `__bool'. Macros `vector', `pixel', and `bool' are defined in 22193 `<altivec.h>' and can be undefined. 22194 22195 * GCC allows using a `typedef' name as the type specifier for a 22196 vector type. 22197 22198 * For C, overloaded functions are implemented with macros so the 22199 following does not work: 22200 22201 vec_add ((vector signed int){1, 2, 3, 4}, foo); 22202 22203 Since `vec_add' is a macro, the vector constant in the example is 22204 treated as four separate arguments. Wrap the entire argument in 22205 parentheses for this to work. 22206 22207 _Note:_ Only the `<altivec.h>' interface is supported. Internally, 22208GCC uses built-in functions to achieve the functionality in the 22209aforementioned header file, but they are not supported and are subject 22210to change without notice. 22211 22212 The following interfaces are supported for the generic and specific 22213AltiVec operations and the AltiVec predicates. In cases where there is 22214a direct mapping between generic and specific operations, only the 22215generic names are shown here, although the specific operations can also 22216be used. 22217 22218 Arguments that are documented as `const int' require literal integral 22219values within the range required for that operation. 22220 22221 vector signed char vec_abs (vector signed char); 22222 vector signed short vec_abs (vector signed short); 22223 vector signed int vec_abs (vector signed int); 22224 vector float vec_abs (vector float); 22225 22226 vector signed char vec_abss (vector signed char); 22227 vector signed short vec_abss (vector signed short); 22228 vector signed int vec_abss (vector signed int); 22229 22230 vector signed char vec_add (vector bool char, vector signed char); 22231 vector signed char vec_add (vector signed char, vector bool char); 22232 vector signed char vec_add (vector signed char, vector signed char); 22233 vector unsigned char vec_add (vector bool char, vector unsigned char); 22234 vector unsigned char vec_add (vector unsigned char, vector bool char); 22235 vector unsigned char vec_add (vector unsigned char, 22236 vector unsigned char); 22237 vector signed short vec_add (vector bool short, vector signed short); 22238 vector signed short vec_add (vector signed short, vector bool short); 22239 vector signed short vec_add (vector signed short, vector signed short); 22240 vector unsigned short vec_add (vector bool short, 22241 vector unsigned short); 22242 vector unsigned short vec_add (vector unsigned short, 22243 vector bool short); 22244 vector unsigned short vec_add (vector unsigned short, 22245 vector unsigned short); 22246 vector signed int vec_add (vector bool int, vector signed int); 22247 vector signed int vec_add (vector signed int, vector bool int); 22248 vector signed int vec_add (vector signed int, vector signed int); 22249 vector unsigned int vec_add (vector bool int, vector unsigned int); 22250 vector unsigned int vec_add (vector unsigned int, vector bool int); 22251 vector unsigned int vec_add (vector unsigned int, vector unsigned int); 22252 vector float vec_add (vector float, vector float); 22253 22254 vector float vec_vaddfp (vector float, vector float); 22255 22256 vector signed int vec_vadduwm (vector bool int, vector signed int); 22257 vector signed int vec_vadduwm (vector signed int, vector bool int); 22258 vector signed int vec_vadduwm (vector signed int, vector signed int); 22259 vector unsigned int vec_vadduwm (vector bool int, vector unsigned int); 22260 vector unsigned int vec_vadduwm (vector unsigned int, vector bool int); 22261 vector unsigned int vec_vadduwm (vector unsigned int, 22262 vector unsigned int); 22263 22264 vector signed short vec_vadduhm (vector bool short, 22265 vector signed short); 22266 vector signed short vec_vadduhm (vector signed short, 22267 vector bool short); 22268 vector signed short vec_vadduhm (vector signed short, 22269 vector signed short); 22270 vector unsigned short vec_vadduhm (vector bool short, 22271 vector unsigned short); 22272 vector unsigned short vec_vadduhm (vector unsigned short, 22273 vector bool short); 22274 vector unsigned short vec_vadduhm (vector unsigned short, 22275 vector unsigned short); 22276 22277 vector signed char vec_vaddubm (vector bool char, vector signed char); 22278 vector signed char vec_vaddubm (vector signed char, vector bool char); 22279 vector signed char vec_vaddubm (vector signed char, vector signed char); 22280 vector unsigned char vec_vaddubm (vector bool char, 22281 vector unsigned char); 22282 vector unsigned char vec_vaddubm (vector unsigned char, 22283 vector bool char); 22284 vector unsigned char vec_vaddubm (vector unsigned char, 22285 vector unsigned char); 22286 22287 vector unsigned int vec_addc (vector unsigned int, vector unsigned int); 22288 22289 vector unsigned char vec_adds (vector bool char, vector unsigned char); 22290 vector unsigned char vec_adds (vector unsigned char, vector bool char); 22291 vector unsigned char vec_adds (vector unsigned char, 22292 vector unsigned char); 22293 vector signed char vec_adds (vector bool char, vector signed char); 22294 vector signed char vec_adds (vector signed char, vector bool char); 22295 vector signed char vec_adds (vector signed char, vector signed char); 22296 vector unsigned short vec_adds (vector bool short, 22297 vector unsigned short); 22298 vector unsigned short vec_adds (vector unsigned short, 22299 vector bool short); 22300 vector unsigned short vec_adds (vector unsigned short, 22301 vector unsigned short); 22302 vector signed short vec_adds (vector bool short, vector signed short); 22303 vector signed short vec_adds (vector signed short, vector bool short); 22304 vector signed short vec_adds (vector signed short, vector signed short); 22305 vector unsigned int vec_adds (vector bool int, vector unsigned int); 22306 vector unsigned int vec_adds (vector unsigned int, vector bool int); 22307 vector unsigned int vec_adds (vector unsigned int, vector unsigned int); 22308 vector signed int vec_adds (vector bool int, vector signed int); 22309 vector signed int vec_adds (vector signed int, vector bool int); 22310 vector signed int vec_adds (vector signed int, vector signed int); 22311 22312 vector signed int vec_vaddsws (vector bool int, vector signed int); 22313 vector signed int vec_vaddsws (vector signed int, vector bool int); 22314 vector signed int vec_vaddsws (vector signed int, vector signed int); 22315 22316 vector unsigned int vec_vadduws (vector bool int, vector unsigned int); 22317 vector unsigned int vec_vadduws (vector unsigned int, vector bool int); 22318 vector unsigned int vec_vadduws (vector unsigned int, 22319 vector unsigned int); 22320 22321 vector signed short vec_vaddshs (vector bool short, 22322 vector signed short); 22323 vector signed short vec_vaddshs (vector signed short, 22324 vector bool short); 22325 vector signed short vec_vaddshs (vector signed short, 22326 vector signed short); 22327 22328 vector unsigned short vec_vadduhs (vector bool short, 22329 vector unsigned short); 22330 vector unsigned short vec_vadduhs (vector unsigned short, 22331 vector bool short); 22332 vector unsigned short vec_vadduhs (vector unsigned short, 22333 vector unsigned short); 22334 22335 vector signed char vec_vaddsbs (vector bool char, vector signed char); 22336 vector signed char vec_vaddsbs (vector signed char, vector bool char); 22337 vector signed char vec_vaddsbs (vector signed char, vector signed char); 22338 22339 vector unsigned char vec_vaddubs (vector bool char, 22340 vector unsigned char); 22341 vector unsigned char vec_vaddubs (vector unsigned char, 22342 vector bool char); 22343 vector unsigned char vec_vaddubs (vector unsigned char, 22344 vector unsigned char); 22345 22346 vector float vec_and (vector float, vector float); 22347 vector float vec_and (vector float, vector bool int); 22348 vector float vec_and (vector bool int, vector float); 22349 vector bool int vec_and (vector bool int, vector bool int); 22350 vector signed int vec_and (vector bool int, vector signed int); 22351 vector signed int vec_and (vector signed int, vector bool int); 22352 vector signed int vec_and (vector signed int, vector signed int); 22353 vector unsigned int vec_and (vector bool int, vector unsigned int); 22354 vector unsigned int vec_and (vector unsigned int, vector bool int); 22355 vector unsigned int vec_and (vector unsigned int, vector unsigned int); 22356 vector bool short vec_and (vector bool short, vector bool short); 22357 vector signed short vec_and (vector bool short, vector signed short); 22358 vector signed short vec_and (vector signed short, vector bool short); 22359 vector signed short vec_and (vector signed short, vector signed short); 22360 vector unsigned short vec_and (vector bool short, 22361 vector unsigned short); 22362 vector unsigned short vec_and (vector unsigned short, 22363 vector bool short); 22364 vector unsigned short vec_and (vector unsigned short, 22365 vector unsigned short); 22366 vector signed char vec_and (vector bool char, vector signed char); 22367 vector bool char vec_and (vector bool char, vector bool char); 22368 vector signed char vec_and (vector signed char, vector bool char); 22369 vector signed char vec_and (vector signed char, vector signed char); 22370 vector unsigned char vec_and (vector bool char, vector unsigned char); 22371 vector unsigned char vec_and (vector unsigned char, vector bool char); 22372 vector unsigned char vec_and (vector unsigned char, 22373 vector unsigned char); 22374 22375 vector float vec_andc (vector float, vector float); 22376 vector float vec_andc (vector float, vector bool int); 22377 vector float vec_andc (vector bool int, vector float); 22378 vector bool int vec_andc (vector bool int, vector bool int); 22379 vector signed int vec_andc (vector bool int, vector signed int); 22380 vector signed int vec_andc (vector signed int, vector bool int); 22381 vector signed int vec_andc (vector signed int, vector signed int); 22382 vector unsigned int vec_andc (vector bool int, vector unsigned int); 22383 vector unsigned int vec_andc (vector unsigned int, vector bool int); 22384 vector unsigned int vec_andc (vector unsigned int, vector unsigned int); 22385 vector bool short vec_andc (vector bool short, vector bool short); 22386 vector signed short vec_andc (vector bool short, vector signed short); 22387 vector signed short vec_andc (vector signed short, vector bool short); 22388 vector signed short vec_andc (vector signed short, vector signed short); 22389 vector unsigned short vec_andc (vector bool short, 22390 vector unsigned short); 22391 vector unsigned short vec_andc (vector unsigned short, 22392 vector bool short); 22393 vector unsigned short vec_andc (vector unsigned short, 22394 vector unsigned short); 22395 vector signed char vec_andc (vector bool char, vector signed char); 22396 vector bool char vec_andc (vector bool char, vector bool char); 22397 vector signed char vec_andc (vector signed char, vector bool char); 22398 vector signed char vec_andc (vector signed char, vector signed char); 22399 vector unsigned char vec_andc (vector bool char, vector unsigned char); 22400 vector unsigned char vec_andc (vector unsigned char, vector bool char); 22401 vector unsigned char vec_andc (vector unsigned char, 22402 vector unsigned char); 22403 22404 vector unsigned char vec_avg (vector unsigned char, 22405 vector unsigned char); 22406 vector signed char vec_avg (vector signed char, vector signed char); 22407 vector unsigned short vec_avg (vector unsigned short, 22408 vector unsigned short); 22409 vector signed short vec_avg (vector signed short, vector signed short); 22410 vector unsigned int vec_avg (vector unsigned int, vector unsigned int); 22411 vector signed int vec_avg (vector signed int, vector signed int); 22412 22413 vector signed int vec_vavgsw (vector signed int, vector signed int); 22414 22415 vector unsigned int vec_vavguw (vector unsigned int, 22416 vector unsigned int); 22417 22418 vector signed short vec_vavgsh (vector signed short, 22419 vector signed short); 22420 22421 vector unsigned short vec_vavguh (vector unsigned short, 22422 vector unsigned short); 22423 22424 vector signed char vec_vavgsb (vector signed char, vector signed char); 22425 22426 vector unsigned char vec_vavgub (vector unsigned char, 22427 vector unsigned char); 22428 22429 vector float vec_ceil (vector float); 22430 22431 vector signed int vec_cmpb (vector float, vector float); 22432 22433 vector bool char vec_cmpeq (vector signed char, vector signed char); 22434 vector bool char vec_cmpeq (vector unsigned char, vector unsigned char); 22435 vector bool short vec_cmpeq (vector signed short, vector signed short); 22436 vector bool short vec_cmpeq (vector unsigned short, 22437 vector unsigned short); 22438 vector bool int vec_cmpeq (vector signed int, vector signed int); 22439 vector bool int vec_cmpeq (vector unsigned int, vector unsigned int); 22440 vector bool int vec_cmpeq (vector float, vector float); 22441 22442 vector bool int vec_vcmpeqfp (vector float, vector float); 22443 22444 vector bool int vec_vcmpequw (vector signed int, vector signed int); 22445 vector bool int vec_vcmpequw (vector unsigned int, vector unsigned int); 22446 22447 vector bool short vec_vcmpequh (vector signed short, 22448 vector signed short); 22449 vector bool short vec_vcmpequh (vector unsigned short, 22450 vector unsigned short); 22451 22452 vector bool char vec_vcmpequb (vector signed char, vector signed char); 22453 vector bool char vec_vcmpequb (vector unsigned char, 22454 vector unsigned char); 22455 22456 vector bool int vec_cmpge (vector float, vector float); 22457 22458 vector bool char vec_cmpgt (vector unsigned char, vector unsigned char); 22459 vector bool char vec_cmpgt (vector signed char, vector signed char); 22460 vector bool short vec_cmpgt (vector unsigned short, 22461 vector unsigned short); 22462 vector bool short vec_cmpgt (vector signed short, vector signed short); 22463 vector bool int vec_cmpgt (vector unsigned int, vector unsigned int); 22464 vector bool int vec_cmpgt (vector signed int, vector signed int); 22465 vector bool int vec_cmpgt (vector float, vector float); 22466 22467 vector bool int vec_vcmpgtfp (vector float, vector float); 22468 22469 vector bool int vec_vcmpgtsw (vector signed int, vector signed int); 22470 22471 vector bool int vec_vcmpgtuw (vector unsigned int, vector unsigned int); 22472 22473 vector bool short vec_vcmpgtsh (vector signed short, 22474 vector signed short); 22475 22476 vector bool short vec_vcmpgtuh (vector unsigned short, 22477 vector unsigned short); 22478 22479 vector bool char vec_vcmpgtsb (vector signed char, vector signed char); 22480 22481 vector bool char vec_vcmpgtub (vector unsigned char, 22482 vector unsigned char); 22483 22484 vector bool int vec_cmple (vector float, vector float); 22485 22486 vector bool char vec_cmplt (vector unsigned char, vector unsigned char); 22487 vector bool char vec_cmplt (vector signed char, vector signed char); 22488 vector bool short vec_cmplt (vector unsigned short, 22489 vector unsigned short); 22490 vector bool short vec_cmplt (vector signed short, vector signed short); 22491 vector bool int vec_cmplt (vector unsigned int, vector unsigned int); 22492 vector bool int vec_cmplt (vector signed int, vector signed int); 22493 vector bool int vec_cmplt (vector float, vector float); 22494 22495 vector float vec_ctf (vector unsigned int, const int); 22496 vector float vec_ctf (vector signed int, const int); 22497 22498 vector float vec_vcfsx (vector signed int, const int); 22499 22500 vector float vec_vcfux (vector unsigned int, const int); 22501 22502 vector signed int vec_cts (vector float, const int); 22503 22504 vector unsigned int vec_ctu (vector float, const int); 22505 22506 void vec_dss (const int); 22507 22508 void vec_dssall (void); 22509 22510 void vec_dst (const vector unsigned char *, int, const int); 22511 void vec_dst (const vector signed char *, int, const int); 22512 void vec_dst (const vector bool char *, int, const int); 22513 void vec_dst (const vector unsigned short *, int, const int); 22514 void vec_dst (const vector signed short *, int, const int); 22515 void vec_dst (const vector bool short *, int, const int); 22516 void vec_dst (const vector pixel *, int, const int); 22517 void vec_dst (const vector unsigned int *, int, const int); 22518 void vec_dst (const vector signed int *, int, const int); 22519 void vec_dst (const vector bool int *, int, const int); 22520 void vec_dst (const vector float *, int, const int); 22521 void vec_dst (const unsigned char *, int, const int); 22522 void vec_dst (const signed char *, int, const int); 22523 void vec_dst (const unsigned short *, int, const int); 22524 void vec_dst (const short *, int, const int); 22525 void vec_dst (const unsigned int *, int, const int); 22526 void vec_dst (const int *, int, const int); 22527 void vec_dst (const unsigned long *, int, const int); 22528 void vec_dst (const long *, int, const int); 22529 void vec_dst (const float *, int, const int); 22530 22531 void vec_dstst (const vector unsigned char *, int, const int); 22532 void vec_dstst (const vector signed char *, int, const int); 22533 void vec_dstst (const vector bool char *, int, const int); 22534 void vec_dstst (const vector unsigned short *, int, const int); 22535 void vec_dstst (const vector signed short *, int, const int); 22536 void vec_dstst (const vector bool short *, int, const int); 22537 void vec_dstst (const vector pixel *, int, const int); 22538 void vec_dstst (const vector unsigned int *, int, const int); 22539 void vec_dstst (const vector signed int *, int, const int); 22540 void vec_dstst (const vector bool int *, int, const int); 22541 void vec_dstst (const vector float *, int, const int); 22542 void vec_dstst (const unsigned char *, int, const int); 22543 void vec_dstst (const signed char *, int, const int); 22544 void vec_dstst (const unsigned short *, int, const int); 22545 void vec_dstst (const short *, int, const int); 22546 void vec_dstst (const unsigned int *, int, const int); 22547 void vec_dstst (const int *, int, const int); 22548 void vec_dstst (const unsigned long *, int, const int); 22549 void vec_dstst (const long *, int, const int); 22550 void vec_dstst (const float *, int, const int); 22551 22552 void vec_dststt (const vector unsigned char *, int, const int); 22553 void vec_dststt (const vector signed char *, int, const int); 22554 void vec_dststt (const vector bool char *, int, const int); 22555 void vec_dststt (const vector unsigned short *, int, const int); 22556 void vec_dststt (const vector signed short *, int, const int); 22557 void vec_dststt (const vector bool short *, int, const int); 22558 void vec_dststt (const vector pixel *, int, const int); 22559 void vec_dststt (const vector unsigned int *, int, const int); 22560 void vec_dststt (const vector signed int *, int, const int); 22561 void vec_dststt (const vector bool int *, int, const int); 22562 void vec_dststt (const vector float *, int, const int); 22563 void vec_dststt (const unsigned char *, int, const int); 22564 void vec_dststt (const signed char *, int, const int); 22565 void vec_dststt (const unsigned short *, int, const int); 22566 void vec_dststt (const short *, int, const int); 22567 void vec_dststt (const unsigned int *, int, const int); 22568 void vec_dststt (const int *, int, const int); 22569 void vec_dststt (const unsigned long *, int, const int); 22570 void vec_dststt (const long *, int, const int); 22571 void vec_dststt (const float *, int, const int); 22572 22573 void vec_dstt (const vector unsigned char *, int, const int); 22574 void vec_dstt (const vector signed char *, int, const int); 22575 void vec_dstt (const vector bool char *, int, const int); 22576 void vec_dstt (const vector unsigned short *, int, const int); 22577 void vec_dstt (const vector signed short *, int, const int); 22578 void vec_dstt (const vector bool short *, int, const int); 22579 void vec_dstt (const vector pixel *, int, const int); 22580 void vec_dstt (const vector unsigned int *, int, const int); 22581 void vec_dstt (const vector signed int *, int, const int); 22582 void vec_dstt (const vector bool int *, int, const int); 22583 void vec_dstt (const vector float *, int, const int); 22584 void vec_dstt (const unsigned char *, int, const int); 22585 void vec_dstt (const signed char *, int, const int); 22586 void vec_dstt (const unsigned short *, int, const int); 22587 void vec_dstt (const short *, int, const int); 22588 void vec_dstt (const unsigned int *, int, const int); 22589 void vec_dstt (const int *, int, const int); 22590 void vec_dstt (const unsigned long *, int, const int); 22591 void vec_dstt (const long *, int, const int); 22592 void vec_dstt (const float *, int, const int); 22593 22594 vector float vec_expte (vector float); 22595 22596 vector float vec_floor (vector float); 22597 22598 vector float vec_ld (int, const vector float *); 22599 vector float vec_ld (int, const float *); 22600 vector bool int vec_ld (int, const vector bool int *); 22601 vector signed int vec_ld (int, const vector signed int *); 22602 vector signed int vec_ld (int, const int *); 22603 vector signed int vec_ld (int, const long *); 22604 vector unsigned int vec_ld (int, const vector unsigned int *); 22605 vector unsigned int vec_ld (int, const unsigned int *); 22606 vector unsigned int vec_ld (int, const unsigned long *); 22607 vector bool short vec_ld (int, const vector bool short *); 22608 vector pixel vec_ld (int, const vector pixel *); 22609 vector signed short vec_ld (int, const vector signed short *); 22610 vector signed short vec_ld (int, const short *); 22611 vector unsigned short vec_ld (int, const vector unsigned short *); 22612 vector unsigned short vec_ld (int, const unsigned short *); 22613 vector bool char vec_ld (int, const vector bool char *); 22614 vector signed char vec_ld (int, const vector signed char *); 22615 vector signed char vec_ld (int, const signed char *); 22616 vector unsigned char vec_ld (int, const vector unsigned char *); 22617 vector unsigned char vec_ld (int, const unsigned char *); 22618 22619 vector signed char vec_lde (int, const signed char *); 22620 vector unsigned char vec_lde (int, const unsigned char *); 22621 vector signed short vec_lde (int, const short *); 22622 vector unsigned short vec_lde (int, const unsigned short *); 22623 vector float vec_lde (int, const float *); 22624 vector signed int vec_lde (int, const int *); 22625 vector unsigned int vec_lde (int, const unsigned int *); 22626 vector signed int vec_lde (int, const long *); 22627 vector unsigned int vec_lde (int, const unsigned long *); 22628 22629 vector float vec_lvewx (int, float *); 22630 vector signed int vec_lvewx (int, int *); 22631 vector unsigned int vec_lvewx (int, unsigned int *); 22632 vector signed int vec_lvewx (int, long *); 22633 vector unsigned int vec_lvewx (int, unsigned long *); 22634 22635 vector signed short vec_lvehx (int, short *); 22636 vector unsigned short vec_lvehx (int, unsigned short *); 22637 22638 vector signed char vec_lvebx (int, char *); 22639 vector unsigned char vec_lvebx (int, unsigned char *); 22640 22641 vector float vec_ldl (int, const vector float *); 22642 vector float vec_ldl (int, const float *); 22643 vector bool int vec_ldl (int, const vector bool int *); 22644 vector signed int vec_ldl (int, const vector signed int *); 22645 vector signed int vec_ldl (int, const int *); 22646 vector signed int vec_ldl (int, const long *); 22647 vector unsigned int vec_ldl (int, const vector unsigned int *); 22648 vector unsigned int vec_ldl (int, const unsigned int *); 22649 vector unsigned int vec_ldl (int, const unsigned long *); 22650 vector bool short vec_ldl (int, const vector bool short *); 22651 vector pixel vec_ldl (int, const vector pixel *); 22652 vector signed short vec_ldl (int, const vector signed short *); 22653 vector signed short vec_ldl (int, const short *); 22654 vector unsigned short vec_ldl (int, const vector unsigned short *); 22655 vector unsigned short vec_ldl (int, const unsigned short *); 22656 vector bool char vec_ldl (int, const vector bool char *); 22657 vector signed char vec_ldl (int, const vector signed char *); 22658 vector signed char vec_ldl (int, const signed char *); 22659 vector unsigned char vec_ldl (int, const vector unsigned char *); 22660 vector unsigned char vec_ldl (int, const unsigned char *); 22661 22662 vector float vec_loge (vector float); 22663 22664 vector unsigned char vec_lvsl (int, const volatile unsigned char *); 22665 vector unsigned char vec_lvsl (int, const volatile signed char *); 22666 vector unsigned char vec_lvsl (int, const volatile unsigned short *); 22667 vector unsigned char vec_lvsl (int, const volatile short *); 22668 vector unsigned char vec_lvsl (int, const volatile unsigned int *); 22669 vector unsigned char vec_lvsl (int, const volatile int *); 22670 vector unsigned char vec_lvsl (int, const volatile unsigned long *); 22671 vector unsigned char vec_lvsl (int, const volatile long *); 22672 vector unsigned char vec_lvsl (int, const volatile float *); 22673 22674 vector unsigned char vec_lvsr (int, const volatile unsigned char *); 22675 vector unsigned char vec_lvsr (int, const volatile signed char *); 22676 vector unsigned char vec_lvsr (int, const volatile unsigned short *); 22677 vector unsigned char vec_lvsr (int, const volatile short *); 22678 vector unsigned char vec_lvsr (int, const volatile unsigned int *); 22679 vector unsigned char vec_lvsr (int, const volatile int *); 22680 vector unsigned char vec_lvsr (int, const volatile unsigned long *); 22681 vector unsigned char vec_lvsr (int, const volatile long *); 22682 vector unsigned char vec_lvsr (int, const volatile float *); 22683 22684 vector float vec_madd (vector float, vector float, vector float); 22685 22686 vector signed short vec_madds (vector signed short, 22687 vector signed short, 22688 vector signed short); 22689 22690 vector unsigned char vec_max (vector bool char, vector unsigned char); 22691 vector unsigned char vec_max (vector unsigned char, vector bool char); 22692 vector unsigned char vec_max (vector unsigned char, 22693 vector unsigned char); 22694 vector signed char vec_max (vector bool char, vector signed char); 22695 vector signed char vec_max (vector signed char, vector bool char); 22696 vector signed char vec_max (vector signed char, vector signed char); 22697 vector unsigned short vec_max (vector bool short, 22698 vector unsigned short); 22699 vector unsigned short vec_max (vector unsigned short, 22700 vector bool short); 22701 vector unsigned short vec_max (vector unsigned short, 22702 vector unsigned short); 22703 vector signed short vec_max (vector bool short, vector signed short); 22704 vector signed short vec_max (vector signed short, vector bool short); 22705 vector signed short vec_max (vector signed short, vector signed short); 22706 vector unsigned int vec_max (vector bool int, vector unsigned int); 22707 vector unsigned int vec_max (vector unsigned int, vector bool int); 22708 vector unsigned int vec_max (vector unsigned int, vector unsigned int); 22709 vector signed int vec_max (vector bool int, vector signed int); 22710 vector signed int vec_max (vector signed int, vector bool int); 22711 vector signed int vec_max (vector signed int, vector signed int); 22712 vector float vec_max (vector float, vector float); 22713 22714 vector float vec_vmaxfp (vector float, vector float); 22715 22716 vector signed int vec_vmaxsw (vector bool int, vector signed int); 22717 vector signed int vec_vmaxsw (vector signed int, vector bool int); 22718 vector signed int vec_vmaxsw (vector signed int, vector signed int); 22719 22720 vector unsigned int vec_vmaxuw (vector bool int, vector unsigned int); 22721 vector unsigned int vec_vmaxuw (vector unsigned int, vector bool int); 22722 vector unsigned int vec_vmaxuw (vector unsigned int, 22723 vector unsigned int); 22724 22725 vector signed short vec_vmaxsh (vector bool short, vector signed short); 22726 vector signed short vec_vmaxsh (vector signed short, vector bool short); 22727 vector signed short vec_vmaxsh (vector signed short, 22728 vector signed short); 22729 22730 vector unsigned short vec_vmaxuh (vector bool short, 22731 vector unsigned short); 22732 vector unsigned short vec_vmaxuh (vector unsigned short, 22733 vector bool short); 22734 vector unsigned short vec_vmaxuh (vector unsigned short, 22735 vector unsigned short); 22736 22737 vector signed char vec_vmaxsb (vector bool char, vector signed char); 22738 vector signed char vec_vmaxsb (vector signed char, vector bool char); 22739 vector signed char vec_vmaxsb (vector signed char, vector signed char); 22740 22741 vector unsigned char vec_vmaxub (vector bool char, 22742 vector unsigned char); 22743 vector unsigned char vec_vmaxub (vector unsigned char, 22744 vector bool char); 22745 vector unsigned char vec_vmaxub (vector unsigned char, 22746 vector unsigned char); 22747 22748 vector bool char vec_mergeh (vector bool char, vector bool char); 22749 vector signed char vec_mergeh (vector signed char, vector signed char); 22750 vector unsigned char vec_mergeh (vector unsigned char, 22751 vector unsigned char); 22752 vector bool short vec_mergeh (vector bool short, vector bool short); 22753 vector pixel vec_mergeh (vector pixel, vector pixel); 22754 vector signed short vec_mergeh (vector signed short, 22755 vector signed short); 22756 vector unsigned short vec_mergeh (vector unsigned short, 22757 vector unsigned short); 22758 vector float vec_mergeh (vector float, vector float); 22759 vector bool int vec_mergeh (vector bool int, vector bool int); 22760 vector signed int vec_mergeh (vector signed int, vector signed int); 22761 vector unsigned int vec_mergeh (vector unsigned int, 22762 vector unsigned int); 22763 22764 vector float vec_vmrghw (vector float, vector float); 22765 vector bool int vec_vmrghw (vector bool int, vector bool int); 22766 vector signed int vec_vmrghw (vector signed int, vector signed int); 22767 vector unsigned int vec_vmrghw (vector unsigned int, 22768 vector unsigned int); 22769 22770 vector bool short vec_vmrghh (vector bool short, vector bool short); 22771 vector signed short vec_vmrghh (vector signed short, 22772 vector signed short); 22773 vector unsigned short vec_vmrghh (vector unsigned short, 22774 vector unsigned short); 22775 vector pixel vec_vmrghh (vector pixel, vector pixel); 22776 22777 vector bool char vec_vmrghb (vector bool char, vector bool char); 22778 vector signed char vec_vmrghb (vector signed char, vector signed char); 22779 vector unsigned char vec_vmrghb (vector unsigned char, 22780 vector unsigned char); 22781 22782 vector bool char vec_mergel (vector bool char, vector bool char); 22783 vector signed char vec_mergel (vector signed char, vector signed char); 22784 vector unsigned char vec_mergel (vector unsigned char, 22785 vector unsigned char); 22786 vector bool short vec_mergel (vector bool short, vector bool short); 22787 vector pixel vec_mergel (vector pixel, vector pixel); 22788 vector signed short vec_mergel (vector signed short, 22789 vector signed short); 22790 vector unsigned short vec_mergel (vector unsigned short, 22791 vector unsigned short); 22792 vector float vec_mergel (vector float, vector float); 22793 vector bool int vec_mergel (vector bool int, vector bool int); 22794 vector signed int vec_mergel (vector signed int, vector signed int); 22795 vector unsigned int vec_mergel (vector unsigned int, 22796 vector unsigned int); 22797 22798 vector float vec_vmrglw (vector float, vector float); 22799 vector signed int vec_vmrglw (vector signed int, vector signed int); 22800 vector unsigned int vec_vmrglw (vector unsigned int, 22801 vector unsigned int); 22802 vector bool int vec_vmrglw (vector bool int, vector bool int); 22803 22804 vector bool short vec_vmrglh (vector bool short, vector bool short); 22805 vector signed short vec_vmrglh (vector signed short, 22806 vector signed short); 22807 vector unsigned short vec_vmrglh (vector unsigned short, 22808 vector unsigned short); 22809 vector pixel vec_vmrglh (vector pixel, vector pixel); 22810 22811 vector bool char vec_vmrglb (vector bool char, vector bool char); 22812 vector signed char vec_vmrglb (vector signed char, vector signed char); 22813 vector unsigned char vec_vmrglb (vector unsigned char, 22814 vector unsigned char); 22815 22816 vector unsigned short vec_mfvscr (void); 22817 22818 vector unsigned char vec_min (vector bool char, vector unsigned char); 22819 vector unsigned char vec_min (vector unsigned char, vector bool char); 22820 vector unsigned char vec_min (vector unsigned char, 22821 vector unsigned char); 22822 vector signed char vec_min (vector bool char, vector signed char); 22823 vector signed char vec_min (vector signed char, vector bool char); 22824 vector signed char vec_min (vector signed char, vector signed char); 22825 vector unsigned short vec_min (vector bool short, 22826 vector unsigned short); 22827 vector unsigned short vec_min (vector unsigned short, 22828 vector bool short); 22829 vector unsigned short vec_min (vector unsigned short, 22830 vector unsigned short); 22831 vector signed short vec_min (vector bool short, vector signed short); 22832 vector signed short vec_min (vector signed short, vector bool short); 22833 vector signed short vec_min (vector signed short, vector signed short); 22834 vector unsigned int vec_min (vector bool int, vector unsigned int); 22835 vector unsigned int vec_min (vector unsigned int, vector bool int); 22836 vector unsigned int vec_min (vector unsigned int, vector unsigned int); 22837 vector signed int vec_min (vector bool int, vector signed int); 22838 vector signed int vec_min (vector signed int, vector bool int); 22839 vector signed int vec_min (vector signed int, vector signed int); 22840 vector float vec_min (vector float, vector float); 22841 22842 vector float vec_vminfp (vector float, vector float); 22843 22844 vector signed int vec_vminsw (vector bool int, vector signed int); 22845 vector signed int vec_vminsw (vector signed int, vector bool int); 22846 vector signed int vec_vminsw (vector signed int, vector signed int); 22847 22848 vector unsigned int vec_vminuw (vector bool int, vector unsigned int); 22849 vector unsigned int vec_vminuw (vector unsigned int, vector bool int); 22850 vector unsigned int vec_vminuw (vector unsigned int, 22851 vector unsigned int); 22852 22853 vector signed short vec_vminsh (vector bool short, vector signed short); 22854 vector signed short vec_vminsh (vector signed short, vector bool short); 22855 vector signed short vec_vminsh (vector signed short, 22856 vector signed short); 22857 22858 vector unsigned short vec_vminuh (vector bool short, 22859 vector unsigned short); 22860 vector unsigned short vec_vminuh (vector unsigned short, 22861 vector bool short); 22862 vector unsigned short vec_vminuh (vector unsigned short, 22863 vector unsigned short); 22864 22865 vector signed char vec_vminsb (vector bool char, vector signed char); 22866 vector signed char vec_vminsb (vector signed char, vector bool char); 22867 vector signed char vec_vminsb (vector signed char, vector signed char); 22868 22869 vector unsigned char vec_vminub (vector bool char, 22870 vector unsigned char); 22871 vector unsigned char vec_vminub (vector unsigned char, 22872 vector bool char); 22873 vector unsigned char vec_vminub (vector unsigned char, 22874 vector unsigned char); 22875 22876 vector signed short vec_mladd (vector signed short, 22877 vector signed short, 22878 vector signed short); 22879 vector signed short vec_mladd (vector signed short, 22880 vector unsigned short, 22881 vector unsigned short); 22882 vector signed short vec_mladd (vector unsigned short, 22883 vector signed short, 22884 vector signed short); 22885 vector unsigned short vec_mladd (vector unsigned short, 22886 vector unsigned short, 22887 vector unsigned short); 22888 22889 vector signed short vec_mradds (vector signed short, 22890 vector signed short, 22891 vector signed short); 22892 22893 vector unsigned int vec_msum (vector unsigned char, 22894 vector unsigned char, 22895 vector unsigned int); 22896 vector signed int vec_msum (vector signed char, 22897 vector unsigned char, 22898 vector signed int); 22899 vector unsigned int vec_msum (vector unsigned short, 22900 vector unsigned short, 22901 vector unsigned int); 22902 vector signed int vec_msum (vector signed short, 22903 vector signed short, 22904 vector signed int); 22905 22906 vector signed int vec_vmsumshm (vector signed short, 22907 vector signed short, 22908 vector signed int); 22909 22910 vector unsigned int vec_vmsumuhm (vector unsigned short, 22911 vector unsigned short, 22912 vector unsigned int); 22913 22914 vector signed int vec_vmsummbm (vector signed char, 22915 vector unsigned char, 22916 vector signed int); 22917 22918 vector unsigned int vec_vmsumubm (vector unsigned char, 22919 vector unsigned char, 22920 vector unsigned int); 22921 22922 vector unsigned int vec_msums (vector unsigned short, 22923 vector unsigned short, 22924 vector unsigned int); 22925 vector signed int vec_msums (vector signed short, 22926 vector signed short, 22927 vector signed int); 22928 22929 vector signed int vec_vmsumshs (vector signed short, 22930 vector signed short, 22931 vector signed int); 22932 22933 vector unsigned int vec_vmsumuhs (vector unsigned short, 22934 vector unsigned short, 22935 vector unsigned int); 22936 22937 void vec_mtvscr (vector signed int); 22938 void vec_mtvscr (vector unsigned int); 22939 void vec_mtvscr (vector bool int); 22940 void vec_mtvscr (vector signed short); 22941 void vec_mtvscr (vector unsigned short); 22942 void vec_mtvscr (vector bool short); 22943 void vec_mtvscr (vector pixel); 22944 void vec_mtvscr (vector signed char); 22945 void vec_mtvscr (vector unsigned char); 22946 void vec_mtvscr (vector bool char); 22947 22948 vector unsigned short vec_mule (vector unsigned char, 22949 vector unsigned char); 22950 vector signed short vec_mule (vector signed char, 22951 vector signed char); 22952 vector unsigned int vec_mule (vector unsigned short, 22953 vector unsigned short); 22954 vector signed int vec_mule (vector signed short, vector signed short); 22955 22956 vector signed int vec_vmulesh (vector signed short, 22957 vector signed short); 22958 22959 vector unsigned int vec_vmuleuh (vector unsigned short, 22960 vector unsigned short); 22961 22962 vector signed short vec_vmulesb (vector signed char, 22963 vector signed char); 22964 22965 vector unsigned short vec_vmuleub (vector unsigned char, 22966 vector unsigned char); 22967 22968 vector unsigned short vec_mulo (vector unsigned char, 22969 vector unsigned char); 22970 vector signed short vec_mulo (vector signed char, vector signed char); 22971 vector unsigned int vec_mulo (vector unsigned short, 22972 vector unsigned short); 22973 vector signed int vec_mulo (vector signed short, vector signed short); 22974 22975 vector signed int vec_vmulosh (vector signed short, 22976 vector signed short); 22977 22978 vector unsigned int vec_vmulouh (vector unsigned short, 22979 vector unsigned short); 22980 22981 vector signed short vec_vmulosb (vector signed char, 22982 vector signed char); 22983 22984 vector unsigned short vec_vmuloub (vector unsigned char, 22985 vector unsigned char); 22986 22987 vector float vec_nmsub (vector float, vector float, vector float); 22988 22989 vector float vec_nor (vector float, vector float); 22990 vector signed int vec_nor (vector signed int, vector signed int); 22991 vector unsigned int vec_nor (vector unsigned int, vector unsigned int); 22992 vector bool int vec_nor (vector bool int, vector bool int); 22993 vector signed short vec_nor (vector signed short, vector signed short); 22994 vector unsigned short vec_nor (vector unsigned short, 22995 vector unsigned short); 22996 vector bool short vec_nor (vector bool short, vector bool short); 22997 vector signed char vec_nor (vector signed char, vector signed char); 22998 vector unsigned char vec_nor (vector unsigned char, 22999 vector unsigned char); 23000 vector bool char vec_nor (vector bool char, vector bool char); 23001 23002 vector float vec_or (vector float, vector float); 23003 vector float vec_or (vector float, vector bool int); 23004 vector float vec_or (vector bool int, vector float); 23005 vector bool int vec_or (vector bool int, vector bool int); 23006 vector signed int vec_or (vector bool int, vector signed int); 23007 vector signed int vec_or (vector signed int, vector bool int); 23008 vector signed int vec_or (vector signed int, vector signed int); 23009 vector unsigned int vec_or (vector bool int, vector unsigned int); 23010 vector unsigned int vec_or (vector unsigned int, vector bool int); 23011 vector unsigned int vec_or (vector unsigned int, vector unsigned int); 23012 vector bool short vec_or (vector bool short, vector bool short); 23013 vector signed short vec_or (vector bool short, vector signed short); 23014 vector signed short vec_or (vector signed short, vector bool short); 23015 vector signed short vec_or (vector signed short, vector signed short); 23016 vector unsigned short vec_or (vector bool short, vector unsigned short); 23017 vector unsigned short vec_or (vector unsigned short, vector bool short); 23018 vector unsigned short vec_or (vector unsigned short, 23019 vector unsigned short); 23020 vector signed char vec_or (vector bool char, vector signed char); 23021 vector bool char vec_or (vector bool char, vector bool char); 23022 vector signed char vec_or (vector signed char, vector bool char); 23023 vector signed char vec_or (vector signed char, vector signed char); 23024 vector unsigned char vec_or (vector bool char, vector unsigned char); 23025 vector unsigned char vec_or (vector unsigned char, vector bool char); 23026 vector unsigned char vec_or (vector unsigned char, 23027 vector unsigned char); 23028 23029 vector signed char vec_pack (vector signed short, vector signed short); 23030 vector unsigned char vec_pack (vector unsigned short, 23031 vector unsigned short); 23032 vector bool char vec_pack (vector bool short, vector bool short); 23033 vector signed short vec_pack (vector signed int, vector signed int); 23034 vector unsigned short vec_pack (vector unsigned int, 23035 vector unsigned int); 23036 vector bool short vec_pack (vector bool int, vector bool int); 23037 23038 vector bool short vec_vpkuwum (vector bool int, vector bool int); 23039 vector signed short vec_vpkuwum (vector signed int, vector signed int); 23040 vector unsigned short vec_vpkuwum (vector unsigned int, 23041 vector unsigned int); 23042 23043 vector bool char vec_vpkuhum (vector bool short, vector bool short); 23044 vector signed char vec_vpkuhum (vector signed short, 23045 vector signed short); 23046 vector unsigned char vec_vpkuhum (vector unsigned short, 23047 vector unsigned short); 23048 23049 vector pixel vec_packpx (vector unsigned int, vector unsigned int); 23050 23051 vector unsigned char vec_packs (vector unsigned short, 23052 vector unsigned short); 23053 vector signed char vec_packs (vector signed short, vector signed short); 23054 vector unsigned short vec_packs (vector unsigned int, 23055 vector unsigned int); 23056 vector signed short vec_packs (vector signed int, vector signed int); 23057 23058 vector signed short vec_vpkswss (vector signed int, vector signed int); 23059 23060 vector unsigned short vec_vpkuwus (vector unsigned int, 23061 vector unsigned int); 23062 23063 vector signed char vec_vpkshss (vector signed short, 23064 vector signed short); 23065 23066 vector unsigned char vec_vpkuhus (vector unsigned short, 23067 vector unsigned short); 23068 23069 vector unsigned char vec_packsu (vector unsigned short, 23070 vector unsigned short); 23071 vector unsigned char vec_packsu (vector signed short, 23072 vector signed short); 23073 vector unsigned short vec_packsu (vector unsigned int, 23074 vector unsigned int); 23075 vector unsigned short vec_packsu (vector signed int, vector signed int); 23076 23077 vector unsigned short vec_vpkswus (vector signed int, 23078 vector signed int); 23079 23080 vector unsigned char vec_vpkshus (vector signed short, 23081 vector signed short); 23082 23083 vector float vec_perm (vector float, 23084 vector float, 23085 vector unsigned char); 23086 vector signed int vec_perm (vector signed int, 23087 vector signed int, 23088 vector unsigned char); 23089 vector unsigned int vec_perm (vector unsigned int, 23090 vector unsigned int, 23091 vector unsigned char); 23092 vector bool int vec_perm (vector bool int, 23093 vector bool int, 23094 vector unsigned char); 23095 vector signed short vec_perm (vector signed short, 23096 vector signed short, 23097 vector unsigned char); 23098 vector unsigned short vec_perm (vector unsigned short, 23099 vector unsigned short, 23100 vector unsigned char); 23101 vector bool short vec_perm (vector bool short, 23102 vector bool short, 23103 vector unsigned char); 23104 vector pixel vec_perm (vector pixel, 23105 vector pixel, 23106 vector unsigned char); 23107 vector signed char vec_perm (vector signed char, 23108 vector signed char, 23109 vector unsigned char); 23110 vector unsigned char vec_perm (vector unsigned char, 23111 vector unsigned char, 23112 vector unsigned char); 23113 vector bool char vec_perm (vector bool char, 23114 vector bool char, 23115 vector unsigned char); 23116 23117 vector float vec_re (vector float); 23118 23119 vector signed char vec_rl (vector signed char, 23120 vector unsigned char); 23121 vector unsigned char vec_rl (vector unsigned char, 23122 vector unsigned char); 23123 vector signed short vec_rl (vector signed short, vector unsigned short); 23124 vector unsigned short vec_rl (vector unsigned short, 23125 vector unsigned short); 23126 vector signed int vec_rl (vector signed int, vector unsigned int); 23127 vector unsigned int vec_rl (vector unsigned int, vector unsigned int); 23128 23129 vector signed int vec_vrlw (vector signed int, vector unsigned int); 23130 vector unsigned int vec_vrlw (vector unsigned int, vector unsigned int); 23131 23132 vector signed short vec_vrlh (vector signed short, 23133 vector unsigned short); 23134 vector unsigned short vec_vrlh (vector unsigned short, 23135 vector unsigned short); 23136 23137 vector signed char vec_vrlb (vector signed char, vector unsigned char); 23138 vector unsigned char vec_vrlb (vector unsigned char, 23139 vector unsigned char); 23140 23141 vector float vec_round (vector float); 23142 23143 vector float vec_rsqrte (vector float); 23144 23145 vector float vec_sel (vector float, vector float, vector bool int); 23146 vector float vec_sel (vector float, vector float, vector unsigned int); 23147 vector signed int vec_sel (vector signed int, 23148 vector signed int, 23149 vector bool int); 23150 vector signed int vec_sel (vector signed int, 23151 vector signed int, 23152 vector unsigned int); 23153 vector unsigned int vec_sel (vector unsigned int, 23154 vector unsigned int, 23155 vector bool int); 23156 vector unsigned int vec_sel (vector unsigned int, 23157 vector unsigned int, 23158 vector unsigned int); 23159 vector bool int vec_sel (vector bool int, 23160 vector bool int, 23161 vector bool int); 23162 vector bool int vec_sel (vector bool int, 23163 vector bool int, 23164 vector unsigned int); 23165 vector signed short vec_sel (vector signed short, 23166 vector signed short, 23167 vector bool short); 23168 vector signed short vec_sel (vector signed short, 23169 vector signed short, 23170 vector unsigned short); 23171 vector unsigned short vec_sel (vector unsigned short, 23172 vector unsigned short, 23173 vector bool short); 23174 vector unsigned short vec_sel (vector unsigned short, 23175 vector unsigned short, 23176 vector unsigned short); 23177 vector bool short vec_sel (vector bool short, 23178 vector bool short, 23179 vector bool short); 23180 vector bool short vec_sel (vector bool short, 23181 vector bool short, 23182 vector unsigned short); 23183 vector signed char vec_sel (vector signed char, 23184 vector signed char, 23185 vector bool char); 23186 vector signed char vec_sel (vector signed char, 23187 vector signed char, 23188 vector unsigned char); 23189 vector unsigned char vec_sel (vector unsigned char, 23190 vector unsigned char, 23191 vector bool char); 23192 vector unsigned char vec_sel (vector unsigned char, 23193 vector unsigned char, 23194 vector unsigned char); 23195 vector bool char vec_sel (vector bool char, 23196 vector bool char, 23197 vector bool char); 23198 vector bool char vec_sel (vector bool char, 23199 vector bool char, 23200 vector unsigned char); 23201 23202 vector signed char vec_sl (vector signed char, 23203 vector unsigned char); 23204 vector unsigned char vec_sl (vector unsigned char, 23205 vector unsigned char); 23206 vector signed short vec_sl (vector signed short, vector unsigned short); 23207 vector unsigned short vec_sl (vector unsigned short, 23208 vector unsigned short); 23209 vector signed int vec_sl (vector signed int, vector unsigned int); 23210 vector unsigned int vec_sl (vector unsigned int, vector unsigned int); 23211 23212 vector signed int vec_vslw (vector signed int, vector unsigned int); 23213 vector unsigned int vec_vslw (vector unsigned int, vector unsigned int); 23214 23215 vector signed short vec_vslh (vector signed short, 23216 vector unsigned short); 23217 vector unsigned short vec_vslh (vector unsigned short, 23218 vector unsigned short); 23219 23220 vector signed char vec_vslb (vector signed char, vector unsigned char); 23221 vector unsigned char vec_vslb (vector unsigned char, 23222 vector unsigned char); 23223 23224 vector float vec_sld (vector float, vector float, const int); 23225 vector signed int vec_sld (vector signed int, 23226 vector signed int, 23227 const int); 23228 vector unsigned int vec_sld (vector unsigned int, 23229 vector unsigned int, 23230 const int); 23231 vector bool int vec_sld (vector bool int, 23232 vector bool int, 23233 const int); 23234 vector signed short vec_sld (vector signed short, 23235 vector signed short, 23236 const int); 23237 vector unsigned short vec_sld (vector unsigned short, 23238 vector unsigned short, 23239 const int); 23240 vector bool short vec_sld (vector bool short, 23241 vector bool short, 23242 const int); 23243 vector pixel vec_sld (vector pixel, 23244 vector pixel, 23245 const int); 23246 vector signed char vec_sld (vector signed char, 23247 vector signed char, 23248 const int); 23249 vector unsigned char vec_sld (vector unsigned char, 23250 vector unsigned char, 23251 const int); 23252 vector bool char vec_sld (vector bool char, 23253 vector bool char, 23254 const int); 23255 23256 vector signed int vec_sll (vector signed int, 23257 vector unsigned int); 23258 vector signed int vec_sll (vector signed int, 23259 vector unsigned short); 23260 vector signed int vec_sll (vector signed int, 23261 vector unsigned char); 23262 vector unsigned int vec_sll (vector unsigned int, 23263 vector unsigned int); 23264 vector unsigned int vec_sll (vector unsigned int, 23265 vector unsigned short); 23266 vector unsigned int vec_sll (vector unsigned int, 23267 vector unsigned char); 23268 vector bool int vec_sll (vector bool int, 23269 vector unsigned int); 23270 vector bool int vec_sll (vector bool int, 23271 vector unsigned short); 23272 vector bool int vec_sll (vector bool int, 23273 vector unsigned char); 23274 vector signed short vec_sll (vector signed short, 23275 vector unsigned int); 23276 vector signed short vec_sll (vector signed short, 23277 vector unsigned short); 23278 vector signed short vec_sll (vector signed short, 23279 vector unsigned char); 23280 vector unsigned short vec_sll (vector unsigned short, 23281 vector unsigned int); 23282 vector unsigned short vec_sll (vector unsigned short, 23283 vector unsigned short); 23284 vector unsigned short vec_sll (vector unsigned short, 23285 vector unsigned char); 23286 vector bool short vec_sll (vector bool short, vector unsigned int); 23287 vector bool short vec_sll (vector bool short, vector unsigned short); 23288 vector bool short vec_sll (vector bool short, vector unsigned char); 23289 vector pixel vec_sll (vector pixel, vector unsigned int); 23290 vector pixel vec_sll (vector pixel, vector unsigned short); 23291 vector pixel vec_sll (vector pixel, vector unsigned char); 23292 vector signed char vec_sll (vector signed char, vector unsigned int); 23293 vector signed char vec_sll (vector signed char, vector unsigned short); 23294 vector signed char vec_sll (vector signed char, vector unsigned char); 23295 vector unsigned char vec_sll (vector unsigned char, 23296 vector unsigned int); 23297 vector unsigned char vec_sll (vector unsigned char, 23298 vector unsigned short); 23299 vector unsigned char vec_sll (vector unsigned char, 23300 vector unsigned char); 23301 vector bool char vec_sll (vector bool char, vector unsigned int); 23302 vector bool char vec_sll (vector bool char, vector unsigned short); 23303 vector bool char vec_sll (vector bool char, vector unsigned char); 23304 23305 vector float vec_slo (vector float, vector signed char); 23306 vector float vec_slo (vector float, vector unsigned char); 23307 vector signed int vec_slo (vector signed int, vector signed char); 23308 vector signed int vec_slo (vector signed int, vector unsigned char); 23309 vector unsigned int vec_slo (vector unsigned int, vector signed char); 23310 vector unsigned int vec_slo (vector unsigned int, vector unsigned char); 23311 vector signed short vec_slo (vector signed short, vector signed char); 23312 vector signed short vec_slo (vector signed short, vector unsigned char); 23313 vector unsigned short vec_slo (vector unsigned short, 23314 vector signed char); 23315 vector unsigned short vec_slo (vector unsigned short, 23316 vector unsigned char); 23317 vector pixel vec_slo (vector pixel, vector signed char); 23318 vector pixel vec_slo (vector pixel, vector unsigned char); 23319 vector signed char vec_slo (vector signed char, vector signed char); 23320 vector signed char vec_slo (vector signed char, vector unsigned char); 23321 vector unsigned char vec_slo (vector unsigned char, vector signed char); 23322 vector unsigned char vec_slo (vector unsigned char, 23323 vector unsigned char); 23324 23325 vector signed char vec_splat (vector signed char, const int); 23326 vector unsigned char vec_splat (vector unsigned char, const int); 23327 vector bool char vec_splat (vector bool char, const int); 23328 vector signed short vec_splat (vector signed short, const int); 23329 vector unsigned short vec_splat (vector unsigned short, const int); 23330 vector bool short vec_splat (vector bool short, const int); 23331 vector pixel vec_splat (vector pixel, const int); 23332 vector float vec_splat (vector float, const int); 23333 vector signed int vec_splat (vector signed int, const int); 23334 vector unsigned int vec_splat (vector unsigned int, const int); 23335 vector bool int vec_splat (vector bool int, const int); 23336 23337 vector float vec_vspltw (vector float, const int); 23338 vector signed int vec_vspltw (vector signed int, const int); 23339 vector unsigned int vec_vspltw (vector unsigned int, const int); 23340 vector bool int vec_vspltw (vector bool int, const int); 23341 23342 vector bool short vec_vsplth (vector bool short, const int); 23343 vector signed short vec_vsplth (vector signed short, const int); 23344 vector unsigned short vec_vsplth (vector unsigned short, const int); 23345 vector pixel vec_vsplth (vector pixel, const int); 23346 23347 vector signed char vec_vspltb (vector signed char, const int); 23348 vector unsigned char vec_vspltb (vector unsigned char, const int); 23349 vector bool char vec_vspltb (vector bool char, const int); 23350 23351 vector signed char vec_splat_s8 (const int); 23352 23353 vector signed short vec_splat_s16 (const int); 23354 23355 vector signed int vec_splat_s32 (const int); 23356 23357 vector unsigned char vec_splat_u8 (const int); 23358 23359 vector unsigned short vec_splat_u16 (const int); 23360 23361 vector unsigned int vec_splat_u32 (const int); 23362 23363 vector signed char vec_sr (vector signed char, vector unsigned char); 23364 vector unsigned char vec_sr (vector unsigned char, 23365 vector unsigned char); 23366 vector signed short vec_sr (vector signed short, 23367 vector unsigned short); 23368 vector unsigned short vec_sr (vector unsigned short, 23369 vector unsigned short); 23370 vector signed int vec_sr (vector signed int, vector unsigned int); 23371 vector unsigned int vec_sr (vector unsigned int, vector unsigned int); 23372 23373 vector signed int vec_vsrw (vector signed int, vector unsigned int); 23374 vector unsigned int vec_vsrw (vector unsigned int, vector unsigned int); 23375 23376 vector signed short vec_vsrh (vector signed short, 23377 vector unsigned short); 23378 vector unsigned short vec_vsrh (vector unsigned short, 23379 vector unsigned short); 23380 23381 vector signed char vec_vsrb (vector signed char, vector unsigned char); 23382 vector unsigned char vec_vsrb (vector unsigned char, 23383 vector unsigned char); 23384 23385 vector signed char vec_sra (vector signed char, vector unsigned char); 23386 vector unsigned char vec_sra (vector unsigned char, 23387 vector unsigned char); 23388 vector signed short vec_sra (vector signed short, 23389 vector unsigned short); 23390 vector unsigned short vec_sra (vector unsigned short, 23391 vector unsigned short); 23392 vector signed int vec_sra (vector signed int, vector unsigned int); 23393 vector unsigned int vec_sra (vector unsigned int, vector unsigned int); 23394 23395 vector signed int vec_vsraw (vector signed int, vector unsigned int); 23396 vector unsigned int vec_vsraw (vector unsigned int, 23397 vector unsigned int); 23398 23399 vector signed short vec_vsrah (vector signed short, 23400 vector unsigned short); 23401 vector unsigned short vec_vsrah (vector unsigned short, 23402 vector unsigned short); 23403 23404 vector signed char vec_vsrab (vector signed char, vector unsigned char); 23405 vector unsigned char vec_vsrab (vector unsigned char, 23406 vector unsigned char); 23407 23408 vector signed int vec_srl (vector signed int, vector unsigned int); 23409 vector signed int vec_srl (vector signed int, vector unsigned short); 23410 vector signed int vec_srl (vector signed int, vector unsigned char); 23411 vector unsigned int vec_srl (vector unsigned int, vector unsigned int); 23412 vector unsigned int vec_srl (vector unsigned int, 23413 vector unsigned short); 23414 vector unsigned int vec_srl (vector unsigned int, vector unsigned char); 23415 vector bool int vec_srl (vector bool int, vector unsigned int); 23416 vector bool int vec_srl (vector bool int, vector unsigned short); 23417 vector bool int vec_srl (vector bool int, vector unsigned char); 23418 vector signed short vec_srl (vector signed short, vector unsigned int); 23419 vector signed short vec_srl (vector signed short, 23420 vector unsigned short); 23421 vector signed short vec_srl (vector signed short, vector unsigned char); 23422 vector unsigned short vec_srl (vector unsigned short, 23423 vector unsigned int); 23424 vector unsigned short vec_srl (vector unsigned short, 23425 vector unsigned short); 23426 vector unsigned short vec_srl (vector unsigned short, 23427 vector unsigned char); 23428 vector bool short vec_srl (vector bool short, vector unsigned int); 23429 vector bool short vec_srl (vector bool short, vector unsigned short); 23430 vector bool short vec_srl (vector bool short, vector unsigned char); 23431 vector pixel vec_srl (vector pixel, vector unsigned int); 23432 vector pixel vec_srl (vector pixel, vector unsigned short); 23433 vector pixel vec_srl (vector pixel, vector unsigned char); 23434 vector signed char vec_srl (vector signed char, vector unsigned int); 23435 vector signed char vec_srl (vector signed char, vector unsigned short); 23436 vector signed char vec_srl (vector signed char, vector unsigned char); 23437 vector unsigned char vec_srl (vector unsigned char, 23438 vector unsigned int); 23439 vector unsigned char vec_srl (vector unsigned char, 23440 vector unsigned short); 23441 vector unsigned char vec_srl (vector unsigned char, 23442 vector unsigned char); 23443 vector bool char vec_srl (vector bool char, vector unsigned int); 23444 vector bool char vec_srl (vector bool char, vector unsigned short); 23445 vector bool char vec_srl (vector bool char, vector unsigned char); 23446 23447 vector float vec_sro (vector float, vector signed char); 23448 vector float vec_sro (vector float, vector unsigned char); 23449 vector signed int vec_sro (vector signed int, vector signed char); 23450 vector signed int vec_sro (vector signed int, vector unsigned char); 23451 vector unsigned int vec_sro (vector unsigned int, vector signed char); 23452 vector unsigned int vec_sro (vector unsigned int, vector unsigned char); 23453 vector signed short vec_sro (vector signed short, vector signed char); 23454 vector signed short vec_sro (vector signed short, vector unsigned char); 23455 vector unsigned short vec_sro (vector unsigned short, 23456 vector signed char); 23457 vector unsigned short vec_sro (vector unsigned short, 23458 vector unsigned char); 23459 vector pixel vec_sro (vector pixel, vector signed char); 23460 vector pixel vec_sro (vector pixel, vector unsigned char); 23461 vector signed char vec_sro (vector signed char, vector signed char); 23462 vector signed char vec_sro (vector signed char, vector unsigned char); 23463 vector unsigned char vec_sro (vector unsigned char, vector signed char); 23464 vector unsigned char vec_sro (vector unsigned char, 23465 vector unsigned char); 23466 23467 void vec_st (vector float, int, vector float *); 23468 void vec_st (vector float, int, float *); 23469 void vec_st (vector signed int, int, vector signed int *); 23470 void vec_st (vector signed int, int, int *); 23471 void vec_st (vector unsigned int, int, vector unsigned int *); 23472 void vec_st (vector unsigned int, int, unsigned int *); 23473 void vec_st (vector bool int, int, vector bool int *); 23474 void vec_st (vector bool int, int, unsigned int *); 23475 void vec_st (vector bool int, int, int *); 23476 void vec_st (vector signed short, int, vector signed short *); 23477 void vec_st (vector signed short, int, short *); 23478 void vec_st (vector unsigned short, int, vector unsigned short *); 23479 void vec_st (vector unsigned short, int, unsigned short *); 23480 void vec_st (vector bool short, int, vector bool short *); 23481 void vec_st (vector bool short, int, unsigned short *); 23482 void vec_st (vector pixel, int, vector pixel *); 23483 void vec_st (vector pixel, int, unsigned short *); 23484 void vec_st (vector pixel, int, short *); 23485 void vec_st (vector bool short, int, short *); 23486 void vec_st (vector signed char, int, vector signed char *); 23487 void vec_st (vector signed char, int, signed char *); 23488 void vec_st (vector unsigned char, int, vector unsigned char *); 23489 void vec_st (vector unsigned char, int, unsigned char *); 23490 void vec_st (vector bool char, int, vector bool char *); 23491 void vec_st (vector bool char, int, unsigned char *); 23492 void vec_st (vector bool char, int, signed char *); 23493 23494 void vec_ste (vector signed char, int, signed char *); 23495 void vec_ste (vector unsigned char, int, unsigned char *); 23496 void vec_ste (vector bool char, int, signed char *); 23497 void vec_ste (vector bool char, int, unsigned char *); 23498 void vec_ste (vector signed short, int, short *); 23499 void vec_ste (vector unsigned short, int, unsigned short *); 23500 void vec_ste (vector bool short, int, short *); 23501 void vec_ste (vector bool short, int, unsigned short *); 23502 void vec_ste (vector pixel, int, short *); 23503 void vec_ste (vector pixel, int, unsigned short *); 23504 void vec_ste (vector float, int, float *); 23505 void vec_ste (vector signed int, int, int *); 23506 void vec_ste (vector unsigned int, int, unsigned int *); 23507 void vec_ste (vector bool int, int, int *); 23508 void vec_ste (vector bool int, int, unsigned int *); 23509 23510 void vec_stvewx (vector float, int, float *); 23511 void vec_stvewx (vector signed int, int, int *); 23512 void vec_stvewx (vector unsigned int, int, unsigned int *); 23513 void vec_stvewx (vector bool int, int, int *); 23514 void vec_stvewx (vector bool int, int, unsigned int *); 23515 23516 void vec_stvehx (vector signed short, int, short *); 23517 void vec_stvehx (vector unsigned short, int, unsigned short *); 23518 void vec_stvehx (vector bool short, int, short *); 23519 void vec_stvehx (vector bool short, int, unsigned short *); 23520 void vec_stvehx (vector pixel, int, short *); 23521 void vec_stvehx (vector pixel, int, unsigned short *); 23522 23523 void vec_stvebx (vector signed char, int, signed char *); 23524 void vec_stvebx (vector unsigned char, int, unsigned char *); 23525 void vec_stvebx (vector bool char, int, signed char *); 23526 void vec_stvebx (vector bool char, int, unsigned char *); 23527 23528 void vec_stl (vector float, int, vector float *); 23529 void vec_stl (vector float, int, float *); 23530 void vec_stl (vector signed int, int, vector signed int *); 23531 void vec_stl (vector signed int, int, int *); 23532 void vec_stl (vector unsigned int, int, vector unsigned int *); 23533 void vec_stl (vector unsigned int, int, unsigned int *); 23534 void vec_stl (vector bool int, int, vector bool int *); 23535 void vec_stl (vector bool int, int, unsigned int *); 23536 void vec_stl (vector bool int, int, int *); 23537 void vec_stl (vector signed short, int, vector signed short *); 23538 void vec_stl (vector signed short, int, short *); 23539 void vec_stl (vector unsigned short, int, vector unsigned short *); 23540 void vec_stl (vector unsigned short, int, unsigned short *); 23541 void vec_stl (vector bool short, int, vector bool short *); 23542 void vec_stl (vector bool short, int, unsigned short *); 23543 void vec_stl (vector bool short, int, short *); 23544 void vec_stl (vector pixel, int, vector pixel *); 23545 void vec_stl (vector pixel, int, unsigned short *); 23546 void vec_stl (vector pixel, int, short *); 23547 void vec_stl (vector signed char, int, vector signed char *); 23548 void vec_stl (vector signed char, int, signed char *); 23549 void vec_stl (vector unsigned char, int, vector unsigned char *); 23550 void vec_stl (vector unsigned char, int, unsigned char *); 23551 void vec_stl (vector bool char, int, vector bool char *); 23552 void vec_stl (vector bool char, int, unsigned char *); 23553 void vec_stl (vector bool char, int, signed char *); 23554 23555 vector signed char vec_sub (vector bool char, vector signed char); 23556 vector signed char vec_sub (vector signed char, vector bool char); 23557 vector signed char vec_sub (vector signed char, vector signed char); 23558 vector unsigned char vec_sub (vector bool char, vector unsigned char); 23559 vector unsigned char vec_sub (vector unsigned char, vector bool char); 23560 vector unsigned char vec_sub (vector unsigned char, 23561 vector unsigned char); 23562 vector signed short vec_sub (vector bool short, vector signed short); 23563 vector signed short vec_sub (vector signed short, vector bool short); 23564 vector signed short vec_sub (vector signed short, vector signed short); 23565 vector unsigned short vec_sub (vector bool short, 23566 vector unsigned short); 23567 vector unsigned short vec_sub (vector unsigned short, 23568 vector bool short); 23569 vector unsigned short vec_sub (vector unsigned short, 23570 vector unsigned short); 23571 vector signed int vec_sub (vector bool int, vector signed int); 23572 vector signed int vec_sub (vector signed int, vector bool int); 23573 vector signed int vec_sub (vector signed int, vector signed int); 23574 vector unsigned int vec_sub (vector bool int, vector unsigned int); 23575 vector unsigned int vec_sub (vector unsigned int, vector bool int); 23576 vector unsigned int vec_sub (vector unsigned int, vector unsigned int); 23577 vector float vec_sub (vector float, vector float); 23578 23579 vector float vec_vsubfp (vector float, vector float); 23580 23581 vector signed int vec_vsubuwm (vector bool int, vector signed int); 23582 vector signed int vec_vsubuwm (vector signed int, vector bool int); 23583 vector signed int vec_vsubuwm (vector signed int, vector signed int); 23584 vector unsigned int vec_vsubuwm (vector bool int, vector unsigned int); 23585 vector unsigned int vec_vsubuwm (vector unsigned int, vector bool int); 23586 vector unsigned int vec_vsubuwm (vector unsigned int, 23587 vector unsigned int); 23588 23589 vector signed short vec_vsubuhm (vector bool short, 23590 vector signed short); 23591 vector signed short vec_vsubuhm (vector signed short, 23592 vector bool short); 23593 vector signed short vec_vsubuhm (vector signed short, 23594 vector signed short); 23595 vector unsigned short vec_vsubuhm (vector bool short, 23596 vector unsigned short); 23597 vector unsigned short vec_vsubuhm (vector unsigned short, 23598 vector bool short); 23599 vector unsigned short vec_vsubuhm (vector unsigned short, 23600 vector unsigned short); 23601 23602 vector signed char vec_vsububm (vector bool char, vector signed char); 23603 vector signed char vec_vsububm (vector signed char, vector bool char); 23604 vector signed char vec_vsububm (vector signed char, vector signed char); 23605 vector unsigned char vec_vsububm (vector bool char, 23606 vector unsigned char); 23607 vector unsigned char vec_vsububm (vector unsigned char, 23608 vector bool char); 23609 vector unsigned char vec_vsububm (vector unsigned char, 23610 vector unsigned char); 23611 23612 vector unsigned int vec_subc (vector unsigned int, vector unsigned int); 23613 23614 vector unsigned char vec_subs (vector bool char, vector unsigned char); 23615 vector unsigned char vec_subs (vector unsigned char, vector bool char); 23616 vector unsigned char vec_subs (vector unsigned char, 23617 vector unsigned char); 23618 vector signed char vec_subs (vector bool char, vector signed char); 23619 vector signed char vec_subs (vector signed char, vector bool char); 23620 vector signed char vec_subs (vector signed char, vector signed char); 23621 vector unsigned short vec_subs (vector bool short, 23622 vector unsigned short); 23623 vector unsigned short vec_subs (vector unsigned short, 23624 vector bool short); 23625 vector unsigned short vec_subs (vector unsigned short, 23626 vector unsigned short); 23627 vector signed short vec_subs (vector bool short, vector signed short); 23628 vector signed short vec_subs (vector signed short, vector bool short); 23629 vector signed short vec_subs (vector signed short, vector signed short); 23630 vector unsigned int vec_subs (vector bool int, vector unsigned int); 23631 vector unsigned int vec_subs (vector unsigned int, vector bool int); 23632 vector unsigned int vec_subs (vector unsigned int, vector unsigned int); 23633 vector signed int vec_subs (vector bool int, vector signed int); 23634 vector signed int vec_subs (vector signed int, vector bool int); 23635 vector signed int vec_subs (vector signed int, vector signed int); 23636 23637 vector signed int vec_vsubsws (vector bool int, vector signed int); 23638 vector signed int vec_vsubsws (vector signed int, vector bool int); 23639 vector signed int vec_vsubsws (vector signed int, vector signed int); 23640 23641 vector unsigned int vec_vsubuws (vector bool int, vector unsigned int); 23642 vector unsigned int vec_vsubuws (vector unsigned int, vector bool int); 23643 vector unsigned int vec_vsubuws (vector unsigned int, 23644 vector unsigned int); 23645 23646 vector signed short vec_vsubshs (vector bool short, 23647 vector signed short); 23648 vector signed short vec_vsubshs (vector signed short, 23649 vector bool short); 23650 vector signed short vec_vsubshs (vector signed short, 23651 vector signed short); 23652 23653 vector unsigned short vec_vsubuhs (vector bool short, 23654 vector unsigned short); 23655 vector unsigned short vec_vsubuhs (vector unsigned short, 23656 vector bool short); 23657 vector unsigned short vec_vsubuhs (vector unsigned short, 23658 vector unsigned short); 23659 23660 vector signed char vec_vsubsbs (vector bool char, vector signed char); 23661 vector signed char vec_vsubsbs (vector signed char, vector bool char); 23662 vector signed char vec_vsubsbs (vector signed char, vector signed char); 23663 23664 vector unsigned char vec_vsububs (vector bool char, 23665 vector unsigned char); 23666 vector unsigned char vec_vsububs (vector unsigned char, 23667 vector bool char); 23668 vector unsigned char vec_vsububs (vector unsigned char, 23669 vector unsigned char); 23670 23671 vector unsigned int vec_sum4s (vector unsigned char, 23672 vector unsigned int); 23673 vector signed int vec_sum4s (vector signed char, vector signed int); 23674 vector signed int vec_sum4s (vector signed short, vector signed int); 23675 23676 vector signed int vec_vsum4shs (vector signed short, vector signed int); 23677 23678 vector signed int vec_vsum4sbs (vector signed char, vector signed int); 23679 23680 vector unsigned int vec_vsum4ubs (vector unsigned char, 23681 vector unsigned int); 23682 23683 vector signed int vec_sum2s (vector signed int, vector signed int); 23684 23685 vector signed int vec_sums (vector signed int, vector signed int); 23686 23687 vector float vec_trunc (vector float); 23688 23689 vector signed short vec_unpackh (vector signed char); 23690 vector bool short vec_unpackh (vector bool char); 23691 vector signed int vec_unpackh (vector signed short); 23692 vector bool int vec_unpackh (vector bool short); 23693 vector unsigned int vec_unpackh (vector pixel); 23694 23695 vector bool int vec_vupkhsh (vector bool short); 23696 vector signed int vec_vupkhsh (vector signed short); 23697 23698 vector unsigned int vec_vupkhpx (vector pixel); 23699 23700 vector bool short vec_vupkhsb (vector bool char); 23701 vector signed short vec_vupkhsb (vector signed char); 23702 23703 vector signed short vec_unpackl (vector signed char); 23704 vector bool short vec_unpackl (vector bool char); 23705 vector unsigned int vec_unpackl (vector pixel); 23706 vector signed int vec_unpackl (vector signed short); 23707 vector bool int vec_unpackl (vector bool short); 23708 23709 vector unsigned int vec_vupklpx (vector pixel); 23710 23711 vector bool int vec_vupklsh (vector bool short); 23712 vector signed int vec_vupklsh (vector signed short); 23713 23714 vector bool short vec_vupklsb (vector bool char); 23715 vector signed short vec_vupklsb (vector signed char); 23716 23717 vector float vec_xor (vector float, vector float); 23718 vector float vec_xor (vector float, vector bool int); 23719 vector float vec_xor (vector bool int, vector float); 23720 vector bool int vec_xor (vector bool int, vector bool int); 23721 vector signed int vec_xor (vector bool int, vector signed int); 23722 vector signed int vec_xor (vector signed int, vector bool int); 23723 vector signed int vec_xor (vector signed int, vector signed int); 23724 vector unsigned int vec_xor (vector bool int, vector unsigned int); 23725 vector unsigned int vec_xor (vector unsigned int, vector bool int); 23726 vector unsigned int vec_xor (vector unsigned int, vector unsigned int); 23727 vector bool short vec_xor (vector bool short, vector bool short); 23728 vector signed short vec_xor (vector bool short, vector signed short); 23729 vector signed short vec_xor (vector signed short, vector bool short); 23730 vector signed short vec_xor (vector signed short, vector signed short); 23731 vector unsigned short vec_xor (vector bool short, 23732 vector unsigned short); 23733 vector unsigned short vec_xor (vector unsigned short, 23734 vector bool short); 23735 vector unsigned short vec_xor (vector unsigned short, 23736 vector unsigned short); 23737 vector signed char vec_xor (vector bool char, vector signed char); 23738 vector bool char vec_xor (vector bool char, vector bool char); 23739 vector signed char vec_xor (vector signed char, vector bool char); 23740 vector signed char vec_xor (vector signed char, vector signed char); 23741 vector unsigned char vec_xor (vector bool char, vector unsigned char); 23742 vector unsigned char vec_xor (vector unsigned char, vector bool char); 23743 vector unsigned char vec_xor (vector unsigned char, 23744 vector unsigned char); 23745 23746 int vec_all_eq (vector signed char, vector bool char); 23747 int vec_all_eq (vector signed char, vector signed char); 23748 int vec_all_eq (vector unsigned char, vector bool char); 23749 int vec_all_eq (vector unsigned char, vector unsigned char); 23750 int vec_all_eq (vector bool char, vector bool char); 23751 int vec_all_eq (vector bool char, vector unsigned char); 23752 int vec_all_eq (vector bool char, vector signed char); 23753 int vec_all_eq (vector signed short, vector bool short); 23754 int vec_all_eq (vector signed short, vector signed short); 23755 int vec_all_eq (vector unsigned short, vector bool short); 23756 int vec_all_eq (vector unsigned short, vector unsigned short); 23757 int vec_all_eq (vector bool short, vector bool short); 23758 int vec_all_eq (vector bool short, vector unsigned short); 23759 int vec_all_eq (vector bool short, vector signed short); 23760 int vec_all_eq (vector pixel, vector pixel); 23761 int vec_all_eq (vector signed int, vector bool int); 23762 int vec_all_eq (vector signed int, vector signed int); 23763 int vec_all_eq (vector unsigned int, vector bool int); 23764 int vec_all_eq (vector unsigned int, vector unsigned int); 23765 int vec_all_eq (vector bool int, vector bool int); 23766 int vec_all_eq (vector bool int, vector unsigned int); 23767 int vec_all_eq (vector bool int, vector signed int); 23768 int vec_all_eq (vector float, vector float); 23769 23770 int vec_all_ge (vector bool char, vector unsigned char); 23771 int vec_all_ge (vector unsigned char, vector bool char); 23772 int vec_all_ge (vector unsigned char, vector unsigned char); 23773 int vec_all_ge (vector bool char, vector signed char); 23774 int vec_all_ge (vector signed char, vector bool char); 23775 int vec_all_ge (vector signed char, vector signed char); 23776 int vec_all_ge (vector bool short, vector unsigned short); 23777 int vec_all_ge (vector unsigned short, vector bool short); 23778 int vec_all_ge (vector unsigned short, vector unsigned short); 23779 int vec_all_ge (vector signed short, vector signed short); 23780 int vec_all_ge (vector bool short, vector signed short); 23781 int vec_all_ge (vector signed short, vector bool short); 23782 int vec_all_ge (vector bool int, vector unsigned int); 23783 int vec_all_ge (vector unsigned int, vector bool int); 23784 int vec_all_ge (vector unsigned int, vector unsigned int); 23785 int vec_all_ge (vector bool int, vector signed int); 23786 int vec_all_ge (vector signed int, vector bool int); 23787 int vec_all_ge (vector signed int, vector signed int); 23788 int vec_all_ge (vector float, vector float); 23789 23790 int vec_all_gt (vector bool char, vector unsigned char); 23791 int vec_all_gt (vector unsigned char, vector bool char); 23792 int vec_all_gt (vector unsigned char, vector unsigned char); 23793 int vec_all_gt (vector bool char, vector signed char); 23794 int vec_all_gt (vector signed char, vector bool char); 23795 int vec_all_gt (vector signed char, vector signed char); 23796 int vec_all_gt (vector bool short, vector unsigned short); 23797 int vec_all_gt (vector unsigned short, vector bool short); 23798 int vec_all_gt (vector unsigned short, vector unsigned short); 23799 int vec_all_gt (vector bool short, vector signed short); 23800 int vec_all_gt (vector signed short, vector bool short); 23801 int vec_all_gt (vector signed short, vector signed short); 23802 int vec_all_gt (vector bool int, vector unsigned int); 23803 int vec_all_gt (vector unsigned int, vector bool int); 23804 int vec_all_gt (vector unsigned int, vector unsigned int); 23805 int vec_all_gt (vector bool int, vector signed int); 23806 int vec_all_gt (vector signed int, vector bool int); 23807 int vec_all_gt (vector signed int, vector signed int); 23808 int vec_all_gt (vector float, vector float); 23809 23810 int vec_all_in (vector float, vector float); 23811 23812 int vec_all_le (vector bool char, vector unsigned char); 23813 int vec_all_le (vector unsigned char, vector bool char); 23814 int vec_all_le (vector unsigned char, vector unsigned char); 23815 int vec_all_le (vector bool char, vector signed char); 23816 int vec_all_le (vector signed char, vector bool char); 23817 int vec_all_le (vector signed char, vector signed char); 23818 int vec_all_le (vector bool short, vector unsigned short); 23819 int vec_all_le (vector unsigned short, vector bool short); 23820 int vec_all_le (vector unsigned short, vector unsigned short); 23821 int vec_all_le (vector bool short, vector signed short); 23822 int vec_all_le (vector signed short, vector bool short); 23823 int vec_all_le (vector signed short, vector signed short); 23824 int vec_all_le (vector bool int, vector unsigned int); 23825 int vec_all_le (vector unsigned int, vector bool int); 23826 int vec_all_le (vector unsigned int, vector unsigned int); 23827 int vec_all_le (vector bool int, vector signed int); 23828 int vec_all_le (vector signed int, vector bool int); 23829 int vec_all_le (vector signed int, vector signed int); 23830 int vec_all_le (vector float, vector float); 23831 23832 int vec_all_lt (vector bool char, vector unsigned char); 23833 int vec_all_lt (vector unsigned char, vector bool char); 23834 int vec_all_lt (vector unsigned char, vector unsigned char); 23835 int vec_all_lt (vector bool char, vector signed char); 23836 int vec_all_lt (vector signed char, vector bool char); 23837 int vec_all_lt (vector signed char, vector signed char); 23838 int vec_all_lt (vector bool short, vector unsigned short); 23839 int vec_all_lt (vector unsigned short, vector bool short); 23840 int vec_all_lt (vector unsigned short, vector unsigned short); 23841 int vec_all_lt (vector bool short, vector signed short); 23842 int vec_all_lt (vector signed short, vector bool short); 23843 int vec_all_lt (vector signed short, vector signed short); 23844 int vec_all_lt (vector bool int, vector unsigned int); 23845 int vec_all_lt (vector unsigned int, vector bool int); 23846 int vec_all_lt (vector unsigned int, vector unsigned int); 23847 int vec_all_lt (vector bool int, vector signed int); 23848 int vec_all_lt (vector signed int, vector bool int); 23849 int vec_all_lt (vector signed int, vector signed int); 23850 int vec_all_lt (vector float, vector float); 23851 23852 int vec_all_nan (vector float); 23853 23854 int vec_all_ne (vector signed char, vector bool char); 23855 int vec_all_ne (vector signed char, vector signed char); 23856 int vec_all_ne (vector unsigned char, vector bool char); 23857 int vec_all_ne (vector unsigned char, vector unsigned char); 23858 int vec_all_ne (vector bool char, vector bool char); 23859 int vec_all_ne (vector bool char, vector unsigned char); 23860 int vec_all_ne (vector bool char, vector signed char); 23861 int vec_all_ne (vector signed short, vector bool short); 23862 int vec_all_ne (vector signed short, vector signed short); 23863 int vec_all_ne (vector unsigned short, vector bool short); 23864 int vec_all_ne (vector unsigned short, vector unsigned short); 23865 int vec_all_ne (vector bool short, vector bool short); 23866 int vec_all_ne (vector bool short, vector unsigned short); 23867 int vec_all_ne (vector bool short, vector signed short); 23868 int vec_all_ne (vector pixel, vector pixel); 23869 int vec_all_ne (vector signed int, vector bool int); 23870 int vec_all_ne (vector signed int, vector signed int); 23871 int vec_all_ne (vector unsigned int, vector bool int); 23872 int vec_all_ne (vector unsigned int, vector unsigned int); 23873 int vec_all_ne (vector bool int, vector bool int); 23874 int vec_all_ne (vector bool int, vector unsigned int); 23875 int vec_all_ne (vector bool int, vector signed int); 23876 int vec_all_ne (vector float, vector float); 23877 23878 int vec_all_nge (vector float, vector float); 23879 23880 int vec_all_ngt (vector float, vector float); 23881 23882 int vec_all_nle (vector float, vector float); 23883 23884 int vec_all_nlt (vector float, vector float); 23885 23886 int vec_all_numeric (vector float); 23887 23888 int vec_any_eq (vector signed char, vector bool char); 23889 int vec_any_eq (vector signed char, vector signed char); 23890 int vec_any_eq (vector unsigned char, vector bool char); 23891 int vec_any_eq (vector unsigned char, vector unsigned char); 23892 int vec_any_eq (vector bool char, vector bool char); 23893 int vec_any_eq (vector bool char, vector unsigned char); 23894 int vec_any_eq (vector bool char, vector signed char); 23895 int vec_any_eq (vector signed short, vector bool short); 23896 int vec_any_eq (vector signed short, vector signed short); 23897 int vec_any_eq (vector unsigned short, vector bool short); 23898 int vec_any_eq (vector unsigned short, vector unsigned short); 23899 int vec_any_eq (vector bool short, vector bool short); 23900 int vec_any_eq (vector bool short, vector unsigned short); 23901 int vec_any_eq (vector bool short, vector signed short); 23902 int vec_any_eq (vector pixel, vector pixel); 23903 int vec_any_eq (vector signed int, vector bool int); 23904 int vec_any_eq (vector signed int, vector signed int); 23905 int vec_any_eq (vector unsigned int, vector bool int); 23906 int vec_any_eq (vector unsigned int, vector unsigned int); 23907 int vec_any_eq (vector bool int, vector bool int); 23908 int vec_any_eq (vector bool int, vector unsigned int); 23909 int vec_any_eq (vector bool int, vector signed int); 23910 int vec_any_eq (vector float, vector float); 23911 23912 int vec_any_ge (vector signed char, vector bool char); 23913 int vec_any_ge (vector unsigned char, vector bool char); 23914 int vec_any_ge (vector unsigned char, vector unsigned char); 23915 int vec_any_ge (vector signed char, vector signed char); 23916 int vec_any_ge (vector bool char, vector unsigned char); 23917 int vec_any_ge (vector bool char, vector signed char); 23918 int vec_any_ge (vector unsigned short, vector bool short); 23919 int vec_any_ge (vector unsigned short, vector unsigned short); 23920 int vec_any_ge (vector signed short, vector signed short); 23921 int vec_any_ge (vector signed short, vector bool short); 23922 int vec_any_ge (vector bool short, vector unsigned short); 23923 int vec_any_ge (vector bool short, vector signed short); 23924 int vec_any_ge (vector signed int, vector bool int); 23925 int vec_any_ge (vector unsigned int, vector bool int); 23926 int vec_any_ge (vector unsigned int, vector unsigned int); 23927 int vec_any_ge (vector signed int, vector signed int); 23928 int vec_any_ge (vector bool int, vector unsigned int); 23929 int vec_any_ge (vector bool int, vector signed int); 23930 int vec_any_ge (vector float, vector float); 23931 23932 int vec_any_gt (vector bool char, vector unsigned char); 23933 int vec_any_gt (vector unsigned char, vector bool char); 23934 int vec_any_gt (vector unsigned char, vector unsigned char); 23935 int vec_any_gt (vector bool char, vector signed char); 23936 int vec_any_gt (vector signed char, vector bool char); 23937 int vec_any_gt (vector signed char, vector signed char); 23938 int vec_any_gt (vector bool short, vector unsigned short); 23939 int vec_any_gt (vector unsigned short, vector bool short); 23940 int vec_any_gt (vector unsigned short, vector unsigned short); 23941 int vec_any_gt (vector bool short, vector signed short); 23942 int vec_any_gt (vector signed short, vector bool short); 23943 int vec_any_gt (vector signed short, vector signed short); 23944 int vec_any_gt (vector bool int, vector unsigned int); 23945 int vec_any_gt (vector unsigned int, vector bool int); 23946 int vec_any_gt (vector unsigned int, vector unsigned int); 23947 int vec_any_gt (vector bool int, vector signed int); 23948 int vec_any_gt (vector signed int, vector bool int); 23949 int vec_any_gt (vector signed int, vector signed int); 23950 int vec_any_gt (vector float, vector float); 23951 23952 int vec_any_le (vector bool char, vector unsigned char); 23953 int vec_any_le (vector unsigned char, vector bool char); 23954 int vec_any_le (vector unsigned char, vector unsigned char); 23955 int vec_any_le (vector bool char, vector signed char); 23956 int vec_any_le (vector signed char, vector bool char); 23957 int vec_any_le (vector signed char, vector signed char); 23958 int vec_any_le (vector bool short, vector unsigned short); 23959 int vec_any_le (vector unsigned short, vector bool short); 23960 int vec_any_le (vector unsigned short, vector unsigned short); 23961 int vec_any_le (vector bool short, vector signed short); 23962 int vec_any_le (vector signed short, vector bool short); 23963 int vec_any_le (vector signed short, vector signed short); 23964 int vec_any_le (vector bool int, vector unsigned int); 23965 int vec_any_le (vector unsigned int, vector bool int); 23966 int vec_any_le (vector unsigned int, vector unsigned int); 23967 int vec_any_le (vector bool int, vector signed int); 23968 int vec_any_le (vector signed int, vector bool int); 23969 int vec_any_le (vector signed int, vector signed int); 23970 int vec_any_le (vector float, vector float); 23971 23972 int vec_any_lt (vector bool char, vector unsigned char); 23973 int vec_any_lt (vector unsigned char, vector bool char); 23974 int vec_any_lt (vector unsigned char, vector unsigned char); 23975 int vec_any_lt (vector bool char, vector signed char); 23976 int vec_any_lt (vector signed char, vector bool char); 23977 int vec_any_lt (vector signed char, vector signed char); 23978 int vec_any_lt (vector bool short, vector unsigned short); 23979 int vec_any_lt (vector unsigned short, vector bool short); 23980 int vec_any_lt (vector unsigned short, vector unsigned short); 23981 int vec_any_lt (vector bool short, vector signed short); 23982 int vec_any_lt (vector signed short, vector bool short); 23983 int vec_any_lt (vector signed short, vector signed short); 23984 int vec_any_lt (vector bool int, vector unsigned int); 23985 int vec_any_lt (vector unsigned int, vector bool int); 23986 int vec_any_lt (vector unsigned int, vector unsigned int); 23987 int vec_any_lt (vector bool int, vector signed int); 23988 int vec_any_lt (vector signed int, vector bool int); 23989 int vec_any_lt (vector signed int, vector signed int); 23990 int vec_any_lt (vector float, vector float); 23991 23992 int vec_any_nan (vector float); 23993 23994 int vec_any_ne (vector signed char, vector bool char); 23995 int vec_any_ne (vector signed char, vector signed char); 23996 int vec_any_ne (vector unsigned char, vector bool char); 23997 int vec_any_ne (vector unsigned char, vector unsigned char); 23998 int vec_any_ne (vector bool char, vector bool char); 23999 int vec_any_ne (vector bool char, vector unsigned char); 24000 int vec_any_ne (vector bool char, vector signed char); 24001 int vec_any_ne (vector signed short, vector bool short); 24002 int vec_any_ne (vector signed short, vector signed short); 24003 int vec_any_ne (vector unsigned short, vector bool short); 24004 int vec_any_ne (vector unsigned short, vector unsigned short); 24005 int vec_any_ne (vector bool short, vector bool short); 24006 int vec_any_ne (vector bool short, vector unsigned short); 24007 int vec_any_ne (vector bool short, vector signed short); 24008 int vec_any_ne (vector pixel, vector pixel); 24009 int vec_any_ne (vector signed int, vector bool int); 24010 int vec_any_ne (vector signed int, vector signed int); 24011 int vec_any_ne (vector unsigned int, vector bool int); 24012 int vec_any_ne (vector unsigned int, vector unsigned int); 24013 int vec_any_ne (vector bool int, vector bool int); 24014 int vec_any_ne (vector bool int, vector unsigned int); 24015 int vec_any_ne (vector bool int, vector signed int); 24016 int vec_any_ne (vector float, vector float); 24017 24018 int vec_any_nge (vector float, vector float); 24019 24020 int vec_any_ngt (vector float, vector float); 24021 24022 int vec_any_nle (vector float, vector float); 24023 24024 int vec_any_nlt (vector float, vector float); 24025 24026 int vec_any_numeric (vector float); 24027 24028 int vec_any_out (vector float, vector float); 24029 24030 24031File: gcc.info, Node: SPARC VIS Built-in Functions, Prev: PowerPC AltiVec Built-in Functions, Up: Target Builtins 24032 240335.48.9 SPARC VIS Built-in Functions 24034----------------------------------- 24035 24036GCC supports SIMD operations on the SPARC using both the generic vector 24037extensions (*note Vector Extensions::) as well as built-in functions for 24038the SPARC Visual Instruction Set (VIS). When you use the `-mvis' 24039switch, the VIS extension is exposed as the following built-in 24040functions: 24041 24042 typedef int v2si __attribute__ ((vector_size (8))); 24043 typedef short v4hi __attribute__ ((vector_size (8))); 24044 typedef short v2hi __attribute__ ((vector_size (4))); 24045 typedef char v8qi __attribute__ ((vector_size (8))); 24046 typedef char v4qi __attribute__ ((vector_size (4))); 24047 24048 void * __builtin_vis_alignaddr (void *, long); 24049 int64_t __builtin_vis_faligndatadi (int64_t, int64_t); 24050 v2si __builtin_vis_faligndatav2si (v2si, v2si); 24051 v4hi __builtin_vis_faligndatav4hi (v4si, v4si); 24052 v8qi __builtin_vis_faligndatav8qi (v8qi, v8qi); 24053 24054 v4hi __builtin_vis_fexpand (v4qi); 24055 24056 v4hi __builtin_vis_fmul8x16 (v4qi, v4hi); 24057 v4hi __builtin_vis_fmul8x16au (v4qi, v4hi); 24058 v4hi __builtin_vis_fmul8x16al (v4qi, v4hi); 24059 v4hi __builtin_vis_fmul8sux16 (v8qi, v4hi); 24060 v4hi __builtin_vis_fmul8ulx16 (v8qi, v4hi); 24061 v2si __builtin_vis_fmuld8sux16 (v4qi, v2hi); 24062 v2si __builtin_vis_fmuld8ulx16 (v4qi, v2hi); 24063 24064 v4qi __builtin_vis_fpack16 (v4hi); 24065 v8qi __builtin_vis_fpack32 (v2si, v2si); 24066 v2hi __builtin_vis_fpackfix (v2si); 24067 v8qi __builtin_vis_fpmerge (v4qi, v4qi); 24068 24069 int64_t __builtin_vis_pdist (v8qi, v8qi, int64_t); 24070 24071 24072File: gcc.info, Node: Target Format Checks, Next: Pragmas, Prev: Target Builtins, Up: C Extensions 24073 240745.49 Format Checks Specific to Particular Target Machines 24075========================================================= 24076 24077For some target machines, GCC supports additional options to the format 24078attribute (*note Declaring Attributes of Functions: Function 24079Attributes.). 24080 24081* Menu: 24082 24083* Solaris Format Checks:: 24084 24085 24086File: gcc.info, Node: Solaris Format Checks, Up: Target Format Checks 24087 240885.49.1 Solaris Format Checks 24089---------------------------- 24090 24091Solaris targets support the `cmn_err' (or `__cmn_err__') format check. 24092`cmn_err' accepts a subset of the standard `printf' conversions, and 24093the two-argument `%b' conversion for displaying bit-fields. See the 24094Solaris man page for `cmn_err' for more information. 24095 24096 24097File: gcc.info, Node: Pragmas, Next: Unnamed Fields, Prev: Target Format Checks, Up: C Extensions 24098 240995.50 Pragmas Accepted by GCC 24100============================ 24101 24102GCC supports several types of pragmas, primarily in order to compile 24103code originally written for other compilers. Note that in general we 24104do not recommend the use of pragmas; *Note Function Attributes::, for 24105further explanation. 24106 24107* Menu: 24108 24109* ARM Pragmas:: 24110* M32C Pragmas:: 24111* RS/6000 and PowerPC Pragmas:: 24112* Darwin Pragmas:: 24113* Solaris Pragmas:: 24114* Symbol-Renaming Pragmas:: 24115* Structure-Packing Pragmas:: 24116* Weak Pragmas:: 24117* Diagnostic Pragmas:: 24118* Visibility Pragmas:: 24119 24120 24121File: gcc.info, Node: ARM Pragmas, Next: M32C Pragmas, Up: Pragmas 24122 241235.50.1 ARM Pragmas 24124------------------ 24125 24126The ARM target defines pragmas for controlling the default addition of 24127`long_call' and `short_call' attributes to functions. *Note Function 24128Attributes::, for information about the effects of these attributes. 24129 24130`long_calls' 24131 Set all subsequent functions to have the `long_call' attribute. 24132 24133`no_long_calls' 24134 Set all subsequent functions to have the `short_call' attribute. 24135 24136`long_calls_off' 24137 Do not affect the `long_call' or `short_call' attributes of 24138 subsequent functions. 24139 24140 24141File: gcc.info, Node: M32C Pragmas, Next: RS/6000 and PowerPC Pragmas, Prev: ARM Pragmas, Up: Pragmas 24142 241435.50.2 M32C Pragmas 24144------------------- 24145 24146`memregs NUMBER' 24147 Overrides the command line option `-memregs=' for the current 24148 file. Use with care! This pragma must be before any function in 24149 the file, and mixing different memregs values in different objects 24150 may make them incompatible. This pragma is useful when a 24151 performance-critical function uses a memreg for temporary values, 24152 as it may allow you to reduce the number of memregs used. 24153 24154 24155 24156File: gcc.info, Node: RS/6000 and PowerPC Pragmas, Next: Darwin Pragmas, Prev: M32C Pragmas, Up: Pragmas 24157 241585.50.3 RS/6000 and PowerPC Pragmas 24159---------------------------------- 24160 24161The RS/6000 and PowerPC targets define one pragma for controlling 24162whether or not the `longcall' attribute is added to function 24163declarations by default. This pragma overrides the `-mlongcall' 24164option, but not the `longcall' and `shortcall' attributes. *Note 24165RS/6000 and PowerPC Options::, for more information about when long 24166calls are and are not necessary. 24167 24168`longcall (1)' 24169 Apply the `longcall' attribute to all subsequent function 24170 declarations. 24171 24172`longcall (0)' 24173 Do not apply the `longcall' attribute to subsequent function 24174 declarations. 24175 24176 24177File: gcc.info, Node: Darwin Pragmas, Next: Solaris Pragmas, Prev: RS/6000 and PowerPC Pragmas, Up: Pragmas 24178 241795.50.4 Darwin Pragmas 24180--------------------- 24181 24182The following pragmas are available for all architectures running the 24183Darwin operating system. These are useful for compatibility with other 24184Mac OS compilers. 24185 24186`mark TOKENS...' 24187 This pragma is accepted, but has no effect. 24188 24189`options align=ALIGNMENT' 24190 This pragma sets the alignment of fields in structures. The 24191 values of ALIGNMENT may be `mac68k', to emulate m68k alignment, or 24192 `power', to emulate PowerPC alignment. Uses of this pragma nest 24193 properly; to restore the previous setting, use `reset' for the 24194 ALIGNMENT. 24195 24196`segment TOKENS...' 24197 This pragma is accepted, but has no effect. 24198 24199`unused (VAR [, VAR]...)' 24200 This pragma declares variables to be possibly unused. GCC will not 24201 produce warnings for the listed variables. The effect is similar 24202 to that of the `unused' attribute, except that this pragma may 24203 appear anywhere within the variables' scopes. 24204 24205 24206File: gcc.info, Node: Solaris Pragmas, Next: Symbol-Renaming Pragmas, Prev: Darwin Pragmas, Up: Pragmas 24207 242085.50.5 Solaris Pragmas 24209---------------------- 24210 24211The Solaris target supports `#pragma redefine_extname' (*note 24212Symbol-Renaming Pragmas::). It also supports additional `#pragma' 24213directives for compatibility with the system compiler. 24214 24215`align ALIGNMENT (VARIABLE [, VARIABLE]...)' 24216 Increase the minimum alignment of each VARIABLE to ALIGNMENT. 24217 This is the same as GCC's `aligned' attribute *note Variable 24218 Attributes::). Macro expansion occurs on the arguments to this 24219 pragma when compiling C and Objective-C. It does not currently 24220 occur when compiling C++, but this is a bug which may be fixed in 24221 a future release. 24222 24223`fini (FUNCTION [, FUNCTION]...)' 24224 This pragma causes each listed FUNCTION to be called after main, 24225 or during shared module unloading, by adding a call to the `.fini' 24226 section. 24227 24228`init (FUNCTION [, FUNCTION]...)' 24229 This pragma causes each listed FUNCTION to be called during 24230 initialization (before `main') or during shared module loading, by 24231 adding a call to the `.init' section. 24232 24233 24234 24235File: gcc.info, Node: Symbol-Renaming Pragmas, Next: Structure-Packing Pragmas, Prev: Solaris Pragmas, Up: Pragmas 24236 242375.50.6 Symbol-Renaming Pragmas 24238------------------------------ 24239 24240For compatibility with the Solaris and Tru64 UNIX system headers, GCC 24241supports two `#pragma' directives which change the name used in 24242assembly for a given declaration. These pragmas are only available on 24243platforms whose system headers need them. To get this effect on all 24244platforms supported by GCC, use the asm labels extension (*note Asm 24245Labels::). 24246 24247`redefine_extname OLDNAME NEWNAME' 24248 This pragma gives the C function OLDNAME the assembly symbol 24249 NEWNAME. The preprocessor macro `__PRAGMA_REDEFINE_EXTNAME' will 24250 be defined if this pragma is available (currently only on Solaris). 24251 24252`extern_prefix STRING' 24253 This pragma causes all subsequent external function and variable 24254 declarations to have STRING prepended to their assembly symbols. 24255 This effect may be terminated with another `extern_prefix' pragma 24256 whose argument is an empty string. The preprocessor macro 24257 `__PRAGMA_EXTERN_PREFIX' will be defined if this pragma is 24258 available (currently only on Tru64 UNIX). 24259 24260 These pragmas and the asm labels extension interact in a complicated 24261manner. Here are some corner cases you may want to be aware of. 24262 24263 1. Both pragmas silently apply only to declarations with external 24264 linkage. Asm labels do not have this restriction. 24265 24266 2. In C++, both pragmas silently apply only to declarations with "C" 24267 linkage. Again, asm labels do not have this restriction. 24268 24269 3. If any of the three ways of changing the assembly name of a 24270 declaration is applied to a declaration whose assembly name has 24271 already been determined (either by a previous use of one of these 24272 features, or because the compiler needed the assembly name in 24273 order to generate code), and the new name is different, a warning 24274 issues and the name does not change. 24275 24276 4. The OLDNAME used by `#pragma redefine_extname' is always the 24277 C-language name. 24278 24279 5. If `#pragma extern_prefix' is in effect, and a declaration occurs 24280 with an asm label attached, the prefix is silently ignored for 24281 that declaration. 24282 24283 6. If `#pragma extern_prefix' and `#pragma redefine_extname' apply to 24284 the same declaration, whichever triggered first wins, and a 24285 warning issues if they contradict each other. (We would like to 24286 have `#pragma redefine_extname' always win, for consistency with 24287 asm labels, but if `#pragma extern_prefix' triggers first we have 24288 no way of knowing that that happened.) 24289 24290 24291File: gcc.info, Node: Structure-Packing Pragmas, Next: Weak Pragmas, Prev: Symbol-Renaming Pragmas, Up: Pragmas 24292 242935.50.7 Structure-Packing Pragmas 24294-------------------------------- 24295 24296For compatibility with Win32, GCC supports a set of `#pragma' 24297directives which change the maximum alignment of members of structures 24298(other than zero-width bitfields), unions, and classes subsequently 24299defined. The N value below always is required to be a small power of 24300two and specifies the new alignment in bytes. 24301 24302 1. `#pragma pack(N)' simply sets the new alignment. 24303 24304 2. `#pragma pack()' sets the alignment to the one that was in effect 24305 when compilation started (see also command line option 24306 `-fpack-struct[=<n>]' *note Code Gen Options::). 24307 24308 3. `#pragma pack(push[,N])' pushes the current alignment setting on 24309 an internal stack and then optionally sets the new alignment. 24310 24311 4. `#pragma pack(pop)' restores the alignment setting to the one 24312 saved at the top of the internal stack (and removes that stack 24313 entry). Note that `#pragma pack([N])' does not influence this 24314 internal stack; thus it is possible to have `#pragma pack(push)' 24315 followed by multiple `#pragma pack(N)' instances and finalized by 24316 a single `#pragma pack(pop)'. 24317 24318 Some targets, e.g. i386 and powerpc, support the `ms_struct' `#pragma' 24319which lays out a structure as the documented `__attribute__ 24320((ms_struct))'. 24321 1. `#pragma ms_struct on' turns on the layout for structures declared. 24322 24323 2. `#pragma ms_struct off' turns off the layout for structures 24324 declared. 24325 24326 3. `#pragma ms_struct reset' goes back to the default layout. 24327 24328 24329File: gcc.info, Node: Weak Pragmas, Next: Diagnostic Pragmas, Prev: Structure-Packing Pragmas, Up: Pragmas 24330 243315.50.8 Weak Pragmas 24332------------------- 24333 24334For compatibility with SVR4, GCC supports a set of `#pragma' directives 24335for declaring symbols to be weak, and defining weak aliases. 24336 24337`#pragma weak SYMBOL' 24338 This pragma declares SYMBOL to be weak, as if the declaration had 24339 the attribute of the same name. The pragma may appear before or 24340 after the declaration of SYMBOL, but must appear before either its 24341 first use or its definition. It is not an error for SYMBOL to 24342 never be defined at all. 24343 24344`#pragma weak SYMBOL1 = SYMBOL2' 24345 This pragma declares SYMBOL1 to be a weak alias of SYMBOL2. It is 24346 an error if SYMBOL2 is not defined in the current translation unit. 24347 24348 24349File: gcc.info, Node: Diagnostic Pragmas, Next: Visibility Pragmas, Prev: Weak Pragmas, Up: Pragmas 24350 243515.50.9 Diagnostic Pragmas 24352------------------------- 24353 24354GCC allows the user to selectively enable or disable certain types of 24355diagnostics, and change the kind of the diagnostic. For example, a 24356project's policy might require that all sources compile with `-Werror' 24357but certain files might have exceptions allowing specific types of 24358warnings. Or, a project might selectively enable diagnostics and treat 24359them as errors depending on which preprocessor macros are defined. 24360 24361`#pragma GCC diagnostic KIND OPTION' 24362 Modifies the disposition of a diagnostic. Note that not all 24363 diagnostics are modifiable; at the moment only warnings (normally 24364 controlled by `-W...') can be controlled, and not all of them. 24365 Use `-fdiagnostics-show-option' to determine which diagnostics are 24366 controllable and which option controls them. 24367 24368 KIND is `error' to treat this diagnostic as an error, `warning' to 24369 treat it like a warning (even if `-Werror' is in effect), or 24370 `ignored' if the diagnostic is to be ignored. OPTION is a double 24371 quoted string which matches the command line option. 24372 24373 #pragma GCC diagnostic warning "-Wformat" 24374 #pragma GCC diagnostic error "-Wformat" 24375 #pragma GCC diagnostic ignored "-Wformat" 24376 24377 Note that these pragmas override any command line options. Also, 24378 while it is syntactically valid to put these pragmas anywhere in 24379 your sources, the only supported location for them is before any 24380 data or functions are defined. Doing otherwise may result in 24381 unpredictable results depending on how the optimizer manages your 24382 sources. If the same option is listed multiple times, the last 24383 one specified is the one that is in effect. This pragma is not 24384 intended to be a general purpose replacement for command line 24385 options, but for implementing strict control over project policies. 24386 24387 24388 24389File: gcc.info, Node: Visibility Pragmas, Prev: Diagnostic Pragmas, Up: Pragmas 24390 243915.50.10 Visibility Pragmas 24392-------------------------- 24393 24394`#pragma GCC visibility push(VISIBILITY)' 24395`#pragma GCC visibility pop' 24396 This pragma allows the user to set the visibility for multiple 24397 declarations without having to give each a visibility attribute 24398 *Note Function Attributes::, for more information about visibility 24399 and the attribute syntax. 24400 24401 In C++, `#pragma GCC visibility' affects only namespace-scope 24402 declarations. Class members and template specializations are not 24403 affected; if you want to override the visibility for a particular 24404 member or instantiation, you must use an attribute. 24405 24406 24407 24408File: gcc.info, Node: Unnamed Fields, Next: Thread-Local, Prev: Pragmas, Up: C Extensions 24409 244105.51 Unnamed struct/union fields within structs/unions 24411====================================================== 24412 24413For compatibility with other compilers, GCC allows you to define a 24414structure or union that contains, as fields, structures and unions 24415without names. For example: 24416 24417 struct { 24418 int a; 24419 union { 24420 int b; 24421 float c; 24422 }; 24423 int d; 24424 } foo; 24425 24426 In this example, the user would be able to access members of the 24427unnamed union with code like `foo.b'. Note that only unnamed structs 24428and unions are allowed, you may not have, for example, an unnamed `int'. 24429 24430 You must never create such structures that cause ambiguous field 24431definitions. For example, this structure: 24432 24433 struct { 24434 int a; 24435 struct { 24436 int a; 24437 }; 24438 } foo; 24439 24440 It is ambiguous which `a' is being referred to with `foo.a'. Such 24441constructs are not supported and must be avoided. In the future, such 24442constructs may be detected and treated as compilation errors. 24443 24444 Unless `-fms-extensions' is used, the unnamed field must be a 24445structure or union definition without a tag (for example, `struct { int 24446a; };'). If `-fms-extensions' is used, the field may also be a 24447definition with a tag such as `struct foo { int a; };', a reference to 24448a previously defined structure or union such as `struct foo;', or a 24449reference to a `typedef' name for a previously defined structure or 24450union type. 24451 24452 24453File: gcc.info, Node: Thread-Local, Prev: Unnamed Fields, Up: C Extensions 24454 244555.52 Thread-Local Storage 24456========================= 24457 24458Thread-local storage (TLS) is a mechanism by which variables are 24459allocated such that there is one instance of the variable per extant 24460thread. The run-time model GCC uses to implement this originates in 24461the IA-64 processor-specific ABI, but has since been migrated to other 24462processors as well. It requires significant support from the linker 24463(`ld'), dynamic linker (`ld.so'), and system libraries (`libc.so' and 24464`libpthread.so'), so it is not available everywhere. 24465 24466 At the user level, the extension is visible with a new storage class 24467keyword: `__thread'. For example: 24468 24469 __thread int i; 24470 extern __thread struct state s; 24471 static __thread char *p; 24472 24473 The `__thread' specifier may be used alone, with the `extern' or 24474`static' specifiers, but with no other storage class specifier. When 24475used with `extern' or `static', `__thread' must appear immediately 24476after the other storage class specifier. 24477 24478 The `__thread' specifier may be applied to any global, file-scoped 24479static, function-scoped static, or static data member of a class. It 24480may not be applied to block-scoped automatic or non-static data member. 24481 24482 When the address-of operator is applied to a thread-local variable, it 24483is evaluated at run-time and returns the address of the current thread's 24484instance of that variable. An address so obtained may be used by any 24485thread. When a thread terminates, any pointers to thread-local 24486variables in that thread become invalid. 24487 24488 No static initialization may refer to the address of a thread-local 24489variable. 24490 24491 In C++, if an initializer is present for a thread-local variable, it 24492must be a CONSTANT-EXPRESSION, as defined in 5.19.2 of the ANSI/ISO C++ 24493standard. 24494 24495 See ELF Handling For Thread-Local Storage 24496(http://people.redhat.com/drepper/tls.pdf) for a detailed explanation of 24497the four thread-local storage addressing models, and how the run-time 24498is expected to function. 24499 24500* Menu: 24501 24502* C99 Thread-Local Edits:: 24503* C++98 Thread-Local Edits:: 24504 24505 24506File: gcc.info, Node: C99 Thread-Local Edits, Next: C++98 Thread-Local Edits, Up: Thread-Local 24507 245085.52.1 ISO/IEC 9899:1999 Edits for Thread-Local Storage 24509------------------------------------------------------- 24510 24511The following are a set of changes to ISO/IEC 9899:1999 (aka C99) that 24512document the exact semantics of the language extension. 24513 24514 * `5.1.2 Execution environments' 24515 24516 Add new text after paragraph 1 24517 24518 Within either execution environment, a "thread" is a flow of 24519 control within a program. It is implementation defined 24520 whether or not there may be more than one thread associated 24521 with a program. It is implementation defined how threads 24522 beyond the first are created, the name and type of the 24523 function called at thread startup, and how threads may be 24524 terminated. However, objects with thread storage duration 24525 shall be initialized before thread startup. 24526 24527 * `6.2.4 Storage durations of objects' 24528 24529 Add new text before paragraph 3 24530 24531 An object whose identifier is declared with the storage-class 24532 specifier `__thread' has "thread storage duration". Its 24533 lifetime is the entire execution of the thread, and its 24534 stored value is initialized only once, prior to thread 24535 startup. 24536 24537 * `6.4.1 Keywords' 24538 24539 Add `__thread'. 24540 24541 * `6.7.1 Storage-class specifiers' 24542 24543 Add `__thread' to the list of storage class specifiers in 24544 paragraph 1. 24545 24546 Change paragraph 2 to 24547 24548 With the exception of `__thread', at most one storage-class 24549 specifier may be given [...]. The `__thread' specifier may 24550 be used alone, or immediately following `extern' or `static'. 24551 24552 Add new text after paragraph 6 24553 24554 The declaration of an identifier for a variable that has 24555 block scope that specifies `__thread' shall also specify 24556 either `extern' or `static'. 24557 24558 The `__thread' specifier shall be used only with variables. 24559 24560 24561File: gcc.info, Node: C++98 Thread-Local Edits, Prev: C99 Thread-Local Edits, Up: Thread-Local 24562 245635.52.2 ISO/IEC 14882:1998 Edits for Thread-Local Storage 24564-------------------------------------------------------- 24565 24566The following are a set of changes to ISO/IEC 14882:1998 (aka C++98) 24567that document the exact semantics of the language extension. 24568 24569 * [intro.execution] 24570 24571 New text after paragraph 4 24572 24573 A "thread" is a flow of control within the abstract machine. 24574 It is implementation defined whether or not there may be more 24575 than one thread. 24576 24577 New text after paragraph 7 24578 24579 It is unspecified whether additional action must be taken to 24580 ensure when and whether side effects are visible to other 24581 threads. 24582 24583 * [lex.key] 24584 24585 Add `__thread'. 24586 24587 * [basic.start.main] 24588 24589 Add after paragraph 5 24590 24591 The thread that begins execution at the `main' function is 24592 called the "main thread". It is implementation defined how 24593 functions beginning threads other than the main thread are 24594 designated or typed. A function so designated, as well as 24595 the `main' function, is called a "thread startup function". 24596 It is implementation defined what happens if a thread startup 24597 function returns. It is implementation defined what happens 24598 to other threads when any thread calls `exit'. 24599 24600 * [basic.start.init] 24601 24602 Add after paragraph 4 24603 24604 The storage for an object of thread storage duration shall be 24605 statically initialized before the first statement of the 24606 thread startup function. An object of thread storage 24607 duration shall not require dynamic initialization. 24608 24609 * [basic.start.term] 24610 24611 Add after paragraph 3 24612 24613 The type of an object with thread storage duration shall not 24614 have a non-trivial destructor, nor shall it be an array type 24615 whose elements (directly or indirectly) have non-trivial 24616 destructors. 24617 24618 * [basic.stc] 24619 24620 Add "thread storage duration" to the list in paragraph 1. 24621 24622 Change paragraph 2 24623 24624 Thread, static, and automatic storage durations are 24625 associated with objects introduced by declarations [...]. 24626 24627 Add `__thread' to the list of specifiers in paragraph 3. 24628 24629 * [basic.stc.thread] 24630 24631 New section before [basic.stc.static] 24632 24633 The keyword `__thread' applied to a non-local object gives the 24634 object thread storage duration. 24635 24636 A local variable or class data member declared both `static' 24637 and `__thread' gives the variable or member thread storage 24638 duration. 24639 24640 * [basic.stc.static] 24641 24642 Change paragraph 1 24643 24644 All objects which have neither thread storage duration, 24645 dynamic storage duration nor are local [...]. 24646 24647 * [dcl.stc] 24648 24649 Add `__thread' to the list in paragraph 1. 24650 24651 Change paragraph 1 24652 24653 With the exception of `__thread', at most one 24654 STORAGE-CLASS-SPECIFIER shall appear in a given 24655 DECL-SPECIFIER-SEQ. The `__thread' specifier may be used 24656 alone, or immediately following the `extern' or `static' 24657 specifiers. [...] 24658 24659 Add after paragraph 5 24660 24661 The `__thread' specifier can be applied only to the names of 24662 objects and to anonymous unions. 24663 24664 * [class.mem] 24665 24666 Add after paragraph 6 24667 24668 Non-`static' members shall not be `__thread'. 24669 24670 24671File: gcc.info, Node: C++ Extensions, Next: Objective-C, Prev: C Extensions, Up: Top 24672 246736 Extensions to the C++ Language 24674******************************** 24675 24676The GNU compiler provides these extensions to the C++ language (and you 24677can also use most of the C language extensions in your C++ programs). 24678If you want to write code that checks whether these features are 24679available, you can test for the GNU compiler the same way as for C 24680programs: check for a predefined macro `__GNUC__'. You can also use 24681`__GNUG__' to test specifically for GNU C++ (*note Predefined Macros: 24682(cpp)Common Predefined Macros.). 24683 24684* Menu: 24685 24686* Volatiles:: What constitutes an access to a volatile object. 24687* Restricted Pointers:: C99 restricted pointers and references. 24688* Vague Linkage:: Where G++ puts inlines, vtables and such. 24689* C++ Interface:: You can use a single C++ header file for both 24690 declarations and definitions. 24691* Template Instantiation:: Methods for ensuring that exactly one copy of 24692 each needed template instantiation is emitted. 24693* Bound member functions:: You can extract a function pointer to the 24694 method denoted by a `->*' or `.*' expression. 24695* C++ Attributes:: Variable, function, and type attributes for C++ only. 24696* Namespace Association:: Strong using-directives for namespace association. 24697* Java Exceptions:: Tweaking exception handling to work with Java. 24698* Deprecated Features:: Things will disappear from g++. 24699* Backwards Compatibility:: Compatibilities with earlier definitions of C++. 24700 24701 24702File: gcc.info, Node: Volatiles, Next: Restricted Pointers, Up: C++ Extensions 24703 247046.1 When is a Volatile Object Accessed? 24705======================================= 24706 24707Both the C and C++ standard have the concept of volatile objects. These 24708are normally accessed by pointers and used for accessing hardware. The 24709standards encourage compilers to refrain from optimizations concerning 24710accesses to volatile objects. The C standard leaves it implementation 24711defined as to what constitutes a volatile access. The C++ standard 24712omits to specify this, except to say that C++ should behave in a 24713similar manner to C with respect to volatiles, where possible. The 24714minimum either standard specifies is that at a sequence point all 24715previous accesses to volatile objects have stabilized and no subsequent 24716accesses have occurred. Thus an implementation is free to reorder and 24717combine volatile accesses which occur between sequence points, but 24718cannot do so for accesses across a sequence point. The use of 24719volatiles does not allow you to violate the restriction on updating 24720objects multiple times within a sequence point. 24721 24722 *Note Volatile qualifier and the C compiler: Qualifiers implementation. 24723 24724 The behavior differs slightly between C and C++ in the non-obvious 24725cases: 24726 24727 volatile int *src = SOMEVALUE; 24728 *src; 24729 24730 With C, such expressions are rvalues, and GCC interprets this either 24731as a read of the volatile object being pointed to or only as request to 24732evaluate the side-effects. The C++ standard specifies that such 24733expressions do not undergo lvalue to rvalue conversion, and that the 24734type of the dereferenced object may be incomplete. The C++ standard 24735does not specify explicitly that it is this lvalue to rvalue conversion 24736which may be responsible for causing an access. However, there is 24737reason to believe that it is, because otherwise certain simple 24738expressions become undefined. However, because it would surprise most 24739programmers, G++ treats dereferencing a pointer to volatile object of 24740complete type when the value is unused as GCC would do for an 24741equivalent type in C. When the object has incomplete type, G++ issues 24742a warning; if you wish to force an error, you must force a conversion 24743to rvalue with, for instance, a static cast. 24744 24745 When using a reference to volatile, G++ does not treat equivalent 24746expressions as accesses to volatiles, but instead issues a warning that 24747no volatile is accessed. The rationale for this is that otherwise it 24748becomes difficult to determine where volatile access occur, and not 24749possible to ignore the return value from functions returning volatile 24750references. Again, if you wish to force a read, cast the reference to 24751an rvalue. 24752 24753 24754File: gcc.info, Node: Restricted Pointers, Next: Vague Linkage, Prev: Volatiles, Up: C++ Extensions 24755 247566.2 Restricting Pointer Aliasing 24757================================ 24758 24759As with the C front end, G++ understands the C99 feature of restricted 24760pointers, specified with the `__restrict__', or `__restrict' type 24761qualifier. Because you cannot compile C++ by specifying the `-std=c99' 24762language flag, `restrict' is not a keyword in C++. 24763 24764 In addition to allowing restricted pointers, you can specify restricted 24765references, which indicate that the reference is not aliased in the 24766local context. 24767 24768 void fn (int *__restrict__ rptr, int &__restrict__ rref) 24769 { 24770 /* ... */ 24771 } 24772 24773In the body of `fn', RPTR points to an unaliased integer and RREF 24774refers to a (different) unaliased integer. 24775 24776 You may also specify whether a member function's THIS pointer is 24777unaliased by using `__restrict__' as a member function qualifier. 24778 24779 void T::fn () __restrict__ 24780 { 24781 /* ... */ 24782 } 24783 24784Within the body of `T::fn', THIS will have the effective definition `T 24785*__restrict__ const this'. Notice that the interpretation of a 24786`__restrict__' member function qualifier is different to that of 24787`const' or `volatile' qualifier, in that it is applied to the pointer 24788rather than the object. This is consistent with other compilers which 24789implement restricted pointers. 24790 24791 As with all outermost parameter qualifiers, `__restrict__' is ignored 24792in function definition matching. This means you only need to specify 24793`__restrict__' in a function definition, rather than in a function 24794prototype as well. 24795 24796 24797File: gcc.info, Node: Vague Linkage, Next: C++ Interface, Prev: Restricted Pointers, Up: C++ Extensions 24798 247996.3 Vague Linkage 24800================= 24801 24802There are several constructs in C++ which require space in the object 24803file but are not clearly tied to a single translation unit. We say that 24804these constructs have "vague linkage". Typically such constructs are 24805emitted wherever they are needed, though sometimes we can be more 24806clever. 24807 24808Inline Functions 24809 Inline functions are typically defined in a header file which can 24810 be included in many different compilations. Hopefully they can 24811 usually be inlined, but sometimes an out-of-line copy is 24812 necessary, if the address of the function is taken or if inlining 24813 fails. In general, we emit an out-of-line copy in all translation 24814 units where one is needed. As an exception, we only emit inline 24815 virtual functions with the vtable, since it will always require a 24816 copy. 24817 24818 Local static variables and string constants used in an inline 24819 function are also considered to have vague linkage, since they 24820 must be shared between all inlined and out-of-line instances of 24821 the function. 24822 24823VTables 24824 C++ virtual functions are implemented in most compilers using a 24825 lookup table, known as a vtable. The vtable contains pointers to 24826 the virtual functions provided by a class, and each object of the 24827 class contains a pointer to its vtable (or vtables, in some 24828 multiple-inheritance situations). If the class declares any 24829 non-inline, non-pure virtual functions, the first one is chosen as 24830 the "key method" for the class, and the vtable is only emitted in 24831 the translation unit where the key method is defined. 24832 24833 _Note:_ If the chosen key method is later defined as inline, the 24834 vtable will still be emitted in every translation unit which 24835 defines it. Make sure that any inline virtuals are declared 24836 inline in the class body, even if they are not defined there. 24837 24838type_info objects 24839 C++ requires information about types to be written out in order to 24840 implement `dynamic_cast', `typeid' and exception handling. For 24841 polymorphic classes (classes with virtual functions), the type_info 24842 object is written out along with the vtable so that `dynamic_cast' 24843 can determine the dynamic type of a class object at runtime. For 24844 all other types, we write out the type_info object when it is 24845 used: when applying `typeid' to an expression, throwing an object, 24846 or referring to a type in a catch clause or exception 24847 specification. 24848 24849Template Instantiations 24850 Most everything in this section also applies to template 24851 instantiations, but there are other options as well. *Note 24852 Where's the Template?: Template Instantiation. 24853 24854 24855 When used with GNU ld version 2.8 or later on an ELF system such as 24856GNU/Linux or Solaris 2, or on Microsoft Windows, duplicate copies of 24857these constructs will be discarded at link time. This is known as 24858COMDAT support. 24859 24860 On targets that don't support COMDAT, but do support weak symbols, GCC 24861will use them. This way one copy will override all the others, but the 24862unused copies will still take up space in the executable. 24863 24864 For targets which do not support either COMDAT or weak symbols, most 24865entities with vague linkage will be emitted as local symbols to avoid 24866duplicate definition errors from the linker. This will not happen for 24867local statics in inlines, however, as having multiple copies will 24868almost certainly break things. 24869 24870 *Note Declarations and Definitions in One Header: C++ Interface, for 24871another way to control placement of these constructs. 24872 24873 24874File: gcc.info, Node: C++ Interface, Next: Template Instantiation, Prev: Vague Linkage, Up: C++ Extensions 24875 248766.4 #pragma interface and implementation 24877======================================== 24878 24879`#pragma interface' and `#pragma implementation' provide the user with 24880a way of explicitly directing the compiler to emit entities with vague 24881linkage (and debugging information) in a particular translation unit. 24882 24883 _Note:_ As of GCC 2.7.2, these `#pragma's are not useful in most 24884cases, because of COMDAT support and the "key method" heuristic 24885mentioned in *Note Vague Linkage::. Using them can actually cause your 24886program to grow due to unnecessary out-of-line copies of inline 24887functions. Currently (3.4) the only benefit of these `#pragma's is 24888reduced duplication of debugging information, and that should be 24889addressed soon on DWARF 2 targets with the use of COMDAT groups. 24890 24891`#pragma interface' 24892`#pragma interface "SUBDIR/OBJECTS.h"' 24893 Use this directive in _header files_ that define object classes, 24894 to save space in most of the object files that use those classes. 24895 Normally, local copies of certain information (backup copies of 24896 inline member functions, debugging information, and the internal 24897 tables that implement virtual functions) must be kept in each 24898 object file that includes class definitions. You can use this 24899 pragma to avoid such duplication. When a header file containing 24900 `#pragma interface' is included in a compilation, this auxiliary 24901 information will not be generated (unless the main input source 24902 file itself uses `#pragma implementation'). Instead, the object 24903 files will contain references to be resolved at link time. 24904 24905 The second form of this directive is useful for the case where you 24906 have multiple headers with the same name in different directories. 24907 If you use this form, you must specify the same string to `#pragma 24908 implementation'. 24909 24910`#pragma implementation' 24911`#pragma implementation "OBJECTS.h"' 24912 Use this pragma in a _main input file_, when you want full output 24913 from included header files to be generated (and made globally 24914 visible). The included header file, in turn, should use `#pragma 24915 interface'. Backup copies of inline member functions, debugging 24916 information, and the internal tables used to implement virtual 24917 functions are all generated in implementation files. 24918 24919 If you use `#pragma implementation' with no argument, it applies to 24920 an include file with the same basename(1) as your source file. 24921 For example, in `allclass.cc', giving just `#pragma implementation' 24922 by itself is equivalent to `#pragma implementation "allclass.h"'. 24923 24924 In versions of GNU C++ prior to 2.6.0 `allclass.h' was treated as 24925 an implementation file whenever you would include it from 24926 `allclass.cc' even if you never specified `#pragma 24927 implementation'. This was deemed to be more trouble than it was 24928 worth, however, and disabled. 24929 24930 Use the string argument if you want a single implementation file to 24931 include code from multiple header files. (You must also use 24932 `#include' to include the header file; `#pragma implementation' 24933 only specifies how to use the file--it doesn't actually include 24934 it.) 24935 24936 There is no way to split up the contents of a single header file 24937 into multiple implementation files. 24938 24939 `#pragma implementation' and `#pragma interface' also have an effect 24940on function inlining. 24941 24942 If you define a class in a header file marked with `#pragma 24943interface', the effect on an inline function defined in that class is 24944similar to an explicit `extern' declaration--the compiler emits no code 24945at all to define an independent version of the function. Its 24946definition is used only for inlining with its callers. 24947 24948 Conversely, when you include the same header file in a main source file 24949that declares it as `#pragma implementation', the compiler emits code 24950for the function itself; this defines a version of the function that 24951can be found via pointers (or by callers compiled without inlining). 24952If all calls to the function can be inlined, you can avoid emitting the 24953function by compiling with `-fno-implement-inlines'. If any calls were 24954not inlined, you will get linker errors. 24955 24956 ---------- Footnotes ---------- 24957 24958 (1) A file's "basename" was the name stripped of all leading path 24959information and of trailing suffixes, such as `.h' or `.C' or `.cc'. 24960 24961 24962File: gcc.info, Node: Template Instantiation, Next: Bound member functions, Prev: C++ Interface, Up: C++ Extensions 24963 249646.5 Where's the Template? 24965========================= 24966 24967C++ templates are the first language feature to require more 24968intelligence from the environment than one usually finds on a UNIX 24969system. Somehow the compiler and linker have to make sure that each 24970template instance occurs exactly once in the executable if it is needed, 24971and not at all otherwise. There are two basic approaches to this 24972problem, which are referred to as the Borland model and the Cfront 24973model. 24974 24975Borland model 24976 Borland C++ solved the template instantiation problem by adding 24977 the code equivalent of common blocks to their linker; the compiler 24978 emits template instances in each translation unit that uses them, 24979 and the linker collapses them together. The advantage of this 24980 model is that the linker only has to consider the object files 24981 themselves; there is no external complexity to worry about. This 24982 disadvantage is that compilation time is increased because the 24983 template code is being compiled repeatedly. Code written for this 24984 model tends to include definitions of all templates in the header 24985 file, since they must be seen to be instantiated. 24986 24987Cfront model 24988 The AT&T C++ translator, Cfront, solved the template instantiation 24989 problem by creating the notion of a template repository, an 24990 automatically maintained place where template instances are 24991 stored. A more modern version of the repository works as follows: 24992 As individual object files are built, the compiler places any 24993 template definitions and instantiations encountered in the 24994 repository. At link time, the link wrapper adds in the objects in 24995 the repository and compiles any needed instances that were not 24996 previously emitted. The advantages of this model are more optimal 24997 compilation speed and the ability to use the system linker; to 24998 implement the Borland model a compiler vendor also needs to 24999 replace the linker. The disadvantages are vastly increased 25000 complexity, and thus potential for error; for some code this can be 25001 just as transparent, but in practice it can been very difficult to 25002 build multiple programs in one directory and one program in 25003 multiple directories. Code written for this model tends to 25004 separate definitions of non-inline member templates into a 25005 separate file, which should be compiled separately. 25006 25007 When used with GNU ld version 2.8 or later on an ELF system such as 25008GNU/Linux or Solaris 2, or on Microsoft Windows, G++ supports the 25009Borland model. On other systems, G++ implements neither automatic 25010model. 25011 25012 A future version of G++ will support a hybrid model whereby the 25013compiler will emit any instantiations for which the template definition 25014is included in the compile, and store template definitions and 25015instantiation context information into the object file for the rest. 25016The link wrapper will extract that information as necessary and invoke 25017the compiler to produce the remaining instantiations. The linker will 25018then combine duplicate instantiations. 25019 25020 In the mean time, you have the following options for dealing with 25021template instantiations: 25022 25023 1. Compile your template-using code with `-frepo'. The compiler will 25024 generate files with the extension `.rpo' listing all of the 25025 template instantiations used in the corresponding object files 25026 which could be instantiated there; the link wrapper, `collect2', 25027 will then update the `.rpo' files to tell the compiler where to 25028 place those instantiations and rebuild any affected object files. 25029 The link-time overhead is negligible after the first pass, as the 25030 compiler will continue to place the instantiations in the same 25031 files. 25032 25033 This is your best option for application code written for the 25034 Borland model, as it will just work. Code written for the Cfront 25035 model will need to be modified so that the template definitions 25036 are available at one or more points of instantiation; usually this 25037 is as simple as adding `#include <tmethods.cc>' to the end of each 25038 template header. 25039 25040 For library code, if you want the library to provide all of the 25041 template instantiations it needs, just try to link all of its 25042 object files together; the link will fail, but cause the 25043 instantiations to be generated as a side effect. Be warned, 25044 however, that this may cause conflicts if multiple libraries try 25045 to provide the same instantiations. For greater control, use 25046 explicit instantiation as described in the next option. 25047 25048 2. Compile your code with `-fno-implicit-templates' to disable the 25049 implicit generation of template instances, and explicitly 25050 instantiate all the ones you use. This approach requires more 25051 knowledge of exactly which instances you need than do the others, 25052 but it's less mysterious and allows greater control. You can 25053 scatter the explicit instantiations throughout your program, 25054 perhaps putting them in the translation units where the instances 25055 are used or the translation units that define the templates 25056 themselves; you can put all of the explicit instantiations you 25057 need into one big file; or you can create small files like 25058 25059 #include "Foo.h" 25060 #include "Foo.cc" 25061 25062 template class Foo<int>; 25063 template ostream& operator << 25064 (ostream&, const Foo<int>&); 25065 25066 for each of the instances you need, and create a template 25067 instantiation library from those. 25068 25069 If you are using Cfront-model code, you can probably get away with 25070 not using `-fno-implicit-templates' when compiling files that don't 25071 `#include' the member template definitions. 25072 25073 If you use one big file to do the instantiations, you may want to 25074 compile it without `-fno-implicit-templates' so you get all of the 25075 instances required by your explicit instantiations (but not by any 25076 other files) without having to specify them as well. 25077 25078 G++ has extended the template instantiation syntax given in the ISO 25079 standard to allow forward declaration of explicit instantiations 25080 (with `extern'), instantiation of the compiler support data for a 25081 template class (i.e. the vtable) without instantiating any of its 25082 members (with `inline'), and instantiation of only the static data 25083 members of a template class, without the support data or member 25084 functions (with (`static'): 25085 25086 extern template int max (int, int); 25087 inline template class Foo<int>; 25088 static template class Foo<int>; 25089 25090 3. Do nothing. Pretend G++ does implement automatic instantiation 25091 management. Code written for the Borland model will work fine, but 25092 each translation unit will contain instances of each of the 25093 templates it uses. In a large program, this can lead to an 25094 unacceptable amount of code duplication. 25095 25096 25097File: gcc.info, Node: Bound member functions, Next: C++ Attributes, Prev: Template Instantiation, Up: C++ Extensions 25098 250996.6 Extracting the function pointer from a bound pointer to member function 25100=========================================================================== 25101 25102In C++, pointer to member functions (PMFs) are implemented using a wide 25103pointer of sorts to handle all the possible call mechanisms; the PMF 25104needs to store information about how to adjust the `this' pointer, and 25105if the function pointed to is virtual, where to find the vtable, and 25106where in the vtable to look for the member function. If you are using 25107PMFs in an inner loop, you should really reconsider that decision. If 25108that is not an option, you can extract the pointer to the function that 25109would be called for a given object/PMF pair and call it directly inside 25110the inner loop, to save a bit of time. 25111 25112 Note that you will still be paying the penalty for the call through a 25113function pointer; on most modern architectures, such a call defeats the 25114branch prediction features of the CPU. This is also true of normal 25115virtual function calls. 25116 25117 The syntax for this extension is 25118 25119 extern A a; 25120 extern int (A::*fp)(); 25121 typedef int (*fptr)(A *); 25122 25123 fptr p = (fptr)(a.*fp); 25124 25125 For PMF constants (i.e. expressions of the form `&Klasse::Member'), no 25126object is needed to obtain the address of the function. They can be 25127converted to function pointers directly: 25128 25129 fptr p1 = (fptr)(&A::foo); 25130 25131 You must specify `-Wno-pmf-conversions' to use this extension. 25132 25133 25134File: gcc.info, Node: C++ Attributes, Next: Namespace Association, Prev: Bound member functions, Up: C++ Extensions 25135 251366.7 C++-Specific Variable, Function, and Type Attributes 25137======================================================== 25138 25139Some attributes only make sense for C++ programs. 25140 25141`init_priority (PRIORITY)' 25142 In Standard C++, objects defined at namespace scope are guaranteed 25143 to be initialized in an order in strict accordance with that of 25144 their definitions _in a given translation unit_. No guarantee is 25145 made for initializations across translation units. However, GNU 25146 C++ allows users to control the order of initialization of objects 25147 defined at namespace scope with the `init_priority' attribute by 25148 specifying a relative PRIORITY, a constant integral expression 25149 currently bounded between 101 and 65535 inclusive. Lower numbers 25150 indicate a higher priority. 25151 25152 In the following example, `A' would normally be created before 25153 `B', but the `init_priority' attribute has reversed that order: 25154 25155 Some_Class A __attribute__ ((init_priority (2000))); 25156 Some_Class B __attribute__ ((init_priority (543))); 25157 25158 Note that the particular values of PRIORITY do not matter; only 25159 their relative ordering. 25160 25161`java_interface' 25162 This type attribute informs C++ that the class is a Java 25163 interface. It may only be applied to classes declared within an 25164 `extern "Java"' block. Calls to methods declared in this 25165 interface will be dispatched using GCJ's interface table 25166 mechanism, instead of regular virtual table dispatch. 25167 25168 25169 See also *Note Namespace Association::. 25170 25171 25172File: gcc.info, Node: Namespace Association, Next: Java Exceptions, Prev: C++ Attributes, Up: C++ Extensions 25173 251746.8 Namespace Association 25175========================= 25176 25177*Caution:* The semantics of this extension are not fully defined. 25178Users should refrain from using this extension as its semantics may 25179change subtly over time. It is possible that this extension will be 25180removed in future versions of G++. 25181 25182 A using-directive with `__attribute ((strong))' is stronger than a 25183normal using-directive in two ways: 25184 25185 * Templates from the used namespace can be specialized and explicitly 25186 instantiated as though they were members of the using namespace. 25187 25188 * The using namespace is considered an associated namespace of all 25189 templates in the used namespace for purposes of argument-dependent 25190 name lookup. 25191 25192 The used namespace must be nested within the using namespace so that 25193normal unqualified lookup works properly. 25194 25195 This is useful for composing a namespace transparently from 25196implementation namespaces. For example: 25197 25198 namespace std { 25199 namespace debug { 25200 template <class T> struct A { }; 25201 } 25202 using namespace debug __attribute ((__strong__)); 25203 template <> struct A<int> { }; // ok to specialize 25204 25205 template <class T> void f (A<T>); 25206 } 25207 25208 int main() 25209 { 25210 f (std::A<float>()); // lookup finds std::f 25211 f (std::A<int>()); 25212 } 25213 25214 25215File: gcc.info, Node: Java Exceptions, Next: Deprecated Features, Prev: Namespace Association, Up: C++ Extensions 25216 252176.9 Java Exceptions 25218=================== 25219 25220The Java language uses a slightly different exception handling model 25221from C++. Normally, GNU C++ will automatically detect when you are 25222writing C++ code that uses Java exceptions, and handle them 25223appropriately. However, if C++ code only needs to execute destructors 25224when Java exceptions are thrown through it, GCC will guess incorrectly. 25225Sample problematic code is: 25226 25227 struct S { ~S(); }; 25228 extern void bar(); // is written in Java, and may throw exceptions 25229 void foo() 25230 { 25231 S s; 25232 bar(); 25233 } 25234 25235The usual effect of an incorrect guess is a link failure, complaining of 25236a missing routine called `__gxx_personality_v0'. 25237 25238 You can inform the compiler that Java exceptions are to be used in a 25239translation unit, irrespective of what it might think, by writing 25240`#pragma GCC java_exceptions' at the head of the file. This `#pragma' 25241must appear before any functions that throw or catch exceptions, or run 25242destructors when exceptions are thrown through them. 25243 25244 You cannot mix Java and C++ exceptions in the same translation unit. 25245It is believed to be safe to throw a C++ exception from one file through 25246another file compiled for the Java exception model, or vice versa, but 25247there may be bugs in this area. 25248 25249 25250File: gcc.info, Node: Deprecated Features, Next: Backwards Compatibility, Prev: Java Exceptions, Up: C++ Extensions 25251 252526.10 Deprecated Features 25253======================== 25254 25255In the past, the GNU C++ compiler was extended to experiment with new 25256features, at a time when the C++ language was still evolving. Now that 25257the C++ standard is complete, some of those features are superseded by 25258superior alternatives. Using the old features might cause a warning in 25259some cases that the feature will be dropped in the future. In other 25260cases, the feature might be gone already. 25261 25262 While the list below is not exhaustive, it documents some of the 25263options that are now deprecated: 25264 25265`-fexternal-templates' 25266`-falt-external-templates' 25267 These are two of the many ways for G++ to implement template 25268 instantiation. *Note Template Instantiation::. The C++ standard 25269 clearly defines how template definitions have to be organized 25270 across implementation units. G++ has an implicit instantiation 25271 mechanism that should work just fine for standard-conforming code. 25272 25273`-fstrict-prototype' 25274`-fno-strict-prototype' 25275 Previously it was possible to use an empty prototype parameter 25276 list to indicate an unspecified number of parameters (like C), 25277 rather than no parameters, as C++ demands. This feature has been 25278 removed, except where it is required for backwards compatibility 25279 *Note Backwards Compatibility::. 25280 25281 G++ allows a virtual function returning `void *' to be overridden by 25282one returning a different pointer type. This extension to the 25283covariant return type rules is now deprecated and will be removed from a 25284future version. 25285 25286 The G++ minimum and maximum operators (`<?' and `>?') and their 25287compound forms (`<?=') and `>?=') have been deprecated and will be 25288removed in a future version. Code using these operators should be 25289modified to use `std::min' and `std::max' instead. 25290 25291 The named return value extension has been deprecated, and is now 25292removed from G++. 25293 25294 The use of initializer lists with new expressions has been deprecated, 25295and is now removed from G++. 25296 25297 Floating and complex non-type template parameters have been deprecated, 25298and are now removed from G++. 25299 25300 The implicit typename extension has been deprecated and is now removed 25301from G++. 25302 25303 The use of default arguments in function pointers, function typedefs 25304and other places where they are not permitted by the standard is 25305deprecated and will be removed from a future version of G++. 25306 25307 G++ allows floating-point literals to appear in integral constant 25308expressions, e.g. ` enum E { e = int(2.2 * 3.7) } ' This extension is 25309deprecated and will be removed from a future version. 25310 25311 G++ allows static data members of const floating-point type to be 25312declared with an initializer in a class definition. The standard only 25313allows initializers for static members of const integral types and const 25314enumeration types so this extension has been deprecated and will be 25315removed from a future version. 25316 25317 25318File: gcc.info, Node: Backwards Compatibility, Prev: Deprecated Features, Up: C++ Extensions 25319 253206.11 Backwards Compatibility 25321============================ 25322 25323Now that there is a definitive ISO standard C++, G++ has a specification 25324to adhere to. The C++ language evolved over time, and features that 25325used to be acceptable in previous drafts of the standard, such as the 25326ARM [Annotated C++ Reference Manual], are no longer accepted. In order 25327to allow compilation of C++ written to such drafts, G++ contains some 25328backwards compatibilities. _All such backwards compatibility features 25329are liable to disappear in future versions of G++._ They should be 25330considered deprecated *Note Deprecated Features::. 25331 25332`For scope' 25333 If a variable is declared at for scope, it used to remain in scope 25334 until the end of the scope which contained the for statement 25335 (rather than just within the for scope). G++ retains this, but 25336 issues a warning, if such a variable is accessed outside the for 25337 scope. 25338 25339`Implicit C language' 25340 Old C system header files did not contain an `extern "C" {...}' 25341 scope to set the language. On such systems, all header files are 25342 implicitly scoped inside a C language scope. Also, an empty 25343 prototype `()' will be treated as an unspecified number of 25344 arguments, rather than no arguments, as C++ demands. 25345 25346 25347File: gcc.info, Node: Objective-C, Next: Compatibility, Prev: C++ Extensions, Up: Top 25348 253497 GNU Objective-C runtime features 25350********************************** 25351 25352This document is meant to describe some of the GNU Objective-C runtime 25353features. It is not intended to teach you Objective-C, there are 25354several resources on the Internet that present the language. Questions 25355and comments about this document to Ovidiu Predescu <ovidiu@cup.hp.com>. 25356 25357* Menu: 25358 25359* Executing code before main:: 25360* Type encoding:: 25361* Garbage Collection:: 25362* Constant string objects:: 25363* compatibility_alias:: 25364 25365 25366File: gcc.info, Node: Executing code before main, Next: Type encoding, Prev: Objective-C, Up: Objective-C 25367 253687.1 `+load': Executing code before main 25369======================================= 25370 25371The GNU Objective-C runtime provides a way that allows you to execute 25372code before the execution of the program enters the `main' function. 25373The code is executed on a per-class and a per-category basis, through a 25374special class method `+load'. 25375 25376 This facility is very useful if you want to initialize global variables 25377which can be accessed by the program directly, without sending a message 25378to the class first. The usual way to initialize global variables, in 25379the `+initialize' method, might not be useful because `+initialize' is 25380only called when the first message is sent to a class object, which in 25381some cases could be too late. 25382 25383 Suppose for example you have a `FileStream' class that declares 25384`Stdin', `Stdout' and `Stderr' as global variables, like below: 25385 25386 25387 FileStream *Stdin = nil; 25388 FileStream *Stdout = nil; 25389 FileStream *Stderr = nil; 25390 25391 @implementation FileStream 25392 25393 + (void)initialize 25394 { 25395 Stdin = [[FileStream new] initWithFd:0]; 25396 Stdout = [[FileStream new] initWithFd:1]; 25397 Stderr = [[FileStream new] initWithFd:2]; 25398 } 25399 25400 /* Other methods here */ 25401 @end 25402 25403 In this example, the initialization of `Stdin', `Stdout' and `Stderr' 25404in `+initialize' occurs too late. The programmer can send a message to 25405one of these objects before the variables are actually initialized, 25406thus sending messages to the `nil' object. The `+initialize' method 25407which actually initializes the global variables is not invoked until 25408the first message is sent to the class object. The solution would 25409require these variables to be initialized just before entering `main'. 25410 25411 The correct solution of the above problem is to use the `+load' method 25412instead of `+initialize': 25413 25414 25415 @implementation FileStream 25416 25417 + (void)load 25418 { 25419 Stdin = [[FileStream new] initWithFd:0]; 25420 Stdout = [[FileStream new] initWithFd:1]; 25421 Stderr = [[FileStream new] initWithFd:2]; 25422 } 25423 25424 /* Other methods here */ 25425 @end 25426 25427 The `+load' is a method that is not overridden by categories. If a 25428class and a category of it both implement `+load', both methods are 25429invoked. This allows some additional initializations to be performed in 25430a category. 25431 25432 This mechanism is not intended to be a replacement for `+initialize'. 25433You should be aware of its limitations when you decide to use it 25434instead of `+initialize'. 25435 25436* Menu: 25437 25438* What you can and what you cannot do in +load:: 25439 25440 25441File: gcc.info, Node: What you can and what you cannot do in +load, Prev: Executing code before main, Up: Executing code before main 25442 254437.1.1 What you can and what you cannot do in `+load' 25444---------------------------------------------------- 25445 25446The `+load' implementation in the GNU runtime guarantees you the 25447following things: 25448 25449 * you can write whatever C code you like; 25450 25451 * you can send messages to Objective-C constant strings (`@"this is a 25452 constant string"'); 25453 25454 * you can allocate and send messages to objects whose class is 25455 implemented in the same file; 25456 25457 * the `+load' implementation of all super classes of a class are 25458 executed before the `+load' of that class is executed; 25459 25460 * the `+load' implementation of a class is executed before the 25461 `+load' implementation of any category. 25462 25463 25464 In particular, the following things, even if they can work in a 25465particular case, are not guaranteed: 25466 25467 * allocation of or sending messages to arbitrary objects; 25468 25469 * allocation of or sending messages to objects whose classes have a 25470 category implemented in the same file; 25471 25472 25473 You should make no assumptions about receiving `+load' in sibling 25474classes when you write `+load' of a class. The order in which sibling 25475classes receive `+load' is not guaranteed. 25476 25477 The order in which `+load' and `+initialize' are called could be 25478problematic if this matters. If you don't allocate objects inside 25479`+load', it is guaranteed that `+load' is called before `+initialize'. 25480If you create an object inside `+load' the `+initialize' method of 25481object's class is invoked even if `+load' was not invoked. Note if you 25482explicitly call `+load' on a class, `+initialize' will be called first. 25483To avoid possible problems try to implement only one of these methods. 25484 25485 The `+load' method is also invoked when a bundle is dynamically loaded 25486into your running program. This happens automatically without any 25487intervening operation from you. When you write bundles and you need to 25488write `+load' you can safely create and send messages to objects whose 25489classes already exist in the running program. The same restrictions as 25490above apply to classes defined in bundle. 25491 25492 25493File: gcc.info, Node: Type encoding, Next: Garbage Collection, Prev: Executing code before main, Up: Objective-C 25494 254957.2 Type encoding 25496================= 25497 25498The Objective-C compiler generates type encodings for all the types. 25499These type encodings are used at runtime to find out information about 25500selectors and methods and about objects and classes. 25501 25502 The types are encoded in the following way: 25503 25504`_Bool' `B' 25505`char' `c' 25506`unsigned char' `C' 25507`short' `s' 25508`unsigned short' `S' 25509`int' `i' 25510`unsigned int' `I' 25511`long' `l' 25512`unsigned long' `L' 25513`long long' `q' 25514`unsigned long `Q' 25515long' 25516`float' `f' 25517`double' `d' 25518`void' `v' 25519`id' `@' 25520`Class' `#' 25521`SEL' `:' 25522`char*' `*' 25523unknown type `?' 25524Complex types `j' followed by the inner type. For example 25525 `_Complex double' is encoded as "jd". 25526bit-fields `b' followed by the starting position of the 25527 bit-field, the type of the bit-field and the size of 25528 the bit-field (the bit-fields encoding was changed 25529 from the NeXT's compiler encoding, see below) 25530 25531 The encoding of bit-fields has changed to allow bit-fields to be 25532properly handled by the runtime functions that compute sizes and 25533alignments of types that contain bit-fields. The previous encoding 25534contained only the size of the bit-field. Using only this information 25535it is not possible to reliably compute the size occupied by the 25536bit-field. This is very important in the presence of the Boehm's 25537garbage collector because the objects are allocated using the typed 25538memory facility available in this collector. The typed memory 25539allocation requires information about where the pointers are located 25540inside the object. 25541 25542 The position in the bit-field is the position, counting in bits, of the 25543bit closest to the beginning of the structure. 25544 25545 The non-atomic types are encoded as follows: 25546 25547pointers `^' followed by the pointed type. 25548arrays `[' followed by the number of elements in the array 25549 followed by the type of the elements followed by `]' 25550structures `{' followed by the name of the structure (or `?' if the 25551 structure is unnamed), the `=' sign, the type of the 25552 members and by `}' 25553unions `(' followed by the name of the structure (or `?' if the 25554 union is unnamed), the `=' sign, the type of the members 25555 followed by `)' 25556 25557 Here are some types and their encodings, as they are generated by the 25558compiler on an i386 machine: 25559 25560 25561Objective-C type Compiler encoding 25562 int a[10]; `[10i]' 25563 struct { `{?=i[3f]b128i3b131i2c}' 25564 int i; 25565 float f[3]; 25566 int a:3; 25567 int b:2; 25568 char c; 25569 } 25570 25571 25572 In addition to the types the compiler also encodes the type 25573specifiers. The table below describes the encoding of the current 25574Objective-C type specifiers: 25575 25576 25577Specifier Encoding 25578`const' `r' 25579`in' `n' 25580`inout' `N' 25581`out' `o' 25582`bycopy' `O' 25583`oneway' `V' 25584 25585 25586 The type specifiers are encoded just before the type. Unlike types 25587however, the type specifiers are only encoded when they appear in method 25588argument types. 25589 25590 25591File: gcc.info, Node: Garbage Collection, Next: Constant string objects, Prev: Type encoding, Up: Objective-C 25592 255937.3 Garbage Collection 25594====================== 25595 25596Support for a new memory management policy has been added by using a 25597powerful conservative garbage collector, known as the 25598Boehm-Demers-Weiser conservative garbage collector. It is available 25599from `http://www.hpl.hp.com/personal/Hans_Boehm/gc/'. 25600 25601 To enable the support for it you have to configure the compiler using 25602an additional argument, `--enable-objc-gc'. You need to have garbage 25603collector installed before building the compiler. This will build an 25604additional runtime library which has several enhancements to support 25605the garbage collector. The new library has a new name, `libobjc_gc.a' 25606to not conflict with the non-garbage-collected library. 25607 25608 When the garbage collector is used, the objects are allocated using the 25609so-called typed memory allocation mechanism available in the 25610Boehm-Demers-Weiser collector. This mode requires precise information 25611on where pointers are located inside objects. This information is 25612computed once per class, immediately after the class has been 25613initialized. 25614 25615 There is a new runtime function `class_ivar_set_gcinvisible()' which 25616can be used to declare a so-called "weak pointer" reference. Such a 25617pointer is basically hidden for the garbage collector; this can be 25618useful in certain situations, especially when you want to keep track of 25619the allocated objects, yet allow them to be collected. This kind of 25620pointers can only be members of objects, you cannot declare a global 25621pointer as a weak reference. Every type which is a pointer type can be 25622declared a weak pointer, including `id', `Class' and `SEL'. 25623 25624 Here is an example of how to use this feature. Suppose you want to 25625implement a class whose instances hold a weak pointer reference; the 25626following class does this: 25627 25628 25629 @interface WeakPointer : Object 25630 { 25631 const void* weakPointer; 25632 } 25633 25634 - initWithPointer:(const void*)p; 25635 - (const void*)weakPointer; 25636 @end 25637 25638 25639 @implementation WeakPointer 25640 25641 + (void)initialize 25642 { 25643 class_ivar_set_gcinvisible (self, "weakPointer", YES); 25644 } 25645 25646 - initWithPointer:(const void*)p 25647 { 25648 weakPointer = p; 25649 return self; 25650 } 25651 25652 - (const void*)weakPointer 25653 { 25654 return weakPointer; 25655 } 25656 25657 @end 25658 25659 Weak pointers are supported through a new type character specifier 25660represented by the `!' character. The `class_ivar_set_gcinvisible()' 25661function adds or removes this specifier to the string type description 25662of the instance variable named as argument. 25663 25664 25665File: gcc.info, Node: Constant string objects, Next: compatibility_alias, Prev: Garbage Collection, Up: Objective-C 25666 256677.4 Constant string objects 25668=========================== 25669 25670GNU Objective-C provides constant string objects that are generated 25671directly by the compiler. You declare a constant string object by 25672prefixing a C constant string with the character `@': 25673 25674 id myString = @"this is a constant string object"; 25675 25676 The constant string objects are by default instances of the 25677`NXConstantString' class which is provided by the GNU Objective-C 25678runtime. To get the definition of this class you must include the 25679`objc/NXConstStr.h' header file. 25680 25681 User defined libraries may want to implement their own constant string 25682class. To be able to support them, the GNU Objective-C compiler 25683provides a new command line options 25684`-fconstant-string-class=CLASS-NAME'. The provided class should adhere 25685to a strict structure, the same as `NXConstantString''s structure: 25686 25687 25688 @interface MyConstantStringClass 25689 { 25690 Class isa; 25691 char *c_string; 25692 unsigned int len; 25693 } 25694 @end 25695 25696 `NXConstantString' inherits from `Object'; user class libraries may 25697choose to inherit the customized constant string class from a different 25698class than `Object'. There is no requirement in the methods the 25699constant string class has to implement, but the final ivar layout of 25700the class must be the compatible with the given structure. 25701 25702 When the compiler creates the statically allocated constant string 25703object, the `c_string' field will be filled by the compiler with the 25704string; the `length' field will be filled by the compiler with the 25705string length; the `isa' pointer will be filled with `NULL' by the 25706compiler, and it will later be fixed up automatically at runtime by the 25707GNU Objective-C runtime library to point to the class which was set by 25708the `-fconstant-string-class' option when the object file is loaded (if 25709you wonder how it works behind the scenes, the name of the class to 25710use, and the list of static objects to fixup, are stored by the 25711compiler in the object file in a place where the GNU runtime library 25712will find them at runtime). 25713 25714 As a result, when a file is compiled with the 25715`-fconstant-string-class' option, all the constant string objects will 25716be instances of the class specified as argument to this option. It is 25717possible to have multiple compilation units referring to different 25718constant string classes, neither the compiler nor the linker impose any 25719restrictions in doing this. 25720 25721 25722File: gcc.info, Node: compatibility_alias, Prev: Constant string objects, Up: Objective-C 25723 257247.5 compatibility_alias 25725======================= 25726 25727This is a feature of the Objective-C compiler rather than of the 25728runtime, anyway since it is documented nowhere and its existence was 25729forgotten, we are documenting it here. 25730 25731 The keyword `@compatibility_alias' allows you to define a class name 25732as equivalent to another class name. For example: 25733 25734 @compatibility_alias WOApplication GSWApplication; 25735 25736 tells the compiler that each time it encounters `WOApplication' as a 25737class name, it should replace it with `GSWApplication' (that is, 25738`WOApplication' is just an alias for `GSWApplication'). 25739 25740 There are some constraints on how this can be used-- 25741 25742 * `WOApplication' (the alias) must not be an existing class; 25743 25744 * `GSWApplication' (the real class) must be an existing class. 25745 25746 25747 25748File: gcc.info, Node: Compatibility, Next: Gcov, Prev: Objective-C, Up: Top 25749 257508 Binary Compatibility 25751********************** 25752 25753Binary compatibility encompasses several related concepts: 25754 25755"application binary interface (ABI)" 25756 The set of runtime conventions followed by all of the tools that 25757 deal with binary representations of a program, including 25758 compilers, assemblers, linkers, and language runtime support. 25759 Some ABIs are formal with a written specification, possibly 25760 designed by multiple interested parties. Others are simply the 25761 way things are actually done by a particular set of tools. 25762 25763"ABI conformance" 25764 A compiler conforms to an ABI if it generates code that follows 25765 all of the specifications enumerated by that ABI. A library 25766 conforms to an ABI if it is implemented according to that ABI. An 25767 application conforms to an ABI if it is built using tools that 25768 conform to that ABI and does not contain source code that 25769 specifically changes behavior specified by the ABI. 25770 25771"calling conventions" 25772 Calling conventions are a subset of an ABI that specify of how 25773 arguments are passed and function results are returned. 25774 25775"interoperability" 25776 Different sets of tools are interoperable if they generate files 25777 that can be used in the same program. The set of tools includes 25778 compilers, assemblers, linkers, libraries, header files, startup 25779 files, and debuggers. Binaries produced by different sets of 25780 tools are not interoperable unless they implement the same ABI. 25781 This applies to different versions of the same tools as well as 25782 tools from different vendors. 25783 25784"intercallability" 25785 Whether a function in a binary built by one set of tools can call a 25786 function in a binary built by a different set of tools is a subset 25787 of interoperability. 25788 25789"implementation-defined features" 25790 Language standards include lists of implementation-defined 25791 features whose behavior can vary from one implementation to 25792 another. Some of these features are normally covered by a 25793 platform's ABI and others are not. The features that are not 25794 covered by an ABI generally affect how a program behaves, but not 25795 intercallability. 25796 25797"compatibility" 25798 Conformance to the same ABI and the same behavior of 25799 implementation-defined features are both relevant for 25800 compatibility. 25801 25802 The application binary interface implemented by a C or C++ compiler 25803affects code generation and runtime support for: 25804 25805 * size and alignment of data types 25806 25807 * layout of structured types 25808 25809 * calling conventions 25810 25811 * register usage conventions 25812 25813 * interfaces for runtime arithmetic support 25814 25815 * object file formats 25816 25817 In addition, the application binary interface implemented by a C++ 25818compiler affects code generation and runtime support for: 25819 * name mangling 25820 25821 * exception handling 25822 25823 * invoking constructors and destructors 25824 25825 * layout, alignment, and padding of classes 25826 25827 * layout and alignment of virtual tables 25828 25829 Some GCC compilation options cause the compiler to generate code that 25830does not conform to the platform's default ABI. Other options cause 25831different program behavior for implementation-defined features that are 25832not covered by an ABI. These options are provided for consistency with 25833other compilers that do not follow the platform's default ABI or the 25834usual behavior of implementation-defined features for the platform. Be 25835very careful about using such options. 25836 25837 Most platforms have a well-defined ABI that covers C code, but ABIs 25838that cover C++ functionality are not yet common. 25839 25840 Starting with GCC 3.2, GCC binary conventions for C++ are based on a 25841written, vendor-neutral C++ ABI that was designed to be specific to 2584264-bit Itanium but also includes generic specifications that apply to 25843any platform. This C++ ABI is also implemented by other compiler 25844vendors on some platforms, notably GNU/Linux and BSD systems. We have 25845tried hard to provide a stable ABI that will be compatible with future 25846GCC releases, but it is possible that we will encounter problems that 25847make this difficult. Such problems could include different 25848interpretations of the C++ ABI by different vendors, bugs in the ABI, or 25849bugs in the implementation of the ABI in different compilers. GCC's 25850`-Wabi' switch warns when G++ generates code that is probably not 25851compatible with the C++ ABI. 25852 25853 The C++ library used with a C++ compiler includes the Standard C++ 25854Library, with functionality defined in the C++ Standard, plus language 25855runtime support. The runtime support is included in a C++ ABI, but 25856there is no formal ABI for the Standard C++ Library. Two 25857implementations of that library are interoperable if one follows the 25858de-facto ABI of the other and if they are both built with the same 25859compiler, or with compilers that conform to the same ABI for C++ 25860compiler and runtime support. 25861 25862 When G++ and another C++ compiler conform to the same C++ ABI, but the 25863implementations of the Standard C++ Library that they normally use do 25864not follow the same ABI for the Standard C++ Library, object files 25865built with those compilers can be used in the same program only if they 25866use the same C++ library. This requires specifying the location of the 25867C++ library header files when invoking the compiler whose usual library 25868is not being used. The location of GCC's C++ header files depends on 25869how the GCC build was configured, but can be seen by using the G++ `-v' 25870option. With default configuration options for G++ 3.3 the compile 25871line for a different C++ compiler needs to include 25872 25873 -IGCC_INSTALL_DIRECTORY/include/c++/3.3 25874 25875 Similarly, compiling code with G++ that must use a C++ library other 25876than the GNU C++ library requires specifying the location of the header 25877files for that other library. 25878 25879 The most straightforward way to link a program to use a particular C++ 25880library is to use a C++ driver that specifies that C++ library by 25881default. The `g++' driver, for example, tells the linker where to find 25882GCC's C++ library (`libstdc++') plus the other libraries and startup 25883files it needs, in the proper order. 25884 25885 If a program must use a different C++ library and it's not possible to 25886do the final link using a C++ driver that uses that library by default, 25887it is necessary to tell `g++' the location and name of that library. 25888It might also be necessary to specify different startup files and other 25889runtime support libraries, and to suppress the use of GCC's support 25890libraries with one or more of the options `-nostdlib', `-nostartfiles', 25891and `-nodefaultlibs'. 25892 25893 25894File: gcc.info, Node: Gcov, Next: Trouble, Prev: Compatibility, Up: Top 25895 258969 `gcov'--a Test Coverage Program 25897********************************* 25898 25899`gcov' is a tool you can use in conjunction with GCC to test code 25900coverage in your programs. 25901 25902* Menu: 25903 25904* Gcov Intro:: Introduction to gcov. 25905* Invoking Gcov:: How to use gcov. 25906* Gcov and Optimization:: Using gcov with GCC optimization. 25907* Gcov Data Files:: The files used by gcov. 25908* Cross-profiling:: Data file relocation. 25909 25910 25911File: gcc.info, Node: Gcov Intro, Next: Invoking Gcov, Up: Gcov 25912 259139.1 Introduction to `gcov' 25914========================== 25915 25916`gcov' is a test coverage program. Use it in concert with GCC to 25917analyze your programs to help create more efficient, faster running 25918code and to discover untested parts of your program. You can use 25919`gcov' as a profiling tool to help discover where your optimization 25920efforts will best affect your code. You can also use `gcov' along with 25921the other profiling tool, `gprof', to assess which parts of your code 25922use the greatest amount of computing time. 25923 25924 Profiling tools help you analyze your code's performance. Using a 25925profiler such as `gcov' or `gprof', you can find out some basic 25926performance statistics, such as: 25927 25928 * how often each line of code executes 25929 25930 * what lines of code are actually executed 25931 25932 * how much computing time each section of code uses 25933 25934 Once you know these things about how your code works when compiled, you 25935can look at each module to see which modules should be optimized. 25936`gcov' helps you determine where to work on optimization. 25937 25938 Software developers also use coverage testing in concert with 25939testsuites, to make sure software is actually good enough for a release. 25940Testsuites can verify that a program works as expected; a coverage 25941program tests to see how much of the program is exercised by the 25942testsuite. Developers can then determine what kinds of test cases need 25943to be added to the testsuites to create both better testing and a better 25944final product. 25945 25946 You should compile your code without optimization if you plan to use 25947`gcov' because the optimization, by combining some lines of code into 25948one function, may not give you as much information as you need to look 25949for `hot spots' where the code is using a great deal of computer time. 25950Likewise, because `gcov' accumulates statistics by line (at the lowest 25951resolution), it works best with a programming style that places only 25952one statement on each line. If you use complicated macros that expand 25953to loops or to other control structures, the statistics are less 25954helpful--they only report on the line where the macro call appears. If 25955your complex macros behave like functions, you can replace them with 25956inline functions to solve this problem. 25957 25958 `gcov' creates a logfile called `SOURCEFILE.gcov' which indicates how 25959many times each line of a source file `SOURCEFILE.c' has executed. You 25960can use these logfiles along with `gprof' to aid in fine-tuning the 25961performance of your programs. `gprof' gives timing information you can 25962use along with the information you get from `gcov'. 25963 25964 `gcov' works only on code compiled with GCC. It is not compatible 25965with any other profiling or test coverage mechanism. 25966 25967 25968File: gcc.info, Node: Invoking Gcov, Next: Gcov and Optimization, Prev: Gcov Intro, Up: Gcov 25969 259709.2 Invoking `gcov' 25971=================== 25972 25973 gcov [OPTIONS] SOURCEFILE 25974 25975 `gcov' accepts the following options: 25976 25977`-h' 25978`--help' 25979 Display help about using `gcov' (on the standard output), and exit 25980 without doing any further processing. 25981 25982`-v' 25983`--version' 25984 Display the `gcov' version number (on the standard output), and 25985 exit without doing any further processing. 25986 25987`-a' 25988`--all-blocks' 25989 Write individual execution counts for every basic block. Normally 25990 gcov outputs execution counts only for the main blocks of a line. 25991 With this option you can determine if blocks within a single line 25992 are not being executed. 25993 25994`-b' 25995`--branch-probabilities' 25996 Write branch frequencies to the output file, and write branch 25997 summary info to the standard output. This option allows you to 25998 see how often each branch in your program was taken. 25999 Unconditional branches will not be shown, unless the `-u' option 26000 is given. 26001 26002`-c' 26003`--branch-counts' 26004 Write branch frequencies as the number of branches taken, rather 26005 than the percentage of branches taken. 26006 26007`-n' 26008`--no-output' 26009 Do not create the `gcov' output file. 26010 26011`-l' 26012`--long-file-names' 26013 Create long file names for included source files. For example, if 26014 the header file `x.h' contains code, and was included in the file 26015 `a.c', then running `gcov' on the file `a.c' will produce an 26016 output file called `a.c##x.h.gcov' instead of `x.h.gcov'. This 26017 can be useful if `x.h' is included in multiple source files. If 26018 you use the `-p' option, both the including and included file 26019 names will be complete path names. 26020 26021`-p' 26022`--preserve-paths' 26023 Preserve complete path information in the names of generated 26024 `.gcov' files. Without this option, just the filename component is 26025 used. With this option, all directories are used, with `/' 26026 characters translated to `#' characters, `.' directory components 26027 removed and `..' components renamed to `^'. This is useful if 26028 sourcefiles are in several different directories. It also affects 26029 the `-l' option. 26030 26031`-f' 26032`--function-summaries' 26033 Output summaries for each function in addition to the file level 26034 summary. 26035 26036`-o DIRECTORY|FILE' 26037`--object-directory DIRECTORY' 26038`--object-file FILE' 26039 Specify either the directory containing the gcov data files, or the 26040 object path name. The `.gcno', and `.gcda' data files are 26041 searched for using this option. If a directory is specified, the 26042 data files are in that directory and named after the source file 26043 name, without its extension. If a file is specified here, the 26044 data files are named after that file, without its extension. If 26045 this option is not supplied, it defaults to the current directory. 26046 26047`-u' 26048`--unconditional-branches' 26049 When branch probabilities are given, include those of 26050 unconditional branches. Unconditional branches are normally not 26051 interesting. 26052 26053 26054 `gcov' should be run with the current directory the same as that when 26055you invoked the compiler. Otherwise it will not be able to locate the 26056source files. `gcov' produces files called `MANGLEDNAME.gcov' in the 26057current directory. These contain the coverage information of the 26058source file they correspond to. One `.gcov' file is produced for each 26059source file containing code, which was compiled to produce the data 26060files. The MANGLEDNAME part of the output file name is usually simply 26061the source file name, but can be something more complicated if the `-l' 26062or `-p' options are given. Refer to those options for details. 26063 26064 The `.gcov' files contain the `:' separated fields along with program 26065source code. The format is 26066 26067 EXECUTION_COUNT:LINE_NUMBER:SOURCE LINE TEXT 26068 26069 Additional block information may succeed each line, when requested by 26070command line option. The EXECUTION_COUNT is `-' for lines containing 26071no code and `#####' for lines which were never executed. Some lines of 26072information at the start have LINE_NUMBER of zero. 26073 26074 The preamble lines are of the form 26075 26076 -:0:TAG:VALUE 26077 26078 The ordering and number of these preamble lines will be augmented as 26079`gcov' development progresses -- do not rely on them remaining 26080unchanged. Use TAG to locate a particular preamble line. 26081 26082 The additional block information is of the form 26083 26084 TAG INFORMATION 26085 26086 The INFORMATION is human readable, but designed to be simple enough 26087for machine parsing too. 26088 26089 When printing percentages, 0% and 100% are only printed when the values 26090are _exactly_ 0% and 100% respectively. Other values which would 26091conventionally be rounded to 0% or 100% are instead printed as the 26092nearest non-boundary value. 26093 26094 When using `gcov', you must first compile your program with two 26095special GCC options: `-fprofile-arcs -ftest-coverage'. This tells the 26096compiler to generate additional information needed by gcov (basically a 26097flow graph of the program) and also includes additional code in the 26098object files for generating the extra profiling information needed by 26099gcov. These additional files are placed in the directory where the 26100object file is located. 26101 26102 Running the program will cause profile output to be generated. For 26103each source file compiled with `-fprofile-arcs', an accompanying 26104`.gcda' file will be placed in the object file directory. 26105 26106 Running `gcov' with your program's source file names as arguments will 26107now produce a listing of the code along with frequency of execution for 26108each line. For example, if your program is called `tmp.c', this is 26109what you see when you use the basic `gcov' facility: 26110 26111 $ gcc -fprofile-arcs -ftest-coverage tmp.c 26112 $ a.out 26113 $ gcov tmp.c 26114 90.00% of 10 source lines executed in file tmp.c 26115 Creating tmp.c.gcov. 26116 26117 The file `tmp.c.gcov' contains output from `gcov'. Here is a sample: 26118 26119 -: 0:Source:tmp.c 26120 -: 0:Graph:tmp.gcno 26121 -: 0:Data:tmp.gcda 26122 -: 0:Runs:1 26123 -: 0:Programs:1 26124 -: 1:#include <stdio.h> 26125 -: 2: 26126 -: 3:int main (void) 26127 1: 4:{ 26128 1: 5: int i, total; 26129 -: 6: 26130 1: 7: total = 0; 26131 -: 8: 26132 11: 9: for (i = 0; i < 10; i++) 26133 10: 10: total += i; 26134 -: 11: 26135 1: 12: if (total != 45) 26136 #####: 13: printf ("Failure\n"); 26137 -: 14: else 26138 1: 15: printf ("Success\n"); 26139 1: 16: return 0; 26140 -: 17:} 26141 26142 When you use the `-a' option, you will get individual block counts, 26143and the output looks like this: 26144 26145 -: 0:Source:tmp.c 26146 -: 0:Graph:tmp.gcno 26147 -: 0:Data:tmp.gcda 26148 -: 0:Runs:1 26149 -: 0:Programs:1 26150 -: 1:#include <stdio.h> 26151 -: 2: 26152 -: 3:int main (void) 26153 1: 4:{ 26154 1: 4-block 0 26155 1: 5: int i, total; 26156 -: 6: 26157 1: 7: total = 0; 26158 -: 8: 26159 11: 9: for (i = 0; i < 10; i++) 26160 11: 9-block 0 26161 10: 10: total += i; 26162 10: 10-block 0 26163 -: 11: 26164 1: 12: if (total != 45) 26165 1: 12-block 0 26166 #####: 13: printf ("Failure\n"); 26167 $$$$$: 13-block 0 26168 -: 14: else 26169 1: 15: printf ("Success\n"); 26170 1: 15-block 0 26171 1: 16: return 0; 26172 1: 16-block 0 26173 -: 17:} 26174 26175 In this mode, each basic block is only shown on one line - the last 26176line of the block. A multi-line block will only contribute to the 26177execution count of that last line, and other lines will not be shown to 26178contain code, unless previous blocks end on those lines. The total 26179execution count of a line is shown and subsequent lines show the 26180execution counts for individual blocks that end on that line. After 26181each block, the branch and call counts of the block will be shown, if 26182the `-b' option is given. 26183 26184 Because of the way GCC instruments calls, a call count can be shown 26185after a line with no individual blocks. As you can see, line 13 26186contains a basic block that was not executed. 26187 26188 When you use the `-b' option, your output looks like this: 26189 26190 $ gcov -b tmp.c 26191 90.00% of 10 source lines executed in file tmp.c 26192 80.00% of 5 branches executed in file tmp.c 26193 80.00% of 5 branches taken at least once in file tmp.c 26194 50.00% of 2 calls executed in file tmp.c 26195 Creating tmp.c.gcov. 26196 26197 Here is a sample of a resulting `tmp.c.gcov' file: 26198 26199 -: 0:Source:tmp.c 26200 -: 0:Graph:tmp.gcno 26201 -: 0:Data:tmp.gcda 26202 -: 0:Runs:1 26203 -: 0:Programs:1 26204 -: 1:#include <stdio.h> 26205 -: 2: 26206 -: 3:int main (void) 26207 function main called 1 returned 1 blocks executed 75% 26208 1: 4:{ 26209 1: 5: int i, total; 26210 -: 6: 26211 1: 7: total = 0; 26212 -: 8: 26213 11: 9: for (i = 0; i < 10; i++) 26214 branch 0 taken 91% (fallthrough) 26215 branch 1 taken 9% 26216 10: 10: total += i; 26217 -: 11: 26218 1: 12: if (total != 45) 26219 branch 0 taken 0% (fallthrough) 26220 branch 1 taken 100% 26221 #####: 13: printf ("Failure\n"); 26222 call 0 never executed 26223 -: 14: else 26224 1: 15: printf ("Success\n"); 26225 call 0 called 1 returned 100% 26226 1: 16: return 0; 26227 -: 17:} 26228 26229 For each function, a line is printed showing how many times the 26230function is called, how many times it returns and what percentage of the 26231function's blocks were executed. 26232 26233 For each basic block, a line is printed after the last line of the 26234basic block describing the branch or call that ends the basic block. 26235There can be multiple branches and calls listed for a single source 26236line if there are multiple basic blocks that end on that line. In this 26237case, the branches and calls are each given a number. There is no 26238simple way to map these branches and calls back to source constructs. 26239In general, though, the lowest numbered branch or call will correspond 26240to the leftmost construct on the source line. 26241 26242 For a branch, if it was executed at least once, then a percentage 26243indicating the number of times the branch was taken divided by the 26244number of times the branch was executed will be printed. Otherwise, the 26245message "never executed" is printed. 26246 26247 For a call, if it was executed at least once, then a percentage 26248indicating the number of times the call returned divided by the number 26249of times the call was executed will be printed. This will usually be 26250100%, but may be less for functions that call `exit' or `longjmp', and 26251thus may not return every time they are called. 26252 26253 The execution counts are cumulative. If the example program were 26254executed again without removing the `.gcda' file, the count for the 26255number of times each line in the source was executed would be added to 26256the results of the previous run(s). This is potentially useful in 26257several ways. For example, it could be used to accumulate data over a 26258number of program runs as part of a test verification suite, or to 26259provide more accurate long-term information over a large number of 26260program runs. 26261 26262 The data in the `.gcda' files is saved immediately before the program 26263exits. For each source file compiled with `-fprofile-arcs', the 26264profiling code first attempts to read in an existing `.gcda' file; if 26265the file doesn't match the executable (differing number of basic block 26266counts) it will ignore the contents of the file. It then adds in the 26267new execution counts and finally writes the data to the file. 26268 26269 26270File: gcc.info, Node: Gcov and Optimization, Next: Gcov Data Files, Prev: Invoking Gcov, Up: Gcov 26271 262729.3 Using `gcov' with GCC Optimization 26273====================================== 26274 26275If you plan to use `gcov' to help optimize your code, you must first 26276compile your program with two special GCC options: `-fprofile-arcs 26277-ftest-coverage'. Aside from that, you can use any other GCC options; 26278but if you want to prove that every single line in your program was 26279executed, you should not compile with optimization at the same time. 26280On some machines the optimizer can eliminate some simple code lines by 26281combining them with other lines. For example, code like this: 26282 26283 if (a != b) 26284 c = 1; 26285 else 26286 c = 0; 26287 26288can be compiled into one instruction on some machines. In this case, 26289there is no way for `gcov' to calculate separate execution counts for 26290each line because there isn't separate code for each line. Hence the 26291`gcov' output looks like this if you compiled the program with 26292optimization: 26293 26294 100: 12:if (a != b) 26295 100: 13: c = 1; 26296 100: 14:else 26297 100: 15: c = 0; 26298 26299 The output shows that this block of code, combined by optimization, 26300executed 100 times. In one sense this result is correct, because there 26301was only one instruction representing all four of these lines. However, 26302the output does not indicate how many times the result was 0 and how 26303many times the result was 1. 26304 26305 Inlineable functions can create unexpected line counts. Line counts 26306are shown for the source code of the inlineable function, but what is 26307shown depends on where the function is inlined, or if it is not inlined 26308at all. 26309 26310 If the function is not inlined, the compiler must emit an out of line 26311copy of the function, in any object file that needs it. If `fileA.o' 26312and `fileB.o' both contain out of line bodies of a particular 26313inlineable function, they will also both contain coverage counts for 26314that function. When `fileA.o' and `fileB.o' are linked together, the 26315linker will, on many systems, select one of those out of line bodies 26316for all calls to that function, and remove or ignore the other. 26317Unfortunately, it will not remove the coverage counters for the unused 26318function body. Hence when instrumented, all but one use of that 26319function will show zero counts. 26320 26321 If the function is inlined in several places, the block structure in 26322each location might not be the same. For instance, a condition might 26323now be calculable at compile time in some instances. Because the 26324coverage of all the uses of the inline function will be shown for the 26325same source lines, the line counts themselves might seem inconsistent. 26326 26327 26328File: gcc.info, Node: Gcov Data Files, Next: Cross-profiling, Prev: Gcov and Optimization, Up: Gcov 26329 263309.4 Brief description of `gcov' data files 26331========================================== 26332 26333`gcov' uses two files for profiling. The names of these files are 26334derived from the original _object_ file by substituting the file suffix 26335with either `.gcno', or `.gcda'. All of these files are placed in the 26336same directory as the object file, and contain data stored in a 26337platform-independent format. 26338 26339 The `.gcno' file is generated when the source file is compiled with 26340the GCC `-ftest-coverage' option. It contains information to 26341reconstruct the basic block graphs and assign source line numbers to 26342blocks. 26343 26344 The `.gcda' file is generated when a program containing object files 26345built with the GCC `-fprofile-arcs' option is executed. A separate 26346`.gcda' file is created for each object file compiled with this option. 26347It contains arc transition counts, and some summary information. 26348 26349 The full details of the file format is specified in `gcov-io.h', and 26350functions provided in that header file should be used to access the 26351coverage files. 26352 26353 26354File: gcc.info, Node: Cross-profiling, Prev: Gcov Data Files, Up: Gcov 26355 263569.5 Data file relocation to support cross-profiling 26357=================================================== 26358 26359Running the program will cause profile output to be generated. For each 26360source file compiled with `-fprofile-arcs', an accompanying `.gcda' 26361file will be placed in the object file directory. That implicitly 26362requires running the program on the same system as it was built or 26363having the same absolute directory structure on the target system. The 26364program will try to create the needed directory structure, if it is not 26365already present. 26366 26367 To support cross-profiling, a program compiled with `-fprofile-arcs' 26368can relocate the data files based on two environment variables: 26369 26370 * GCOV_PREFIX contains the prefix to add to the absolute paths in 26371 the object file. Prefix must be absolute as well, otherwise its 26372 value is ignored. The default is no prefix. 26373 26374 * GCOV_PREFIX_STRIP indicates the how many initial directory names 26375 to strip off the hardwired absolute paths. Default value is 0. 26376 26377 _Note:_ GCOV_PREFIX_STRIP has no effect if GCOV_PREFIX is 26378 undefined, empty or non-absolute. 26379 26380 For example, if the object file `/user/build/foo.o' was built with 26381`-fprofile-arcs', the final executable will try to create the data file 26382`/user/build/foo.gcda' when running on the target system. This will 26383fail if the corresponding directory does not exist and it is unable to 26384create it. This can be overcome by, for example, setting the 26385environment as `GCOV_PREFIX=/target/run' and `GCOV_PREFIX_STRIP=1'. 26386Such a setting will name the data file `/target/run/build/foo.gcda'. 26387 26388 You must move the data files to the expected directory tree in order to 26389use them for profile directed optimizations (`--use-profile'), or to 26390use the `gcov' tool. 26391 26392 26393File: gcc.info, Node: Trouble, Next: Bugs, Prev: Gcov, Up: Top 26394 2639510 Known Causes of Trouble with GCC 26396*********************************** 26397 26398This section describes known problems that affect users of GCC. Most 26399of these are not GCC bugs per se--if they were, we would fix them. But 26400the result for a user may be like the result of a bug. 26401 26402 Some of these problems are due to bugs in other software, some are 26403missing features that are too much work to add, and some are places 26404where people's opinions differ as to what is best. 26405 26406* Menu: 26407 26408* Actual Bugs:: Bugs we will fix later. 26409* Cross-Compiler Problems:: Common problems of cross compiling with GCC. 26410* Interoperation:: Problems using GCC with other compilers, 26411 and with certain linkers, assemblers and debuggers. 26412* Incompatibilities:: GCC is incompatible with traditional C. 26413* Fixed Headers:: GCC uses corrected versions of system header files. 26414 This is necessary, but doesn't always work smoothly. 26415* Standard Libraries:: GCC uses the system C library, which might not be 26416 compliant with the ISO C standard. 26417* Disappointments:: Regrettable things we can't change, but not quite bugs. 26418* C++ Misunderstandings:: Common misunderstandings with GNU C++. 26419* Protoize Caveats:: Things to watch out for when using `protoize'. 26420* Non-bugs:: Things we think are right, but some others disagree. 26421* Warnings and Errors:: Which problems in your code get warnings, 26422 and which get errors. 26423 26424 26425File: gcc.info, Node: Actual Bugs, Next: Cross-Compiler Problems, Up: Trouble 26426 2642710.1 Actual Bugs We Haven't Fixed Yet 26428===================================== 26429 26430 * The `fixincludes' script interacts badly with automounters; if the 26431 directory of system header files is automounted, it tends to be 26432 unmounted while `fixincludes' is running. This would seem to be a 26433 bug in the automounter. We don't know any good way to work around 26434 it. 26435 26436 * The `fixproto' script will sometimes add prototypes for the 26437 `sigsetjmp' and `siglongjmp' functions that reference the 26438 `jmp_buf' type before that type is defined. To work around this, 26439 edit the offending file and place the typedef in front of the 26440 prototypes. 26441 26442 26443File: gcc.info, Node: Cross-Compiler Problems, Next: Interoperation, Prev: Actual Bugs, Up: Trouble 26444 2644510.2 Cross-Compiler Problems 26446============================ 26447 26448You may run into problems with cross compilation on certain machines, 26449for several reasons. 26450 26451 * At present, the program `mips-tfile' which adds debug support to 26452 object files on MIPS systems does not work in a cross compile 26453 environment. 26454 26455 26456File: gcc.info, Node: Interoperation, Next: Incompatibilities, Prev: Cross-Compiler Problems, Up: Trouble 26457 2645810.3 Interoperation 26459=================== 26460 26461This section lists various difficulties encountered in using GCC 26462together with other compilers or with the assemblers, linkers, 26463libraries and debuggers on certain systems. 26464 26465 * On many platforms, GCC supports a different ABI for C++ than do 26466 other compilers, so the object files compiled by GCC cannot be 26467 used with object files generated by another C++ compiler. 26468 26469 An area where the difference is most apparent is name mangling. 26470 The use of different name mangling is intentional, to protect you 26471 from more subtle problems. Compilers differ as to many internal 26472 details of C++ implementation, including: how class instances are 26473 laid out, how multiple inheritance is implemented, and how virtual 26474 function calls are handled. If the name encoding were made the 26475 same, your programs would link against libraries provided from 26476 other compilers--but the programs would then crash when run. 26477 Incompatible libraries are then detected at link time, rather than 26478 at run time. 26479 26480 * On some BSD systems, including some versions of Ultrix, use of 26481 profiling causes static variable destructors (currently used only 26482 in C++) not to be run. 26483 26484 * On some SGI systems, when you use `-lgl_s' as an option, it gets 26485 translated magically to `-lgl_s -lX11_s -lc_s'. Naturally, this 26486 does not happen when you use GCC. You must specify all three 26487 options explicitly. 26488 26489 * On a SPARC, GCC aligns all values of type `double' on an 8-byte 26490 boundary, and it expects every `double' to be so aligned. The Sun 26491 compiler usually gives `double' values 8-byte alignment, with one 26492 exception: function arguments of type `double' may not be aligned. 26493 26494 As a result, if a function compiled with Sun CC takes the address 26495 of an argument of type `double' and passes this pointer of type 26496 `double *' to a function compiled with GCC, dereferencing the 26497 pointer may cause a fatal signal. 26498 26499 One way to solve this problem is to compile your entire program 26500 with GCC. Another solution is to modify the function that is 26501 compiled with Sun CC to copy the argument into a local variable; 26502 local variables are always properly aligned. A third solution is 26503 to modify the function that uses the pointer to dereference it via 26504 the following function `access_double' instead of directly with 26505 `*': 26506 26507 inline double 26508 access_double (double *unaligned_ptr) 26509 { 26510 union d2i { double d; int i[2]; }; 26511 26512 union d2i *p = (union d2i *) unaligned_ptr; 26513 union d2i u; 26514 26515 u.i[0] = p->i[0]; 26516 u.i[1] = p->i[1]; 26517 26518 return u.d; 26519 } 26520 26521 Storing into the pointer can be done likewise with the same union. 26522 26523 * On Solaris, the `malloc' function in the `libmalloc.a' library may 26524 allocate memory that is only 4 byte aligned. Since GCC on the 26525 SPARC assumes that doubles are 8 byte aligned, this may result in a 26526 fatal signal if doubles are stored in memory allocated by the 26527 `libmalloc.a' library. 26528 26529 The solution is to not use the `libmalloc.a' library. Use instead 26530 `malloc' and related functions from `libc.a'; they do not have 26531 this problem. 26532 26533 * On the HP PA machine, ADB sometimes fails to work on functions 26534 compiled with GCC. Specifically, it fails to work on functions 26535 that use `alloca' or variable-size arrays. This is because GCC 26536 doesn't generate HP-UX unwind descriptors for such functions. It 26537 may even be impossible to generate them. 26538 26539 * Debugging (`-g') is not supported on the HP PA machine, unless you 26540 use the preliminary GNU tools. 26541 26542 * Taking the address of a label may generate errors from the HP-UX 26543 PA assembler. GAS for the PA does not have this problem. 26544 26545 * Using floating point parameters for indirect calls to static 26546 functions will not work when using the HP assembler. There simply 26547 is no way for GCC to specify what registers hold arguments for 26548 static functions when using the HP assembler. GAS for the PA does 26549 not have this problem. 26550 26551 * In extremely rare cases involving some very large functions you may 26552 receive errors from the HP linker complaining about an out of 26553 bounds unconditional branch offset. This used to occur more often 26554 in previous versions of GCC, but is now exceptionally rare. If 26555 you should run into it, you can work around by making your 26556 function smaller. 26557 26558 * GCC compiled code sometimes emits warnings from the HP-UX 26559 assembler of the form: 26560 26561 (warning) Use of GR3 when 26562 frame >= 8192 may cause conflict. 26563 26564 These warnings are harmless and can be safely ignored. 26565 26566 * In extremely rare cases involving some very large functions you may 26567 receive errors from the AIX Assembler complaining about a 26568 displacement that is too large. If you should run into it, you 26569 can work around by making your function smaller. 26570 26571 * The `libstdc++.a' library in GCC relies on the SVR4 dynamic linker 26572 semantics which merges global symbols between libraries and 26573 applications, especially necessary for C++ streams functionality. 26574 This is not the default behavior of AIX shared libraries and 26575 dynamic linking. `libstdc++.a' is built on AIX with 26576 "runtime-linking" enabled so that symbol merging can occur. To 26577 utilize this feature, the application linked with `libstdc++.a' 26578 must include the `-Wl,-brtl' flag on the link line. G++ cannot 26579 impose this because this option may interfere with the semantics 26580 of the user program and users may not always use `g++' to link his 26581 or her application. Applications are not required to use the 26582 `-Wl,-brtl' flag on the link line--the rest of the `libstdc++.a' 26583 library which is not dependent on the symbol merging semantics 26584 will continue to function correctly. 26585 26586 * An application can interpose its own definition of functions for 26587 functions invoked by `libstdc++.a' with "runtime-linking" enabled 26588 on AIX. To accomplish this the application must be linked with 26589 "runtime-linking" option and the functions explicitly must be 26590 exported by the application (`-Wl,-brtl,-bE:exportfile'). 26591 26592 * AIX on the RS/6000 provides support (NLS) for environments outside 26593 of the United States. Compilers and assemblers use NLS to support 26594 locale-specific representations of various objects including 26595 floating-point numbers (`.' vs `,' for separating decimal 26596 fractions). There have been problems reported where the library 26597 linked with GCC does not produce the same floating-point formats 26598 that the assembler accepts. If you have this problem, set the 26599 `LANG' environment variable to `C' or `En_US'. 26600 26601 * Even if you specify `-fdollars-in-identifiers', you cannot 26602 successfully use `$' in identifiers on the RS/6000 due to a 26603 restriction in the IBM assembler. GAS supports these identifiers. 26604 26605 * On Ultrix, the Fortran compiler expects registers 2 through 5 to 26606 be saved by function calls. However, the C compiler uses 26607 conventions compatible with BSD Unix: registers 2 through 5 may be 26608 clobbered by function calls. 26609 26610 GCC uses the same convention as the Ultrix C compiler. You can use 26611 these options to produce code compatible with the Fortran compiler: 26612 26613 -fcall-saved-r2 -fcall-saved-r3 -fcall-saved-r4 -fcall-saved-r5 26614 26615 26616File: gcc.info, Node: Incompatibilities, Next: Fixed Headers, Prev: Interoperation, Up: Trouble 26617 2661810.4 Incompatibilities of GCC 26619============================= 26620 26621There are several noteworthy incompatibilities between GNU C and K&R 26622(non-ISO) versions of C. 26623 26624 * GCC normally makes string constants read-only. If several 26625 identical-looking string constants are used, GCC stores only one 26626 copy of the string. 26627 26628 One consequence is that you cannot call `mktemp' with a string 26629 constant argument. The function `mktemp' always alters the string 26630 its argument points to. 26631 26632 Another consequence is that `sscanf' does not work on some very 26633 old systems when passed a string constant as its format control 26634 string or input. This is because `sscanf' incorrectly tries to 26635 write into the string constant. Likewise `fscanf' and `scanf'. 26636 26637 The solution to these problems is to change the program to use 26638 `char'-array variables with initialization strings for these 26639 purposes instead of string constants. 26640 26641 * `-2147483648' is positive. 26642 26643 This is because 2147483648 cannot fit in the type `int', so 26644 (following the ISO C rules) its data type is `unsigned long int'. 26645 Negating this value yields 2147483648 again. 26646 26647 * GCC does not substitute macro arguments when they appear inside of 26648 string constants. For example, the following macro in GCC 26649 26650 #define foo(a) "a" 26651 26652 will produce output `"a"' regardless of what the argument A is. 26653 26654 * When you use `setjmp' and `longjmp', the only automatic variables 26655 guaranteed to remain valid are those declared `volatile'. This is 26656 a consequence of automatic register allocation. Consider this 26657 function: 26658 26659 jmp_buf j; 26660 26661 foo () 26662 { 26663 int a, b; 26664 26665 a = fun1 (); 26666 if (setjmp (j)) 26667 return a; 26668 26669 a = fun2 (); 26670 /* `longjmp (j)' may occur in `fun3'. */ 26671 return a + fun3 (); 26672 } 26673 26674 Here `a' may or may not be restored to its first value when the 26675 `longjmp' occurs. If `a' is allocated in a register, then its 26676 first value is restored; otherwise, it keeps the last value stored 26677 in it. 26678 26679 If you use the `-W' option with the `-O' option, you will get a 26680 warning when GCC thinks such a problem might be possible. 26681 26682 * Programs that use preprocessing directives in the middle of macro 26683 arguments do not work with GCC. For example, a program like this 26684 will not work: 26685 26686 foobar ( 26687 #define luser 26688 hack) 26689 26690 ISO C does not permit such a construct. 26691 26692 * K&R compilers allow comments to cross over an inclusion boundary 26693 (i.e. started in an include file and ended in the including file). 26694 26695 * Declarations of external variables and functions within a block 26696 apply only to the block containing the declaration. In other 26697 words, they have the same scope as any other declaration in the 26698 same place. 26699 26700 In some other C compilers, a `extern' declaration affects all the 26701 rest of the file even if it happens within a block. 26702 26703 * In traditional C, you can combine `long', etc., with a typedef 26704 name, as shown here: 26705 26706 typedef int foo; 26707 typedef long foo bar; 26708 26709 In ISO C, this is not allowed: `long' and other type modifiers 26710 require an explicit `int'. 26711 26712 * PCC allows typedef names to be used as function parameters. 26713 26714 * Traditional C allows the following erroneous pair of declarations 26715 to appear together in a given scope: 26716 26717 typedef int foo; 26718 typedef foo foo; 26719 26720 * GCC treats all characters of identifiers as significant. 26721 According to K&R-1 (2.2), "No more than the first eight characters 26722 are significant, although more may be used.". Also according to 26723 K&R-1 (2.2), "An identifier is a sequence of letters and digits; 26724 the first character must be a letter. The underscore _ counts as 26725 a letter.", but GCC also allows dollar signs in identifiers. 26726 26727 * PCC allows whitespace in the middle of compound assignment 26728 operators such as `+='. GCC, following the ISO standard, does not 26729 allow this. 26730 26731 * GCC complains about unterminated character constants inside of 26732 preprocessing conditionals that fail. Some programs have English 26733 comments enclosed in conditionals that are guaranteed to fail; if 26734 these comments contain apostrophes, GCC will probably report an 26735 error. For example, this code would produce an error: 26736 26737 #if 0 26738 You can't expect this to work. 26739 #endif 26740 26741 The best solution to such a problem is to put the text into an 26742 actual C comment delimited by `/*...*/'. 26743 26744 * Many user programs contain the declaration `long time ();'. In the 26745 past, the system header files on many systems did not actually 26746 declare `time', so it did not matter what type your program 26747 declared it to return. But in systems with ISO C headers, `time' 26748 is declared to return `time_t', and if that is not the same as 26749 `long', then `long time ();' is erroneous. 26750 26751 The solution is to change your program to use appropriate system 26752 headers (`<time.h>' on systems with ISO C headers) and not to 26753 declare `time' if the system header files declare it, or failing 26754 that to use `time_t' as the return type of `time'. 26755 26756 * When compiling functions that return `float', PCC converts it to a 26757 double. GCC actually returns a `float'. If you are concerned 26758 with PCC compatibility, you should declare your functions to return 26759 `double'; you might as well say what you mean. 26760 26761 * When compiling functions that return structures or unions, GCC 26762 output code normally uses a method different from that used on most 26763 versions of Unix. As a result, code compiled with GCC cannot call 26764 a structure-returning function compiled with PCC, and vice versa. 26765 26766 The method used by GCC is as follows: a structure or union which is 26767 1, 2, 4 or 8 bytes long is returned like a scalar. A structure or 26768 union with any other size is stored into an address supplied by 26769 the caller (usually in a special, fixed register, but on some 26770 machines it is passed on the stack). The target hook 26771 `TARGET_STRUCT_VALUE_RTX' tells GCC where to pass this address. 26772 26773 By contrast, PCC on most target machines returns structures and 26774 unions of any size by copying the data into an area of static 26775 storage, and then returning the address of that storage as if it 26776 were a pointer value. The caller must copy the data from that 26777 memory area to the place where the value is wanted. GCC does not 26778 use this method because it is slower and nonreentrant. 26779 26780 On some newer machines, PCC uses a reentrant convention for all 26781 structure and union returning. GCC on most of these machines uses 26782 a compatible convention when returning structures and unions in 26783 memory, but still returns small structures and unions in registers. 26784 26785 You can tell GCC to use a compatible convention for all structure 26786 and union returning with the option `-fpcc-struct-return'. 26787 26788 * GCC complains about program fragments such as `0x74ae-0x4000' 26789 which appear to be two hexadecimal constants separated by the minus 26790 operator. Actually, this string is a single "preprocessing token". 26791 Each such token must correspond to one token in C. Since this 26792 does not, GCC prints an error message. Although it may appear 26793 obvious that what is meant is an operator and two values, the ISO 26794 C standard specifically requires that this be treated as erroneous. 26795 26796 A "preprocessing token" is a "preprocessing number" if it begins 26797 with a digit and is followed by letters, underscores, digits, 26798 periods and `e+', `e-', `E+', `E-', `p+', `p-', `P+', or `P-' 26799 character sequences. (In strict C89 mode, the sequences `p+', 26800 `p-', `P+' and `P-' cannot appear in preprocessing numbers.) 26801 26802 To make the above program fragment valid, place whitespace in 26803 front of the minus sign. This whitespace will end the 26804 preprocessing number. 26805 26806 26807File: gcc.info, Node: Fixed Headers, Next: Standard Libraries, Prev: Incompatibilities, Up: Trouble 26808 2680910.5 Fixed Header Files 26810======================= 26811 26812GCC needs to install corrected versions of some system header files. 26813This is because most target systems have some header files that won't 26814work with GCC unless they are changed. Some have bugs, some are 26815incompatible with ISO C, and some depend on special features of other 26816compilers. 26817 26818 Installing GCC automatically creates and installs the fixed header 26819files, by running a program called `fixincludes'. Normally, you don't 26820need to pay attention to this. But there are cases where it doesn't do 26821the right thing automatically. 26822 26823 * If you update the system's header files, such as by installing a 26824 new system version, the fixed header files of GCC are not 26825 automatically updated. They can be updated using the `mkheaders' 26826 script installed in `LIBEXECDIR/gcc/TARGET/VERSION/install-tools/'. 26827 26828 * On some systems, header file directories contain machine-specific 26829 symbolic links in certain places. This makes it possible to share 26830 most of the header files among hosts running the same version of 26831 the system on different machine models. 26832 26833 The programs that fix the header files do not understand this 26834 special way of using symbolic links; therefore, the directory of 26835 fixed header files is good only for the machine model used to 26836 build it. 26837 26838 It is possible to make separate sets of fixed header files for the 26839 different machine models, and arrange a structure of symbolic 26840 links so as to use the proper set, but you'll have to do this by 26841 hand. 26842 26843 26844File: gcc.info, Node: Standard Libraries, Next: Disappointments, Prev: Fixed Headers, Up: Trouble 26845 2684610.6 Standard Libraries 26847======================= 26848 26849GCC by itself attempts to be a conforming freestanding implementation. 26850*Note Language Standards Supported by GCC: Standards, for details of 26851what this means. Beyond the library facilities required of such an 26852implementation, the rest of the C library is supplied by the vendor of 26853the operating system. If that C library doesn't conform to the C 26854standards, then your programs might get warnings (especially when using 26855`-Wall') that you don't expect. 26856 26857 For example, the `sprintf' function on SunOS 4.1.3 returns `char *' 26858while the C standard says that `sprintf' returns an `int'. The 26859`fixincludes' program could make the prototype for this function match 26860the Standard, but that would be wrong, since the function will still 26861return `char *'. 26862 26863 If you need a Standard compliant library, then you need to find one, as 26864GCC does not provide one. The GNU C library (called `glibc') provides 26865ISO C, POSIX, BSD, SystemV and X/Open compatibility for GNU/Linux and 26866HURD-based GNU systems; no recent version of it supports other systems, 26867though some very old versions did. Version 2.2 of the GNU C library 26868includes nearly complete C99 support. You could also ask your 26869operating system vendor if newer libraries are available. 26870 26871 26872File: gcc.info, Node: Disappointments, Next: C++ Misunderstandings, Prev: Standard Libraries, Up: Trouble 26873 2687410.7 Disappointments and Misunderstandings 26875========================================== 26876 26877These problems are perhaps regrettable, but we don't know any practical 26878way around them. 26879 26880 * Certain local variables aren't recognized by debuggers when you 26881 compile with optimization. 26882 26883 This occurs because sometimes GCC optimizes the variable out of 26884 existence. There is no way to tell the debugger how to compute the 26885 value such a variable "would have had", and it is not clear that 26886 would be desirable anyway. So GCC simply does not mention the 26887 eliminated variable when it writes debugging information. 26888 26889 You have to expect a certain amount of disagreement between the 26890 executable and your source code, when you use optimization. 26891 26892 * Users often think it is a bug when GCC reports an error for code 26893 like this: 26894 26895 int foo (struct mumble *); 26896 26897 struct mumble { ... }; 26898 26899 int foo (struct mumble *x) 26900 { ... } 26901 26902 This code really is erroneous, because the scope of `struct 26903 mumble' in the prototype is limited to the argument list 26904 containing it. It does not refer to the `struct mumble' defined 26905 with file scope immediately below--they are two unrelated types 26906 with similar names in different scopes. 26907 26908 But in the definition of `foo', the file-scope type is used 26909 because that is available to be inherited. Thus, the definition 26910 and the prototype do not match, and you get an error. 26911 26912 This behavior may seem silly, but it's what the ISO standard 26913 specifies. It is easy enough for you to make your code work by 26914 moving the definition of `struct mumble' above the prototype. 26915 It's not worth being incompatible with ISO C just to avoid an 26916 error for the example shown above. 26917 26918 * Accesses to bit-fields even in volatile objects works by accessing 26919 larger objects, such as a byte or a word. You cannot rely on what 26920 size of object is accessed in order to read or write the 26921 bit-field; it may even vary for a given bit-field according to the 26922 precise usage. 26923 26924 If you care about controlling the amount of memory that is 26925 accessed, use volatile but do not use bit-fields. 26926 26927 * GCC comes with shell scripts to fix certain known problems in 26928 system header files. They install corrected copies of various 26929 header files in a special directory where only GCC will normally 26930 look for them. The scripts adapt to various systems by searching 26931 all the system header files for the problem cases that we know 26932 about. 26933 26934 If new system header files are installed, nothing automatically 26935 arranges to update the corrected header files. They can be 26936 updated using the `mkheaders' script installed in 26937 `LIBEXECDIR/gcc/TARGET/VERSION/install-tools/'. 26938 26939 * On 68000 and x86 systems, for instance, you can get paradoxical 26940 results if you test the precise values of floating point numbers. 26941 For example, you can find that a floating point value which is not 26942 a NaN is not equal to itself. This results from the fact that the 26943 floating point registers hold a few more bits of precision than 26944 fit in a `double' in memory. Compiled code moves values between 26945 memory and floating point registers at its convenience, and moving 26946 them into memory truncates them. 26947 26948 You can partially avoid this problem by using the `-ffloat-store' 26949 option (*note Optimize Options::). 26950 26951 * On AIX and other platforms without weak symbol support, templates 26952 need to be instantiated explicitly and symbols for static members 26953 of templates will not be generated. 26954 26955 * On AIX, GCC scans object files and library archives for static 26956 constructors and destructors when linking an application before the 26957 linker prunes unreferenced symbols. This is necessary to prevent 26958 the AIX linker from mistakenly assuming that static constructor or 26959 destructor are unused and removing them before the scanning can 26960 occur. All static constructors and destructors found will be 26961 referenced even though the modules in which they occur may not be 26962 used by the program. This may lead to both increased executable 26963 size and unexpected symbol references. 26964 26965 26966File: gcc.info, Node: C++ Misunderstandings, Next: Protoize Caveats, Prev: Disappointments, Up: Trouble 26967 2696810.8 Common Misunderstandings with GNU C++ 26969========================================== 26970 26971C++ is a complex language and an evolving one, and its standard 26972definition (the ISO C++ standard) was only recently completed. As a 26973result, your C++ compiler may occasionally surprise you, even when its 26974behavior is correct. This section discusses some areas that frequently 26975give rise to questions of this sort. 26976 26977* Menu: 26978 26979* Static Definitions:: Static member declarations are not definitions 26980* Name lookup:: Name lookup, templates, and accessing members of base classes 26981* Temporaries:: Temporaries may vanish before you expect 26982* Copy Assignment:: Copy Assignment operators copy virtual bases twice 26983 26984 26985File: gcc.info, Node: Static Definitions, Next: Name lookup, Up: C++ Misunderstandings 26986 2698710.8.1 Declare _and_ Define Static Members 26988------------------------------------------ 26989 26990When a class has static data members, it is not enough to _declare_ the 26991static member; you must also _define_ it. For example: 26992 26993 class Foo 26994 { 26995 ... 26996 void method(); 26997 static int bar; 26998 }; 26999 27000 This declaration only establishes that the class `Foo' has an `int' 27001named `Foo::bar', and a member function named `Foo::method'. But you 27002still need to define _both_ `method' and `bar' elsewhere. According to 27003the ISO standard, you must supply an initializer in one (and only one) 27004source file, such as: 27005 27006 int Foo::bar = 0; 27007 27008 Other C++ compilers may not correctly implement the standard behavior. 27009As a result, when you switch to `g++' from one of these compilers, you 27010may discover that a program that appeared to work correctly in fact 27011does not conform to the standard: `g++' reports as undefined symbols 27012any static data members that lack definitions. 27013 27014 27015File: gcc.info, Node: Name lookup, Next: Temporaries, Prev: Static Definitions, Up: C++ Misunderstandings 27016 2701710.8.2 Name lookup, templates, and accessing members of base classes 27018-------------------------------------------------------------------- 27019 27020The C++ standard prescribes that all names that are not dependent on 27021template parameters are bound to their present definitions when parsing 27022a template function or class.(1) Only names that are dependent are 27023looked up at the point of instantiation. For example, consider 27024 27025 void foo(double); 27026 27027 struct A { 27028 template <typename T> 27029 void f () { 27030 foo (1); // 1 27031 int i = N; // 2 27032 T t; 27033 t.bar(); // 3 27034 foo (t); // 4 27035 } 27036 27037 static const int N; 27038 }; 27039 27040 Here, the names `foo' and `N' appear in a context that does not depend 27041on the type of `T'. The compiler will thus require that they are 27042defined in the context of use in the template, not only before the 27043point of instantiation, and will here use `::foo(double)' and `A::N', 27044respectively. In particular, it will convert the integer value to a 27045`double' when passing it to `::foo(double)'. 27046 27047 Conversely, `bar' and the call to `foo' in the fourth marked line are 27048used in contexts that do depend on the type of `T', so they are only 27049looked up at the point of instantiation, and you can provide 27050declarations for them after declaring the template, but before 27051instantiating it. In particular, if you instantiate `A::f<int>', the 27052last line will call an overloaded `::foo(int)' if one was provided, 27053even if after the declaration of `struct A'. 27054 27055 This distinction between lookup of dependent and non-dependent names is 27056called two-stage (or dependent) name lookup. G++ implements it since 27057version 3.4. 27058 27059 Two-stage name lookup sometimes leads to situations with behavior 27060different from non-template codes. The most common is probably this: 27061 27062 template <typename T> struct Base { 27063 int i; 27064 }; 27065 27066 template <typename T> struct Derived : public Base<T> { 27067 int get_i() { return i; } 27068 }; 27069 27070 In `get_i()', `i' is not used in a dependent context, so the compiler 27071will look for a name declared at the enclosing namespace scope (which 27072is the global scope here). It will not look into the base class, since 27073that is dependent and you may declare specializations of `Base' even 27074after declaring `Derived', so the compiler can't really know what `i' 27075would refer to. If there is no global variable `i', then you will get 27076an error message. 27077 27078 In order to make it clear that you want the member of the base class, 27079you need to defer lookup until instantiation time, at which the base 27080class is known. For this, you need to access `i' in a dependent 27081context, by either using `this->i' (remember that `this' is of type 27082`Derived<T>*', so is obviously dependent), or using `Base<T>::i'. 27083Alternatively, `Base<T>::i' might be brought into scope by a 27084`using'-declaration. 27085 27086 Another, similar example involves calling member functions of a base 27087class: 27088 27089 template <typename T> struct Base { 27090 int f(); 27091 }; 27092 27093 template <typename T> struct Derived : Base<T> { 27094 int g() { return f(); }; 27095 }; 27096 27097 Again, the call to `f()' is not dependent on template arguments (there 27098are no arguments that depend on the type `T', and it is also not 27099otherwise specified that the call should be in a dependent context). 27100Thus a global declaration of such a function must be available, since 27101the one in the base class is not visible until instantiation time. The 27102compiler will consequently produce the following error message: 27103 27104 x.cc: In member function `int Derived<T>::g()': 27105 x.cc:6: error: there are no arguments to `f' that depend on a template 27106 parameter, so a declaration of `f' must be available 27107 x.cc:6: error: (if you use `-fpermissive', G++ will accept your code, but 27108 allowing the use of an undeclared name is deprecated) 27109 27110 To make the code valid either use `this->f()', or `Base<T>::f()'. 27111Using the `-fpermissive' flag will also let the compiler accept the 27112code, by marking all function calls for which no declaration is visible 27113at the time of definition of the template for later lookup at 27114instantiation time, as if it were a dependent call. We do not 27115recommend using `-fpermissive' to work around invalid code, and it will 27116also only catch cases where functions in base classes are called, not 27117where variables in base classes are used (as in the example above). 27118 27119 Note that some compilers (including G++ versions prior to 3.4) get 27120these examples wrong and accept above code without an error. Those 27121compilers do not implement two-stage name lookup correctly. 27122 27123 ---------- Footnotes ---------- 27124 27125 (1) The C++ standard just uses the term "dependent" for names that 27126depend on the type or value of template parameters. This shorter term 27127will also be used in the rest of this section. 27128 27129 27130File: gcc.info, Node: Temporaries, Next: Copy Assignment, Prev: Name lookup, Up: C++ Misunderstandings 27131 2713210.8.3 Temporaries May Vanish Before You Expect 27133----------------------------------------------- 27134 27135It is dangerous to use pointers or references to _portions_ of a 27136temporary object. The compiler may very well delete the object before 27137you expect it to, leaving a pointer to garbage. The most common place 27138where this problem crops up is in classes like string classes, 27139especially ones that define a conversion function to type `char *' or 27140`const char *'--which is one reason why the standard `string' class 27141requires you to call the `c_str' member function. However, any class 27142that returns a pointer to some internal structure is potentially 27143subject to this problem. 27144 27145 For example, a program may use a function `strfunc' that returns 27146`string' objects, and another function `charfunc' that operates on 27147pointers to `char': 27148 27149 string strfunc (); 27150 void charfunc (const char *); 27151 27152 void 27153 f () 27154 { 27155 const char *p = strfunc().c_str(); 27156 ... 27157 charfunc (p); 27158 ... 27159 charfunc (p); 27160 } 27161 27162In this situation, it may seem reasonable to save a pointer to the C 27163string returned by the `c_str' member function and use that rather than 27164call `c_str' repeatedly. However, the temporary string created by the 27165call to `strfunc' is destroyed after `p' is initialized, at which point 27166`p' is left pointing to freed memory. 27167 27168 Code like this may run successfully under some other compilers, 27169particularly obsolete cfront-based compilers that delete temporaries 27170along with normal local variables. However, the GNU C++ behavior is 27171standard-conforming, so if your program depends on late destruction of 27172temporaries it is not portable. 27173 27174 The safe way to write such code is to give the temporary a name, which 27175forces it to remain until the end of the scope of the name. For 27176example: 27177 27178 const string& tmp = strfunc (); 27179 charfunc (tmp.c_str ()); 27180 27181 27182File: gcc.info, Node: Copy Assignment, Prev: Temporaries, Up: C++ Misunderstandings 27183 2718410.8.4 Implicit Copy-Assignment for Virtual Bases 27185------------------------------------------------- 27186 27187When a base class is virtual, only one subobject of the base class 27188belongs to each full object. Also, the constructors and destructors are 27189invoked only once, and called from the most-derived class. However, 27190such objects behave unspecified when being assigned. For example: 27191 27192 struct Base{ 27193 char *name; 27194 Base(char *n) : name(strdup(n)){} 27195 Base& operator= (const Base& other){ 27196 free (name); 27197 name = strdup (other.name); 27198 } 27199 }; 27200 27201 struct A:virtual Base{ 27202 int val; 27203 A():Base("A"){} 27204 }; 27205 27206 struct B:virtual Base{ 27207 int bval; 27208 B():Base("B"){} 27209 }; 27210 27211 struct Derived:public A, public B{ 27212 Derived():Base("Derived"){} 27213 }; 27214 27215 void func(Derived &d1, Derived &d2) 27216 { 27217 d1 = d2; 27218 } 27219 27220 The C++ standard specifies that `Base::Base' is only called once when 27221constructing or copy-constructing a Derived object. It is unspecified 27222whether `Base::operator=' is called more than once when the implicit 27223copy-assignment for Derived objects is invoked (as it is inside `func' 27224in the example). 27225 27226 G++ implements the "intuitive" algorithm for copy-assignment: assign 27227all direct bases, then assign all members. In that algorithm, the 27228virtual base subobject can be encountered more than once. In the 27229example, copying proceeds in the following order: `val', `name' (via 27230`strdup'), `bval', and `name' again. 27231 27232 If application code relies on copy-assignment, a user-defined 27233copy-assignment operator removes any uncertainties. With such an 27234operator, the application can define whether and how the virtual base 27235subobject is assigned. 27236 27237 27238File: gcc.info, Node: Protoize Caveats, Next: Non-bugs, Prev: C++ Misunderstandings, Up: Trouble 27239 2724010.9 Caveats of using `protoize' 27241================================ 27242 27243The conversion programs `protoize' and `unprotoize' can sometimes 27244change a source file in a way that won't work unless you rearrange it. 27245 27246 * `protoize' can insert references to a type name or type tag before 27247 the definition, or in a file where they are not defined. 27248 27249 If this happens, compiler error messages should show you where the 27250 new references are, so fixing the file by hand is straightforward. 27251 27252 * There are some C constructs which `protoize' cannot figure out. 27253 For example, it can't determine argument types for declaring a 27254 pointer-to-function variable; this you must do by hand. `protoize' 27255 inserts a comment containing `???' each time it finds such a 27256 variable; so you can find all such variables by searching for this 27257 string. ISO C does not require declaring the argument types of 27258 pointer-to-function types. 27259 27260 * Using `unprotoize' can easily introduce bugs. If the program 27261 relied on prototypes to bring about conversion of arguments, these 27262 conversions will not take place in the program without prototypes. 27263 One case in which you can be sure `unprotoize' is safe is when you 27264 are removing prototypes that were made with `protoize'; if the 27265 program worked before without any prototypes, it will work again 27266 without them. 27267 27268 You can find all the places where this problem might occur by 27269 compiling the program with the `-Wconversion' option. It prints a 27270 warning whenever an argument is converted. 27271 27272 * Both conversion programs can be confused if there are macro calls 27273 in and around the text to be converted. In other words, the 27274 standard syntax for a declaration or definition must not result 27275 from expanding a macro. This problem is inherent in the design of 27276 C and cannot be fixed. If only a few functions have confusing 27277 macro calls, you can easily convert them manually. 27278 27279 * `protoize' cannot get the argument types for a function whose 27280 definition was not actually compiled due to preprocessing 27281 conditionals. When this happens, `protoize' changes nothing in 27282 regard to such a function. `protoize' tries to detect such 27283 instances and warn about them. 27284 27285 You can generally work around this problem by using `protoize' step 27286 by step, each time specifying a different set of `-D' options for 27287 compilation, until all of the functions have been converted. 27288 There is no automatic way to verify that you have got them all, 27289 however. 27290 27291 * Confusion may result if there is an occasion to convert a function 27292 declaration or definition in a region of source code where there 27293 is more than one formal parameter list present. Thus, attempts to 27294 convert code containing multiple (conditionally compiled) versions 27295 of a single function header (in the same vicinity) may not produce 27296 the desired (or expected) results. 27297 27298 If you plan on converting source files which contain such code, it 27299 is recommended that you first make sure that each conditionally 27300 compiled region of source code which contains an alternative 27301 function header also contains at least one additional follower 27302 token (past the final right parenthesis of the function header). 27303 This should circumvent the problem. 27304 27305 * `unprotoize' can become confused when trying to convert a function 27306 definition or declaration which contains a declaration for a 27307 pointer-to-function formal argument which has the same name as the 27308 function being defined or declared. We recommend you avoid such 27309 choices of formal parameter names. 27310 27311 * You might also want to correct some of the indentation by hand and 27312 break long lines. (The conversion programs don't write lines 27313 longer than eighty characters in any case.) 27314 27315 27316File: gcc.info, Node: Non-bugs, Next: Warnings and Errors, Prev: Protoize Caveats, Up: Trouble 27317 2731810.10 Certain Changes We Don't Want to Make 27319=========================================== 27320 27321This section lists changes that people frequently request, but which we 27322do not make because we think GCC is better without them. 27323 27324 * Checking the number and type of arguments to a function which has 27325 an old-fashioned definition and no prototype. 27326 27327 Such a feature would work only occasionally--only for calls that 27328 appear in the same file as the called function, following the 27329 definition. The only way to check all calls reliably is to add a 27330 prototype for the function. But adding a prototype eliminates the 27331 motivation for this feature. So the feature is not worthwhile. 27332 27333 * Warning about using an expression whose type is signed as a shift 27334 count. 27335 27336 Shift count operands are probably signed more often than unsigned. 27337 Warning about this would cause far more annoyance than good. 27338 27339 * Warning about assigning a signed value to an unsigned variable. 27340 27341 Such assignments must be very common; warning about them would 27342 cause more annoyance than good. 27343 27344 * Warning when a non-void function value is ignored. 27345 27346 C contains many standard functions that return a value that most 27347 programs choose to ignore. One obvious example is `printf'. 27348 Warning about this practice only leads the defensive programmer to 27349 clutter programs with dozens of casts to `void'. Such casts are 27350 required so frequently that they become visual noise. Writing 27351 those casts becomes so automatic that they no longer convey useful 27352 information about the intentions of the programmer. For functions 27353 where the return value should never be ignored, use the 27354 `warn_unused_result' function attribute (*note Function 27355 Attributes::). 27356 27357 * Making `-fshort-enums' the default. 27358 27359 This would cause storage layout to be incompatible with most other 27360 C compilers. And it doesn't seem very important, given that you 27361 can get the same result in other ways. The case where it matters 27362 most is when the enumeration-valued object is inside a structure, 27363 and in that case you can specify a field width explicitly. 27364 27365 * Making bit-fields unsigned by default on particular machines where 27366 "the ABI standard" says to do so. 27367 27368 The ISO C standard leaves it up to the implementation whether a 27369 bit-field declared plain `int' is signed or not. This in effect 27370 creates two alternative dialects of C. 27371 27372 The GNU C compiler supports both dialects; you can specify the 27373 signed dialect with `-fsigned-bitfields' and the unsigned dialect 27374 with `-funsigned-bitfields'. However, this leaves open the 27375 question of which dialect to use by default. 27376 27377 Currently, the preferred dialect makes plain bit-fields signed, 27378 because this is simplest. Since `int' is the same as `signed int' 27379 in every other context, it is cleanest for them to be the same in 27380 bit-fields as well. 27381 27382 Some computer manufacturers have published Application Binary 27383 Interface standards which specify that plain bit-fields should be 27384 unsigned. It is a mistake, however, to say anything about this 27385 issue in an ABI. This is because the handling of plain bit-fields 27386 distinguishes two dialects of C. Both dialects are meaningful on 27387 every type of machine. Whether a particular object file was 27388 compiled using signed bit-fields or unsigned is of no concern to 27389 other object files, even if they access the same bit-fields in the 27390 same data structures. 27391 27392 A given program is written in one or the other of these two 27393 dialects. The program stands a chance to work on most any machine 27394 if it is compiled with the proper dialect. It is unlikely to work 27395 at all if compiled with the wrong dialect. 27396 27397 Many users appreciate the GNU C compiler because it provides an 27398 environment that is uniform across machines. These users would be 27399 inconvenienced if the compiler treated plain bit-fields 27400 differently on certain machines. 27401 27402 Occasionally users write programs intended only for a particular 27403 machine type. On these occasions, the users would benefit if the 27404 GNU C compiler were to support by default the same dialect as the 27405 other compilers on that machine. But such applications are rare. 27406 And users writing a program to run on more than one type of 27407 machine cannot possibly benefit from this kind of compatibility. 27408 27409 This is why GCC does and will treat plain bit-fields in the same 27410 fashion on all types of machines (by default). 27411 27412 There are some arguments for making bit-fields unsigned by default 27413 on all machines. If, for example, this becomes a universal de 27414 facto standard, it would make sense for GCC to go along with it. 27415 This is something to be considered in the future. 27416 27417 (Of course, users strongly concerned about portability should 27418 indicate explicitly in each bit-field whether it is signed or not. 27419 In this way, they write programs which have the same meaning in 27420 both C dialects.) 27421 27422 * Undefining `__STDC__' when `-ansi' is not used. 27423 27424 Currently, GCC defines `__STDC__' unconditionally. This provides 27425 good results in practice. 27426 27427 Programmers normally use conditionals on `__STDC__' to ask whether 27428 it is safe to use certain features of ISO C, such as function 27429 prototypes or ISO token concatenation. Since plain `gcc' supports 27430 all the features of ISO C, the correct answer to these questions is 27431 "yes". 27432 27433 Some users try to use `__STDC__' to check for the availability of 27434 certain library facilities. This is actually incorrect usage in 27435 an ISO C program, because the ISO C standard says that a conforming 27436 freestanding implementation should define `__STDC__' even though it 27437 does not have the library facilities. `gcc -ansi -pedantic' is a 27438 conforming freestanding implementation, and it is therefore 27439 required to define `__STDC__', even though it does not come with 27440 an ISO C library. 27441 27442 Sometimes people say that defining `__STDC__' in a compiler that 27443 does not completely conform to the ISO C standard somehow violates 27444 the standard. This is illogical. The standard is a standard for 27445 compilers that claim to support ISO C, such as `gcc -ansi'--not 27446 for other compilers such as plain `gcc'. Whatever the ISO C 27447 standard says is relevant to the design of plain `gcc' without 27448 `-ansi' only for pragmatic reasons, not as a requirement. 27449 27450 GCC normally defines `__STDC__' to be 1, and in addition defines 27451 `__STRICT_ANSI__' if you specify the `-ansi' option, or a `-std' 27452 option for strict conformance to some version of ISO C. On some 27453 hosts, system include files use a different convention, where 27454 `__STDC__' is normally 0, but is 1 if the user specifies strict 27455 conformance to the C Standard. GCC follows the host convention 27456 when processing system include files, but when processing user 27457 files it follows the usual GNU C convention. 27458 27459 * Undefining `__STDC__' in C++. 27460 27461 Programs written to compile with C++-to-C translators get the 27462 value of `__STDC__' that goes with the C compiler that is 27463 subsequently used. These programs must test `__STDC__' to 27464 determine what kind of C preprocessor that compiler uses: whether 27465 they should concatenate tokens in the ISO C fashion or in the 27466 traditional fashion. 27467 27468 These programs work properly with GNU C++ if `__STDC__' is defined. 27469 They would not work otherwise. 27470 27471 In addition, many header files are written to provide prototypes 27472 in ISO C but not in traditional C. Many of these header files can 27473 work without change in C++ provided `__STDC__' is defined. If 27474 `__STDC__' is not defined, they will all fail, and will all need 27475 to be changed to test explicitly for C++ as well. 27476 27477 * Deleting "empty" loops. 27478 27479 Historically, GCC has not deleted "empty" loops under the 27480 assumption that the most likely reason you would put one in a 27481 program is to have a delay, so deleting them will not make real 27482 programs run any faster. 27483 27484 However, the rationale here is that optimization of a nonempty loop 27485 cannot produce an empty one. This held for carefully written C 27486 compiled with less powerful optimizers but is not always the case 27487 for carefully written C++ or with more powerful optimizers. Thus 27488 GCC will remove operations from loops whenever it can determine 27489 those operations are not externally visible (apart from the time 27490 taken to execute them, of course). In case the loop can be proved 27491 to be finite, GCC will also remove the loop itself. 27492 27493 Be aware of this when performing timing tests, for instance the 27494 following loop can be completely removed, provided 27495 `some_expression' can provably not change any global state. 27496 27497 { 27498 int sum = 0; 27499 int ix; 27500 27501 for (ix = 0; ix != 10000; ix++) 27502 sum += some_expression; 27503 } 27504 27505 Even though `sum' is accumulated in the loop, no use is made of 27506 that summation, so the accumulation can be removed. 27507 27508 * Making side effects happen in the same order as in some other 27509 compiler. 27510 27511 It is never safe to depend on the order of evaluation of side 27512 effects. For example, a function call like this may very well 27513 behave differently from one compiler to another: 27514 27515 void func (int, int); 27516 27517 int i = 2; 27518 func (i++, i++); 27519 27520 There is no guarantee (in either the C or the C++ standard language 27521 definitions) that the increments will be evaluated in any 27522 particular order. Either increment might happen first. `func' 27523 might get the arguments `2, 3', or it might get `3, 2', or even 27524 `2, 2'. 27525 27526 * Making certain warnings into errors by default. 27527 27528 Some ISO C testsuites report failure when the compiler does not 27529 produce an error message for a certain program. 27530 27531 ISO C requires a "diagnostic" message for certain kinds of invalid 27532 programs, but a warning is defined by GCC to count as a 27533 diagnostic. If GCC produces a warning but not an error, that is 27534 correct ISO C support. If testsuites call this "failure", they 27535 should be run with the GCC option `-pedantic-errors', which will 27536 turn these warnings into errors. 27537 27538 27539 27540File: gcc.info, Node: Warnings and Errors, Prev: Non-bugs, Up: Trouble 27541 2754210.11 Warning Messages and Error Messages 27543========================================= 27544 27545The GNU compiler can produce two kinds of diagnostics: errors and 27546warnings. Each kind has a different purpose: 27547 27548 "Errors" report problems that make it impossible to compile your 27549 program. GCC reports errors with the source file name and line 27550 number where the problem is apparent. 27551 27552 "Warnings" report other unusual conditions in your code that _may_ 27553 indicate a problem, although compilation can (and does) proceed. 27554 Warning messages also report the source file name and line number, 27555 but include the text `warning:' to distinguish them from error 27556 messages. 27557 27558 Warnings may indicate danger points where you should check to make sure 27559that your program really does what you intend; or the use of obsolete 27560features; or the use of nonstandard features of GNU C or C++. Many 27561warnings are issued only if you ask for them, with one of the `-W' 27562options (for instance, `-Wall' requests a variety of useful warnings). 27563 27564 GCC always tries to compile your program if possible; it never 27565gratuitously rejects a program whose meaning is clear merely because 27566(for instance) it fails to conform to a standard. In some cases, 27567however, the C and C++ standards specify that certain extensions are 27568forbidden, and a diagnostic _must_ be issued by a conforming compiler. 27569The `-pedantic' option tells GCC to issue warnings in such cases; 27570`-pedantic-errors' says to make them errors instead. This does not 27571mean that _all_ non-ISO constructs get warnings or errors. 27572 27573 *Note Options to Request or Suppress Warnings: Warning Options, for 27574more detail on these and related command-line options. 27575 27576 27577File: gcc.info, Node: Bugs, Next: Service, Prev: Trouble, Up: Top 27578 2757911 Reporting Bugs 27580***************** 27581 27582Your bug reports play an essential role in making GCC reliable. 27583 27584 When you encounter a problem, the first thing to do is to see if it is 27585already known. *Note Trouble::. If it isn't known, then you should 27586report the problem. 27587 27588* Menu: 27589 27590* Criteria: Bug Criteria. Have you really found a bug? 27591* Reporting: Bug Reporting. How to report a bug effectively. 27592* Known: Trouble. Known problems. 27593* Help: Service. Where to ask for help. 27594 27595 27596File: gcc.info, Node: Bug Criteria, Next: Bug Reporting, Up: Bugs 27597 2759811.1 Have You Found a Bug? 27599========================== 27600 27601If you are not sure whether you have found a bug, here are some 27602guidelines: 27603 27604 * If the compiler gets a fatal signal, for any input whatever, that 27605 is a compiler bug. Reliable compilers never crash. 27606 27607 * If the compiler produces invalid assembly code, for any input 27608 whatever (except an `asm' statement), that is a compiler bug, 27609 unless the compiler reports errors (not just warnings) which would 27610 ordinarily prevent the assembler from being run. 27611 27612 * If the compiler produces valid assembly code that does not 27613 correctly execute the input source code, that is a compiler bug. 27614 27615 However, you must double-check to make sure, because you may have a 27616 program whose behavior is undefined, which happened by chance to 27617 give the desired results with another C or C++ compiler. 27618 27619 For example, in many nonoptimizing compilers, you can write `x;' 27620 at the end of a function instead of `return x;', with the same 27621 results. But the value of the function is undefined if `return' 27622 is omitted; it is not a bug when GCC produces different results. 27623 27624 Problems often result from expressions with two increment 27625 operators, as in `f (*p++, *p++)'. Your previous compiler might 27626 have interpreted that expression the way you intended; GCC might 27627 interpret it another way. Neither compiler is wrong. The bug is 27628 in your code. 27629 27630 After you have localized the error to a single source line, it 27631 should be easy to check for these things. If your program is 27632 correct and well defined, you have found a compiler bug. 27633 27634 * If the compiler produces an error message for valid input, that is 27635 a compiler bug. 27636 27637 * If the compiler does not produce an error message for invalid 27638 input, that is a compiler bug. However, you should note that your 27639 idea of "invalid input" might be someone else's idea of "an 27640 extension" or "support for traditional practice". 27641 27642 * If you are an experienced user of one of the languages GCC 27643 supports, your suggestions for improvement of GCC are welcome in 27644 any case. 27645 27646 27647File: gcc.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Bugs 27648 2764911.2 How and where to Report Bugs 27650================================= 27651 27652Bugs should be reported to the GCC bug database. Please refer to 27653`http://gcc.gnu.org/bugs.html' for up-to-date instructions how to 27654submit bug reports. Copies of this file in HTML (`bugs.html') and 27655plain text (`BUGS') are also part of GCC releases. 27656 27657 27658File: gcc.info, Node: Service, Next: Contributing, Prev: Bugs, Up: Top 27659 2766012 How To Get Help with GCC 27661*************************** 27662 27663If you need help installing, using or changing GCC, there are two ways 27664to find it: 27665 27666 * Send a message to a suitable network mailing list. First try 27667 <gcc-help@gcc.gnu.org> (for help installing or using GCC), and if 27668 that brings no response, try <gcc@gcc.gnu.org>. For help changing 27669 GCC, ask <gcc@gcc.gnu.org>. If you think you have found a bug in 27670 GCC, please report it following the instructions at *note Bug 27671 Reporting::. 27672 27673 * Look in the service directory for someone who might help you for a 27674 fee. The service directory is found at 27675 `http://www.gnu.org/prep/service.html'. 27676 27677 For further information, see `http://gcc.gnu.org/faq.html#support'. 27678 27679 27680File: gcc.info, Node: Contributing, Next: Funding, Prev: Service, Up: Top 27681 2768213 Contributing to GCC Development 27683********************************** 27684 27685If you would like to help pretest GCC releases to assure they work well, 27686current development sources are available by SVN (see 27687`http://gcc.gnu.org/svn.html'). Source and binary snapshots are also 27688available for FTP; see `http://gcc.gnu.org/snapshots.html'. 27689 27690 If you would like to work on improvements to GCC, please read the 27691advice at these URLs: 27692 27693 `http://gcc.gnu.org/contribute.html' 27694 `http://gcc.gnu.org/contributewhy.html' 27695 27696for information on how to make useful contributions and avoid 27697duplication of effort. Suggested projects are listed at 27698`http://gcc.gnu.org/projects/'. 27699 27700 27701File: gcc.info, Node: Funding, Next: GNU Project, Prev: Contributing, Up: Top 27702 27703Funding Free Software 27704********************* 27705 27706If you want to have more free software a few years from now, it makes 27707sense for you to help encourage people to contribute funds for its 27708development. The most effective approach known is to encourage 27709commercial redistributors to donate. 27710 27711 Users of free software systems can boost the pace of development by 27712encouraging for-a-fee distributors to donate part of their selling price 27713to free software developers--the Free Software Foundation, and others. 27714 27715 The way to convince distributors to do this is to demand it and expect 27716it from them. So when you compare distributors, judge them partly by 27717how much they give to free software development. Show distributors 27718they must compete to be the one who gives the most. 27719 27720 To make this approach work, you must insist on numbers that you can 27721compare, such as, "We will donate ten dollars to the Frobnitz project 27722for each disk sold." Don't be satisfied with a vague promise, such as 27723"A portion of the profits are donated," since it doesn't give a basis 27724for comparison. 27725 27726 Even a precise fraction "of the profits from this disk" is not very 27727meaningful, since creative accounting and unrelated business decisions 27728can greatly alter what fraction of the sales price counts as profit. 27729If the price you pay is $50, ten percent of the profit is probably less 27730than a dollar; it might be a few cents, or nothing at all. 27731 27732 Some redistributors do development work themselves. This is useful 27733too; but to keep everyone honest, you need to inquire how much they do, 27734and what kind. Some kinds of development make much more long-term 27735difference than others. For example, maintaining a separate version of 27736a program contributes very little; maintaining the standard version of a 27737program for the whole community contributes much. Easy new ports 27738contribute little, since someone else would surely do them; difficult 27739ports such as adding a new CPU to the GNU Compiler Collection 27740contribute more; major new features or packages contribute the most. 27741 27742 By establishing the idea that supporting further development is "the 27743proper thing to do" when distributing free software for a fee, we can 27744assure a steady flow of resources into making more free software. 27745 27746 Copyright (C) 1994 Free Software Foundation, Inc. 27747 Verbatim copying and redistribution of this section is permitted 27748 without royalty; alteration is not permitted. 27749 27750 27751File: gcc.info, Node: GNU Project, Next: Copying, Prev: Funding, Up: Top 27752 27753The GNU Project and GNU/Linux 27754***************************** 27755 27756The GNU Project was launched in 1984 to develop a complete Unix-like 27757operating system which is free software: the GNU system. (GNU is a 27758recursive acronym for "GNU's Not Unix"; it is pronounced "guh-NEW".) 27759Variants of the GNU operating system, which use the kernel Linux, are 27760now widely used; though these systems are often referred to as "Linux", 27761they are more accurately called GNU/Linux systems. 27762 27763 For more information, see: 27764 `http://www.gnu.org/' 27765 `http://www.gnu.org/gnu/linux-and-gnu.html' 27766 27767 27768File: gcc.info, Node: Copying, Next: GNU Free Documentation License, Prev: GNU Project, Up: Top 27769 27770GNU GENERAL PUBLIC LICENSE 27771************************** 27772 27773 Version 2, June 1991 27774 27775 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 27776 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 27777 27778 Everyone is permitted to copy and distribute verbatim copies 27779 of this license document, but changing it is not allowed. 27780 27781Preamble 27782======== 27783 27784The licenses for most software are designed to take away your freedom 27785to share and change it. By contrast, the GNU General Public License is 27786intended to guarantee your freedom to share and change free 27787software--to make sure the software is free for all its users. This 27788General Public License applies to most of the Free Software 27789Foundation's software and to any other program whose authors commit to 27790using it. (Some other Free Software Foundation software is covered by 27791the GNU Library General Public License instead.) You can apply it to 27792your programs, too. 27793 27794 When we speak of free software, we are referring to freedom, not 27795price. Our General Public Licenses are designed to make sure that you 27796have the freedom to distribute copies of free software (and charge for 27797this service if you wish), that you receive source code or can get it 27798if you want it, that you can change the software or use pieces of it in 27799new free programs; and that you know you can do these things. 27800 27801 To protect your rights, we need to make restrictions that forbid 27802anyone to deny you these rights or to ask you to surrender the rights. 27803These restrictions translate to certain responsibilities for you if you 27804distribute copies of the software, or if you modify it. 27805 27806 For example, if you distribute copies of such a program, whether 27807gratis or for a fee, you must give the recipients all the rights that 27808you have. You must make sure that they, too, receive or can get the 27809source code. And you must show them these terms so they know their 27810rights. 27811 27812 We protect your rights with two steps: (1) copyright the software, and 27813(2) offer you this license which gives you legal permission to copy, 27814distribute and/or modify the software. 27815 27816 Also, for each author's protection and ours, we want to make certain 27817that everyone understands that there is no warranty for this free 27818software. If the software is modified by someone else and passed on, we 27819want its recipients to know that what they have is not the original, so 27820that any problems introduced by others will not reflect on the original 27821authors' reputations. 27822 27823 Finally, any free program is threatened constantly by software 27824patents. We wish to avoid the danger that redistributors of a free 27825program will individually obtain patent licenses, in effect making the 27826program proprietary. To prevent this, we have made it clear that any 27827patent must be licensed for everyone's free use or not licensed at all. 27828 27829 The precise terms and conditions for copying, distribution and 27830modification follow. 27831 27832 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 27833 0. This License applies to any program or other work which contains a 27834 notice placed by the copyright holder saying it may be distributed 27835 under the terms of this General Public License. The "Program", 27836 below, refers to any such program or work, and a "work based on 27837 the Program" means either the Program or any derivative work under 27838 copyright law: that is to say, a work containing the Program or a 27839 portion of it, either verbatim or with modifications and/or 27840 translated into another language. (Hereinafter, translation is 27841 included without limitation in the term "modification".) Each 27842 licensee is addressed as "you". 27843 27844 Activities other than copying, distribution and modification are 27845 not covered by this License; they are outside its scope. The act 27846 of running the Program is not restricted, and the output from the 27847 Program is covered only if its contents constitute a work based on 27848 the Program (independent of having been made by running the 27849 Program). Whether that is true depends on what the Program does. 27850 27851 1. You may copy and distribute verbatim copies of the Program's 27852 source code as you receive it, in any medium, provided that you 27853 conspicuously and appropriately publish on each copy an appropriate 27854 copyright notice and disclaimer of warranty; keep intact all the 27855 notices that refer to this License and to the absence of any 27856 warranty; and give any other recipients of the Program a copy of 27857 this License along with the Program. 27858 27859 You may charge a fee for the physical act of transferring a copy, 27860 and you may at your option offer warranty protection in exchange 27861 for a fee. 27862 27863 2. You may modify your copy or copies of the Program or any portion 27864 of it, thus forming a work based on the Program, and copy and 27865 distribute such modifications or work under the terms of Section 1 27866 above, provided that you also meet all of these conditions: 27867 27868 a. You must cause the modified files to carry prominent notices 27869 stating that you changed the files and the date of any change. 27870 27871 b. You must cause any work that you distribute or publish, that 27872 in whole or in part contains or is derived from the Program 27873 or any part thereof, to be licensed as a whole at no charge 27874 to all third parties under the terms of this License. 27875 27876 c. If the modified program normally reads commands interactively 27877 when run, you must cause it, when started running for such 27878 interactive use in the most ordinary way, to print or display 27879 an announcement including an appropriate copyright notice and 27880 a notice that there is no warranty (or else, saying that you 27881 provide a warranty) and that users may redistribute the 27882 program under these conditions, and telling the user how to 27883 view a copy of this License. (Exception: if the Program 27884 itself is interactive but does not normally print such an 27885 announcement, your work based on the Program is not required 27886 to print an announcement.) 27887 27888 These requirements apply to the modified work as a whole. If 27889 identifiable sections of that work are not derived from the 27890 Program, and can be reasonably considered independent and separate 27891 works in themselves, then this License, and its terms, do not 27892 apply to those sections when you distribute them as separate 27893 works. But when you distribute the same sections as part of a 27894 whole which is a work based on the Program, the distribution of 27895 the whole must be on the terms of this License, whose permissions 27896 for other licensees extend to the entire whole, and thus to each 27897 and every part regardless of who wrote it. 27898 27899 Thus, it is not the intent of this section to claim rights or 27900 contest your rights to work written entirely by you; rather, the 27901 intent is to exercise the right to control the distribution of 27902 derivative or collective works based on the Program. 27903 27904 In addition, mere aggregation of another work not based on the 27905 Program with the Program (or with a work based on the Program) on 27906 a volume of a storage or distribution medium does not bring the 27907 other work under the scope of this License. 27908 27909 3. You may copy and distribute the Program (or a work based on it, 27910 under Section 2) in object code or executable form under the terms 27911 of Sections 1 and 2 above provided that you also do one of the 27912 following: 27913 27914 a. Accompany it with the complete corresponding machine-readable 27915 source code, which must be distributed under the terms of 27916 Sections 1 and 2 above on a medium customarily used for 27917 software interchange; or, 27918 27919 b. Accompany it with a written offer, valid for at least three 27920 years, to give any third party, for a charge no more than your 27921 cost of physically performing source distribution, a complete 27922 machine-readable copy of the corresponding source code, to be 27923 distributed under the terms of Sections 1 and 2 above on a 27924 medium customarily used for software interchange; or, 27925 27926 c. Accompany it with the information you received as to the offer 27927 to distribute corresponding source code. (This alternative is 27928 allowed only for noncommercial distribution and only if you 27929 received the program in object code or executable form with 27930 such an offer, in accord with Subsection b above.) 27931 27932 The source code for a work means the preferred form of the work for 27933 making modifications to it. For an executable work, complete 27934 source code means all the source code for all modules it contains, 27935 plus any associated interface definition files, plus the scripts 27936 used to control compilation and installation of the executable. 27937 However, as a special exception, the source code distributed need 27938 not include anything that is normally distributed (in either 27939 source or binary form) with the major components (compiler, 27940 kernel, and so on) of the operating system on which the executable 27941 runs, unless that component itself accompanies the executable. 27942 27943 If distribution of executable or object code is made by offering 27944 access to copy from a designated place, then offering equivalent 27945 access to copy the source code from the same place counts as 27946 distribution of the source code, even though third parties are not 27947 compelled to copy the source along with the object code. 27948 27949 4. You may not copy, modify, sublicense, or distribute the Program 27950 except as expressly provided under this License. Any attempt 27951 otherwise to copy, modify, sublicense or distribute the Program is 27952 void, and will automatically terminate your rights under this 27953 License. However, parties who have received copies, or rights, 27954 from you under this License will not have their licenses 27955 terminated so long as such parties remain in full compliance. 27956 27957 5. You are not required to accept this License, since you have not 27958 signed it. However, nothing else grants you permission to modify 27959 or distribute the Program or its derivative works. These actions 27960 are prohibited by law if you do not accept this License. 27961 Therefore, by modifying or distributing the Program (or any work 27962 based on the Program), you indicate your acceptance of this 27963 License to do so, and all its terms and conditions for copying, 27964 distributing or modifying the Program or works based on it. 27965 27966 6. Each time you redistribute the Program (or any work based on the 27967 Program), the recipient automatically receives a license from the 27968 original licensor to copy, distribute or modify the Program 27969 subject to these terms and conditions. You may not impose any 27970 further restrictions on the recipients' exercise of the rights 27971 granted herein. You are not responsible for enforcing compliance 27972 by third parties to this License. 27973 27974 7. If, as a consequence of a court judgment or allegation of patent 27975 infringement or for any other reason (not limited to patent 27976 issues), conditions are imposed on you (whether by court order, 27977 agreement or otherwise) that contradict the conditions of this 27978 License, they do not excuse you from the conditions of this 27979 License. If you cannot distribute so as to satisfy simultaneously 27980 your obligations under this License and any other pertinent 27981 obligations, then as a consequence you may not distribute the 27982 Program at all. For example, if a patent license would not permit 27983 royalty-free redistribution of the Program by all those who 27984 receive copies directly or indirectly through you, then the only 27985 way you could satisfy both it and this License would be to refrain 27986 entirely from distribution of the Program. 27987 27988 If any portion of this section is held invalid or unenforceable 27989 under any particular circumstance, the balance of the section is 27990 intended to apply and the section as a whole is intended to apply 27991 in other circumstances. 27992 27993 It is not the purpose of this section to induce you to infringe any 27994 patents or other property right claims or to contest validity of 27995 any such claims; this section has the sole purpose of protecting 27996 the integrity of the free software distribution system, which is 27997 implemented by public license practices. Many people have made 27998 generous contributions to the wide range of software distributed 27999 through that system in reliance on consistent application of that 28000 system; it is up to the author/donor to decide if he or she is 28001 willing to distribute software through any other system and a 28002 licensee cannot impose that choice. 28003 28004 This section is intended to make thoroughly clear what is believed 28005 to be a consequence of the rest of this License. 28006 28007 8. If the distribution and/or use of the Program is restricted in 28008 certain countries either by patents or by copyrighted interfaces, 28009 the original copyright holder who places the Program under this 28010 License may add an explicit geographical distribution limitation 28011 excluding those countries, so that distribution is permitted only 28012 in or among countries not thus excluded. In such case, this 28013 License incorporates the limitation as if written in the body of 28014 this License. 28015 28016 9. The Free Software Foundation may publish revised and/or new 28017 versions of the General Public License from time to time. Such 28018 new versions will be similar in spirit to the present version, but 28019 may differ in detail to address new problems or concerns. 28020 28021 Each version is given a distinguishing version number. If the 28022 Program specifies a version number of this License which applies 28023 to it and "any later version", you have the option of following 28024 the terms and conditions either of that version or of any later 28025 version published by the Free Software Foundation. If the Program 28026 does not specify a version number of this License, you may choose 28027 any version ever published by the Free Software Foundation. 28028 28029 10. If you wish to incorporate parts of the Program into other free 28030 programs whose distribution conditions are different, write to the 28031 author to ask for permission. For software which is copyrighted 28032 by the Free Software Foundation, write to the Free Software 28033 Foundation; we sometimes make exceptions for this. Our decision 28034 will be guided by the two goals of preserving the free status of 28035 all derivatives of our free software and of promoting the sharing 28036 and reuse of software generally. 28037 28038 NO WARRANTY 28039 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO 28040 WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE 28041 LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 28042 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT 28043 WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT 28044 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 28045 FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE 28046 QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 28047 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY 28048 SERVICING, REPAIR OR CORRECTION. 28049 28050 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 28051 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY 28052 MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE 28053 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 28054 INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR 28055 INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 28056 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU 28057 OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY 28058 OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN 28059 ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28060 28061 END OF TERMS AND CONDITIONS 28062Appendix: How to Apply These Terms to Your New Programs 28063======================================================= 28064 28065If you develop a new program, and you want it to be of the greatest 28066possible use to the public, the best way to achieve this is to make it 28067free software which everyone can redistribute and change under these 28068terms. 28069 28070 To do so, attach the following notices to the program. It is safest 28071to attach them to the start of each source file to most effectively 28072convey the exclusion of warranty; and each file should have at least 28073the "copyright" line and a pointer to where the full notice is found. 28074 28075 ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. 28076 Copyright (C) YEAR NAME OF AUTHOR 28077 28078 This program is free software; you can redistribute it and/or modify 28079 it under the terms of the GNU General Public License as published by 28080 the Free Software Foundation; either version 2 of the License, or 28081 (at your option) any later version. 28082 28083 This program is distributed in the hope that it will be useful, 28084 but WITHOUT ANY WARRANTY; without even the implied warranty of 28085 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28086 GNU General Public License for more details. 28087 28088 You should have received a copy of the GNU General Public License 28089 along with this program; if not, write to the Free Software 28090 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 28091 28092 Also add information on how to contact you by electronic and paper 28093mail. 28094 28095 If the program is interactive, make it output a short notice like this 28096when it starts in an interactive mode: 28097 28098 Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR 28099 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details 28100 type `show w'. 28101 This is free software, and you are welcome to redistribute it 28102 under certain conditions; type `show c' for details. 28103 28104 The hypothetical commands `show w' and `show c' should show the 28105appropriate parts of the General Public License. Of course, the 28106commands you use may be called something other than `show w' and `show 28107c'; they could even be mouse-clicks or menu items--whatever suits your 28108program. 28109 28110 You should also get your employer (if you work as a programmer) or your 28111school, if any, to sign a "copyright disclaimer" for the program, if 28112necessary. Here is a sample; alter the names: 28113 28114 Yoyodyne, Inc., hereby disclaims all copyright interest in the program 28115 `Gnomovision' (which makes passes at compilers) written by James Hacker. 28116 28117 SIGNATURE OF TY COON, 1 April 1989 28118 Ty Coon, President of Vice 28119 28120 This General Public License does not permit incorporating your program 28121into proprietary programs. If your program is a subroutine library, 28122you may consider it more useful to permit linking proprietary 28123applications with the library. If this is what you want to do, use the 28124GNU Library General Public License instead of this License. 28125 28126 28127File: gcc.info, Node: GNU Free Documentation License, Next: Contributors, Prev: Copying, Up: Top 28128 28129GNU Free Documentation License 28130****************************** 28131 28132 Version 1.2, November 2002 28133 28134 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 28135 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 28136 28137 Everyone is permitted to copy and distribute verbatim copies 28138 of this license document, but changing it is not allowed. 28139 28140 0. PREAMBLE 28141 28142 The purpose of this License is to make a manual, textbook, or other 28143 functional and useful document "free" in the sense of freedom: to 28144 assure everyone the effective freedom to copy and redistribute it, 28145 with or without modifying it, either commercially or 28146 noncommercially. Secondarily, this License preserves for the 28147 author and publisher a way to get credit for their work, while not 28148 being considered responsible for modifications made by others. 28149 28150 This License is a kind of "copyleft", which means that derivative 28151 works of the document must themselves be free in the same sense. 28152 It complements the GNU General Public License, which is a copyleft 28153 license designed for free software. 28154 28155 We have designed this License in order to use it for manuals for 28156 free software, because free software needs free documentation: a 28157 free program should come with manuals providing the same freedoms 28158 that the software does. But this License is not limited to 28159 software manuals; it can be used for any textual work, regardless 28160 of subject matter or whether it is published as a printed book. 28161 We recommend this License principally for works whose purpose is 28162 instruction or reference. 28163 28164 1. APPLICABILITY AND DEFINITIONS 28165 28166 This License applies to any manual or other work, in any medium, 28167 that contains a notice placed by the copyright holder saying it 28168 can be distributed under the terms of this License. Such a notice 28169 grants a world-wide, royalty-free license, unlimited in duration, 28170 to use that work under the conditions stated herein. The 28171 "Document", below, refers to any such manual or work. Any member 28172 of the public is a licensee, and is addressed as "you". You 28173 accept the license if you copy, modify or distribute the work in a 28174 way requiring permission under copyright law. 28175 28176 A "Modified Version" of the Document means any work containing the 28177 Document or a portion of it, either copied verbatim, or with 28178 modifications and/or translated into another language. 28179 28180 A "Secondary Section" is a named appendix or a front-matter section 28181 of the Document that deals exclusively with the relationship of the 28182 publishers or authors of the Document to the Document's overall 28183 subject (or to related matters) and contains nothing that could 28184 fall directly within that overall subject. (Thus, if the Document 28185 is in part a textbook of mathematics, a Secondary Section may not 28186 explain any mathematics.) The relationship could be a matter of 28187 historical connection with the subject or with related matters, or 28188 of legal, commercial, philosophical, ethical or political position 28189 regarding them. 28190 28191 The "Invariant Sections" are certain Secondary Sections whose 28192 titles are designated, as being those of Invariant Sections, in 28193 the notice that says that the Document is released under this 28194 License. If a section does not fit the above definition of 28195 Secondary then it is not allowed to be designated as Invariant. 28196 The Document may contain zero Invariant Sections. If the Document 28197 does not identify any Invariant Sections then there are none. 28198 28199 The "Cover Texts" are certain short passages of text that are 28200 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 28201 that says that the Document is released under this License. A 28202 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 28203 be at most 25 words. 28204 28205 A "Transparent" copy of the Document means a machine-readable copy, 28206 represented in a format whose specification is available to the 28207 general public, that is suitable for revising the document 28208 straightforwardly with generic text editors or (for images 28209 composed of pixels) generic paint programs or (for drawings) some 28210 widely available drawing editor, and that is suitable for input to 28211 text formatters or for automatic translation to a variety of 28212 formats suitable for input to text formatters. A copy made in an 28213 otherwise Transparent file format whose markup, or absence of 28214 markup, has been arranged to thwart or discourage subsequent 28215 modification by readers is not Transparent. An image format is 28216 not Transparent if used for any substantial amount of text. A 28217 copy that is not "Transparent" is called "Opaque". 28218 28219 Examples of suitable formats for Transparent copies include plain 28220 ASCII without markup, Texinfo input format, LaTeX input format, 28221 SGML or XML using a publicly available DTD, and 28222 standard-conforming simple HTML, PostScript or PDF designed for 28223 human modification. Examples of transparent image formats include 28224 PNG, XCF and JPG. Opaque formats include proprietary formats that 28225 can be read and edited only by proprietary word processors, SGML or 28226 XML for which the DTD and/or processing tools are not generally 28227 available, and the machine-generated HTML, PostScript or PDF 28228 produced by some word processors for output purposes only. 28229 28230 The "Title Page" means, for a printed book, the title page itself, 28231 plus such following pages as are needed to hold, legibly, the 28232 material this License requires to appear in the title page. For 28233 works in formats which do not have any title page as such, "Title 28234 Page" means the text near the most prominent appearance of the 28235 work's title, preceding the beginning of the body of the text. 28236 28237 A section "Entitled XYZ" means a named subunit of the Document 28238 whose title either is precisely XYZ or contains XYZ in parentheses 28239 following text that translates XYZ in another language. (Here XYZ 28240 stands for a specific section name mentioned below, such as 28241 "Acknowledgements", "Dedications", "Endorsements", or "History".) 28242 To "Preserve the Title" of such a section when you modify the 28243 Document means that it remains a section "Entitled XYZ" according 28244 to this definition. 28245 28246 The Document may include Warranty Disclaimers next to the notice 28247 which states that this License applies to the Document. These 28248 Warranty Disclaimers are considered to be included by reference in 28249 this License, but only as regards disclaiming warranties: any other 28250 implication that these Warranty Disclaimers may have is void and 28251 has no effect on the meaning of this License. 28252 28253 2. VERBATIM COPYING 28254 28255 You may copy and distribute the Document in any medium, either 28256 commercially or noncommercially, provided that this License, the 28257 copyright notices, and the license notice saying this License 28258 applies to the Document are reproduced in all copies, and that you 28259 add no other conditions whatsoever to those of this License. You 28260 may not use technical measures to obstruct or control the reading 28261 or further copying of the copies you make or distribute. However, 28262 you may accept compensation in exchange for copies. If you 28263 distribute a large enough number of copies you must also follow 28264 the conditions in section 3. 28265 28266 You may also lend copies, under the same conditions stated above, 28267 and you may publicly display copies. 28268 28269 3. COPYING IN QUANTITY 28270 28271 If you publish printed copies (or copies in media that commonly 28272 have printed covers) of the Document, numbering more than 100, and 28273 the Document's license notice requires Cover Texts, you must 28274 enclose the copies in covers that carry, clearly and legibly, all 28275 these Cover Texts: Front-Cover Texts on the front cover, and 28276 Back-Cover Texts on the back cover. Both covers must also clearly 28277 and legibly identify you as the publisher of these copies. The 28278 front cover must present the full title with all words of the 28279 title equally prominent and visible. You may add other material 28280 on the covers in addition. Copying with changes limited to the 28281 covers, as long as they preserve the title of the Document and 28282 satisfy these conditions, can be treated as verbatim copying in 28283 other respects. 28284 28285 If the required texts for either cover are too voluminous to fit 28286 legibly, you should put the first ones listed (as many as fit 28287 reasonably) on the actual cover, and continue the rest onto 28288 adjacent pages. 28289 28290 If you publish or distribute Opaque copies of the Document 28291 numbering more than 100, you must either include a 28292 machine-readable Transparent copy along with each Opaque copy, or 28293 state in or with each Opaque copy a computer-network location from 28294 which the general network-using public has access to download 28295 using public-standard network protocols a complete Transparent 28296 copy of the Document, free of added material. If you use the 28297 latter option, you must take reasonably prudent steps, when you 28298 begin distribution of Opaque copies in quantity, to ensure that 28299 this Transparent copy will remain thus accessible at the stated 28300 location until at least one year after the last time you 28301 distribute an Opaque copy (directly or through your agents or 28302 retailers) of that edition to the public. 28303 28304 It is requested, but not required, that you contact the authors of 28305 the Document well before redistributing any large number of 28306 copies, to give them a chance to provide you with an updated 28307 version of the Document. 28308 28309 4. MODIFICATIONS 28310 28311 You may copy and distribute a Modified Version of the Document 28312 under the conditions of sections 2 and 3 above, provided that you 28313 release the Modified Version under precisely this License, with 28314 the Modified Version filling the role of the Document, thus 28315 licensing distribution and modification of the Modified Version to 28316 whoever possesses a copy of it. In addition, you must do these 28317 things in the Modified Version: 28318 28319 A. Use in the Title Page (and on the covers, if any) a title 28320 distinct from that of the Document, and from those of 28321 previous versions (which should, if there were any, be listed 28322 in the History section of the Document). You may use the 28323 same title as a previous version if the original publisher of 28324 that version gives permission. 28325 28326 B. List on the Title Page, as authors, one or more persons or 28327 entities responsible for authorship of the modifications in 28328 the Modified Version, together with at least five of the 28329 principal authors of the Document (all of its principal 28330 authors, if it has fewer than five), unless they release you 28331 from this requirement. 28332 28333 C. State on the Title page the name of the publisher of the 28334 Modified Version, as the publisher. 28335 28336 D. Preserve all the copyright notices of the Document. 28337 28338 E. Add an appropriate copyright notice for your modifications 28339 adjacent to the other copyright notices. 28340 28341 F. Include, immediately after the copyright notices, a license 28342 notice giving the public permission to use the Modified 28343 Version under the terms of this License, in the form shown in 28344 the Addendum below. 28345 28346 G. Preserve in that license notice the full lists of Invariant 28347 Sections and required Cover Texts given in the Document's 28348 license notice. 28349 28350 H. Include an unaltered copy of this License. 28351 28352 I. Preserve the section Entitled "History", Preserve its Title, 28353 and add to it an item stating at least the title, year, new 28354 authors, and publisher of the Modified Version as given on 28355 the Title Page. If there is no section Entitled "History" in 28356 the Document, create one stating the title, year, authors, 28357 and publisher of the Document as given on its Title Page, 28358 then add an item describing the Modified Version as stated in 28359 the previous sentence. 28360 28361 J. Preserve the network location, if any, given in the Document 28362 for public access to a Transparent copy of the Document, and 28363 likewise the network locations given in the Document for 28364 previous versions it was based on. These may be placed in 28365 the "History" section. You may omit a network location for a 28366 work that was published at least four years before the 28367 Document itself, or if the original publisher of the version 28368 it refers to gives permission. 28369 28370 K. For any section Entitled "Acknowledgements" or "Dedications", 28371 Preserve the Title of the section, and preserve in the 28372 section all the substance and tone of each of the contributor 28373 acknowledgements and/or dedications given therein. 28374 28375 L. Preserve all the Invariant Sections of the Document, 28376 unaltered in their text and in their titles. Section numbers 28377 or the equivalent are not considered part of the section 28378 titles. 28379 28380 M. Delete any section Entitled "Endorsements". Such a section 28381 may not be included in the Modified Version. 28382 28383 N. Do not retitle any existing section to be Entitled 28384 "Endorsements" or to conflict in title with any Invariant 28385 Section. 28386 28387 O. Preserve any Warranty Disclaimers. 28388 28389 If the Modified Version includes new front-matter sections or 28390 appendices that qualify as Secondary Sections and contain no 28391 material copied from the Document, you may at your option 28392 designate some or all of these sections as invariant. To do this, 28393 add their titles to the list of Invariant Sections in the Modified 28394 Version's license notice. These titles must be distinct from any 28395 other section titles. 28396 28397 You may add a section Entitled "Endorsements", provided it contains 28398 nothing but endorsements of your Modified Version by various 28399 parties--for example, statements of peer review or that the text 28400 has been approved by an organization as the authoritative 28401 definition of a standard. 28402 28403 You may add a passage of up to five words as a Front-Cover Text, 28404 and a passage of up to 25 words as a Back-Cover Text, to the end 28405 of the list of Cover Texts in the Modified Version. Only one 28406 passage of Front-Cover Text and one of Back-Cover Text may be 28407 added by (or through arrangements made by) any one entity. If the 28408 Document already includes a cover text for the same cover, 28409 previously added by you or by arrangement made by the same entity 28410 you are acting on behalf of, you may not add another; but you may 28411 replace the old one, on explicit permission from the previous 28412 publisher that added the old one. 28413 28414 The author(s) and publisher(s) of the Document do not by this 28415 License give permission to use their names for publicity for or to 28416 assert or imply endorsement of any Modified Version. 28417 28418 5. COMBINING DOCUMENTS 28419 28420 You may combine the Document with other documents released under 28421 this License, under the terms defined in section 4 above for 28422 modified versions, provided that you include in the combination 28423 all of the Invariant Sections of all of the original documents, 28424 unmodified, and list them all as Invariant Sections of your 28425 combined work in its license notice, and that you preserve all 28426 their Warranty Disclaimers. 28427 28428 The combined work need only contain one copy of this License, and 28429 multiple identical Invariant Sections may be replaced with a single 28430 copy. If there are multiple Invariant Sections with the same name 28431 but different contents, make the title of each such section unique 28432 by adding at the end of it, in parentheses, the name of the 28433 original author or publisher of that section if known, or else a 28434 unique number. Make the same adjustment to the section titles in 28435 the list of Invariant Sections in the license notice of the 28436 combined work. 28437 28438 In the combination, you must combine any sections Entitled 28439 "History" in the various original documents, forming one section 28440 Entitled "History"; likewise combine any sections Entitled 28441 "Acknowledgements", and any sections Entitled "Dedications". You 28442 must delete all sections Entitled "Endorsements." 28443 28444 6. COLLECTIONS OF DOCUMENTS 28445 28446 You may make a collection consisting of the Document and other 28447 documents released under this License, and replace the individual 28448 copies of this License in the various documents with a single copy 28449 that is included in the collection, provided that you follow the 28450 rules of this License for verbatim copying of each of the 28451 documents in all other respects. 28452 28453 You may extract a single document from such a collection, and 28454 distribute it individually under this License, provided you insert 28455 a copy of this License into the extracted document, and follow 28456 this License in all other respects regarding verbatim copying of 28457 that document. 28458 28459 7. AGGREGATION WITH INDEPENDENT WORKS 28460 28461 A compilation of the Document or its derivatives with other 28462 separate and independent documents or works, in or on a volume of 28463 a storage or distribution medium, is called an "aggregate" if the 28464 copyright resulting from the compilation is not used to limit the 28465 legal rights of the compilation's users beyond what the individual 28466 works permit. When the Document is included in an aggregate, this 28467 License does not apply to the other works in the aggregate which 28468 are not themselves derivative works of the Document. 28469 28470 If the Cover Text requirement of section 3 is applicable to these 28471 copies of the Document, then if the Document is less than one half 28472 of the entire aggregate, the Document's Cover Texts may be placed 28473 on covers that bracket the Document within the aggregate, or the 28474 electronic equivalent of covers if the Document is in electronic 28475 form. Otherwise they must appear on printed covers that bracket 28476 the whole aggregate. 28477 28478 8. TRANSLATION 28479 28480 Translation is considered a kind of modification, so you may 28481 distribute translations of the Document under the terms of section 28482 4. Replacing Invariant Sections with translations requires special 28483 permission from their copyright holders, but you may include 28484 translations of some or all Invariant Sections in addition to the 28485 original versions of these Invariant Sections. You may include a 28486 translation of this License, and all the license notices in the 28487 Document, and any Warranty Disclaimers, provided that you also 28488 include the original English version of this License and the 28489 original versions of those notices and disclaimers. In case of a 28490 disagreement between the translation and the original version of 28491 this License or a notice or disclaimer, the original version will 28492 prevail. 28493 28494 If a section in the Document is Entitled "Acknowledgements", 28495 "Dedications", or "History", the requirement (section 4) to 28496 Preserve its Title (section 1) will typically require changing the 28497 actual title. 28498 28499 9. TERMINATION 28500 28501 You may not copy, modify, sublicense, or distribute the Document 28502 except as expressly provided for under this License. Any other 28503 attempt to copy, modify, sublicense or distribute the Document is 28504 void, and will automatically terminate your rights under this 28505 License. However, parties who have received copies, or rights, 28506 from you under this License will not have their licenses 28507 terminated so long as such parties remain in full compliance. 28508 28509 10. FUTURE REVISIONS OF THIS LICENSE 28510 28511 The Free Software Foundation may publish new, revised versions of 28512 the GNU Free Documentation License from time to time. Such new 28513 versions will be similar in spirit to the present version, but may 28514 differ in detail to address new problems or concerns. See 28515 `http://www.gnu.org/copyleft/'. 28516 28517 Each version of the License is given a distinguishing version 28518 number. If the Document specifies that a particular numbered 28519 version of this License "or any later version" applies to it, you 28520 have the option of following the terms and conditions either of 28521 that specified version or of any later version that has been 28522 published (not as a draft) by the Free Software Foundation. If 28523 the Document does not specify a version number of this License, 28524 you may choose any version ever published (not as a draft) by the 28525 Free Software Foundation. 28526 28527ADDENDUM: How to use this License for your documents 28528==================================================== 28529 28530To use this License in a document you have written, include a copy of 28531the License in the document and put the following copyright and license 28532notices just after the title page: 28533 28534 Copyright (C) YEAR YOUR NAME. 28535 Permission is granted to copy, distribute and/or modify this document 28536 under the terms of the GNU Free Documentation License, Version 1.2 28537 or any later version published by the Free Software Foundation; 28538 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 28539 Texts. A copy of the license is included in the section entitled ``GNU 28540 Free Documentation License''. 28541 28542 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, 28543replace the "with...Texts." line with this: 28544 28545 with the Invariant Sections being LIST THEIR TITLES, with 28546 the Front-Cover Texts being LIST, and with the Back-Cover Texts 28547 being LIST. 28548 28549 If you have Invariant Sections without Cover Texts, or some other 28550combination of the three, merge those two alternatives to suit the 28551situation. 28552 28553 If your document contains nontrivial examples of program code, we 28554recommend releasing these examples in parallel under your choice of 28555free software license, such as the GNU General Public License, to 28556permit their use in free software. 28557 28558 28559File: gcc.info, Node: Contributors, Next: Option Index, Prev: GNU Free Documentation License, Up: Top 28560 28561Contributors to GCC 28562******************* 28563 28564The GCC project would like to thank its many contributors. Without 28565them the project would not have been nearly as successful as it has 28566been. Any omissions in this list are accidental. Feel free to contact 28567<law@redhat.com> or <gerald@pfeifer.com> if you have been left out or 28568some of your contributions are not listed. Please keep this list in 28569alphabetical order. 28570 28571 * Analog Devices helped implement the support for complex data types 28572 and iterators. 28573 28574 * John David Anglin for threading-related fixes and improvements to 28575 libstdc++-v3, and the HP-UX port. 28576 28577 * James van Artsdalen wrote the code that makes efficient use of the 28578 Intel 80387 register stack. 28579 28580 * Abramo and Roberto Bagnara for the SysV68 Motorola 3300 Delta 28581 Series port. 28582 28583 * Alasdair Baird for various bug fixes. 28584 28585 * Giovanni Bajo for analyzing lots of complicated C++ problem 28586 reports. 28587 28588 * Peter Barada for his work to improve code generation for new 28589 ColdFire cores. 28590 28591 * Gerald Baumgartner added the signature extension to the C++ front 28592 end. 28593 28594 * Godmar Back for his Java improvements and encouragement. 28595 28596 * Scott Bambrough for help porting the Java compiler. 28597 28598 * Wolfgang Bangerth for processing tons of bug reports. 28599 28600 * Jon Beniston for his Microsoft Windows port of Java. 28601 28602 * Daniel Berlin for better DWARF2 support, faster/better 28603 optimizations, improved alias analysis, plus migrating GCC to 28604 Bugzilla. 28605 28606 * Geoff Berry for his Java object serialization work and various 28607 patches. 28608 28609 * Uros Bizjak for the implementation of x87 math built-in functions 28610 and for various middle end and i386 back end improvements and 28611 bugfixes. 28612 28613 * Eric Blake for helping to make GCJ and libgcj conform to the 28614 specifications. 28615 28616 * Janne Blomqvist for contributions to GNU Fortran. 28617 28618 * Segher Boessenkool for various fixes. 28619 28620 * Hans-J. Boehm for his garbage collector, IA-64 libffi port, and 28621 other Java work. 28622 28623 * Neil Booth for work on cpplib, lang hooks, debug hooks and other 28624 miscellaneous clean-ups. 28625 28626 * Steven Bosscher for integrating the GNU Fortran front end into GCC 28627 and for contributing to the tree-ssa branch. 28628 28629 * Eric Botcazou for fixing middle- and backend bugs left and right. 28630 28631 * Per Bothner for his direction via the steering committee and 28632 various improvements to the infrastructure for supporting new 28633 languages. Chill front end implementation. Initial 28634 implementations of cpplib, fix-header, config.guess, libio, and 28635 past C++ library (libg++) maintainer. Dreaming up, designing and 28636 implementing much of GCJ. 28637 28638 * Devon Bowen helped port GCC to the Tahoe. 28639 28640 * Don Bowman for mips-vxworks contributions. 28641 28642 * Dave Brolley for work on cpplib and Chill. 28643 28644 * Paul Brook for work on the ARM architecture and maintaining GNU 28645 Fortran. 28646 28647 * Robert Brown implemented the support for Encore 32000 systems. 28648 28649 * Christian Bruel for improvements to local store elimination. 28650 28651 * Herman A.J. ten Brugge for various fixes. 28652 28653 * Joerg Brunsmann for Java compiler hacking and help with the GCJ 28654 FAQ. 28655 28656 * Joe Buck for his direction via the steering committee. 28657 28658 * Craig Burley for leadership of the G77 Fortran effort. 28659 28660 * Stephan Buys for contributing Doxygen notes for libstdc++. 28661 28662 * Paolo Carlini for libstdc++ work: lots of efficiency improvements 28663 to the C++ strings, streambufs and formatted I/O, hard detective 28664 work on the frustrating localization issues, and keeping up with 28665 the problem reports. 28666 28667 * John Carr for his alias work, SPARC hacking, infrastructure 28668 improvements, previous contributions to the steering committee, 28669 loop optimizations, etc. 28670 28671 * Stephane Carrez for 68HC11 and 68HC12 ports. 28672 28673 * Steve Chamberlain for support for the Renesas SH and H8 processors 28674 and the PicoJava processor, and for GCJ config fixes. 28675 28676 * Glenn Chambers for help with the GCJ FAQ. 28677 28678 * John-Marc Chandonia for various libgcj patches. 28679 28680 * Scott Christley for his Objective-C contributions. 28681 28682 * Eric Christopher for his Java porting help and clean-ups. 28683 28684 * Branko Cibej for more warning contributions. 28685 28686 * The GNU Classpath project for all of their merged runtime code. 28687 28688 * Nick Clifton for arm, mcore, fr30, v850, m32r work, `--help', and 28689 other random hacking. 28690 28691 * Michael Cook for libstdc++ cleanup patches to reduce warnings. 28692 28693 * R. Kelley Cook for making GCC buildable from a read-only directory 28694 as well as other miscellaneous build process and documentation 28695 clean-ups. 28696 28697 * Ralf Corsepius for SH testing and minor bugfixing. 28698 28699 * Stan Cox for care and feeding of the x86 port and lots of behind 28700 the scenes hacking. 28701 28702 * Alex Crain provided changes for the 3b1. 28703 28704 * Ian Dall for major improvements to the NS32k port. 28705 28706 * Paul Dale for his work to add uClinux platform support to the m68k 28707 backend. 28708 28709 * Dario Dariol contributed the four varieties of sample programs 28710 that print a copy of their source. 28711 28712 * Russell Davidson for fstream and stringstream fixes in libstdc++. 28713 28714 * Bud Davis for work on the G77 and GNU Fortran compilers. 28715 28716 * Mo DeJong for GCJ and libgcj bug fixes. 28717 28718 * DJ Delorie for the DJGPP port, build and libiberty maintenance, 28719 various bug fixes, and the M32C port. 28720 28721 * Arnaud Desitter for helping to debug GNU Fortran. 28722 28723 * Gabriel Dos Reis for contributions to G++, contributions and 28724 maintenance of GCC diagnostics infrastructure, libstdc++-v3, 28725 including `valarray<>', `complex<>', maintaining the numerics 28726 library (including that pesky `<limits>' :-) and keeping 28727 up-to-date anything to do with numbers. 28728 28729 * Ulrich Drepper for his work on glibc, testing of GCC using glibc, 28730 ISO C99 support, CFG dumping support, etc., plus support of the 28731 C++ runtime libraries including for all kinds of C interface 28732 issues, contributing and maintaining `complex<>', sanity checking 28733 and disbursement, configuration architecture, libio maintenance, 28734 and early math work. 28735 28736 * Zdenek Dvorak for a new loop unroller and various fixes. 28737 28738 * Richard Earnshaw for his ongoing work with the ARM. 28739 28740 * David Edelsohn for his direction via the steering committee, 28741 ongoing work with the RS6000/PowerPC port, help cleaning up Haifa 28742 loop changes, doing the entire AIX port of libstdc++ with his bare 28743 hands, and for ensuring GCC properly keeps working on AIX. 28744 28745 * Kevin Ediger for the floating point formatting of num_put::do_put 28746 in libstdc++. 28747 28748 * Phil Edwards for libstdc++ work including configuration hackery, 28749 documentation maintainer, chief breaker of the web pages, the 28750 occasional iostream bug fix, and work on shared library symbol 28751 versioning. 28752 28753 * Paul Eggert for random hacking all over GCC. 28754 28755 * Mark Elbrecht for various DJGPP improvements, and for libstdc++ 28756 configuration support for locales and fstream-related fixes. 28757 28758 * Vadim Egorov for libstdc++ fixes in strings, streambufs, and 28759 iostreams. 28760 28761 * Christian Ehrhardt for dealing with bug reports. 28762 28763 * Ben Elliston for his work to move the Objective-C runtime into its 28764 own subdirectory and for his work on autoconf. 28765 28766 * Marc Espie for OpenBSD support. 28767 28768 * Doug Evans for much of the global optimization framework, arc, 28769 m32r, and SPARC work. 28770 28771 * Christopher Faylor for his work on the Cygwin port and for caring 28772 and feeding the gcc.gnu.org box and saving its users tons of spam. 28773 28774 * Fred Fish for BeOS support and Ada fixes. 28775 28776 * Ivan Fontes Garcia for the Portuguese translation of the GCJ FAQ. 28777 28778 * Peter Gerwinski for various bug fixes and the Pascal front end. 28779 28780 * Kaveh R. Ghazi for his direction via the steering committee, 28781 amazing work to make `-W -Wall -W* -Werror' useful, and 28782 continuously testing GCC on a plethora of platforms. Kaveh 28783 extends his gratitude to the CAIP Center at Rutgers University for 28784 providing him with computing resources to work on Free Software 28785 since the late 1980s. 28786 28787 * John Gilmore for a donation to the FSF earmarked improving GNU 28788 Java. 28789 28790 * Judy Goldberg for c++ contributions. 28791 28792 * Torbjorn Granlund for various fixes and the c-torture testsuite, 28793 multiply- and divide-by-constant optimization, improved long long 28794 support, improved leaf function register allocation, and his 28795 direction via the steering committee. 28796 28797 * Anthony Green for his `-Os' contributions and Java front end work. 28798 28799 * Stu Grossman for gdb hacking, allowing GCJ developers to debug 28800 Java code. 28801 28802 * Michael K. Gschwind contributed the port to the PDP-11. 28803 28804 * Ron Guilmette implemented the `protoize' and `unprotoize' tools, 28805 the support for Dwarf symbolic debugging information, and much of 28806 the support for System V Release 4. He has also worked heavily on 28807 the Intel 386 and 860 support. 28808 28809 * Mostafa Hagog for Swing Modulo Scheduling (SMS) and post reload 28810 GCSE. 28811 28812 * Bruno Haible for improvements in the runtime overhead for EH, new 28813 warnings and assorted bug fixes. 28814 28815 * Andrew Haley for his amazing Java compiler and library efforts. 28816 28817 * Chris Hanson assisted in making GCC work on HP-UX for the 9000 28818 series 300. 28819 28820 * Michael Hayes for various thankless work he's done trying to get 28821 the c30/c40 ports functional. Lots of loop and unroll 28822 improvements and fixes. 28823 28824 * Dara Hazeghi for wading through myriads of target-specific bug 28825 reports. 28826 28827 * Kate Hedstrom for staking the G77 folks with an initial testsuite. 28828 28829 * Richard Henderson for his ongoing SPARC, alpha, ia32, and ia64 28830 work, loop opts, and generally fixing lots of old problems we've 28831 ignored for years, flow rewrite and lots of further stuff, 28832 including reviewing tons of patches. 28833 28834 * Aldy Hernandez for working on the PowerPC port, SIMD support, and 28835 various fixes. 28836 28837 * Nobuyuki Hikichi of Software Research Associates, Tokyo, 28838 contributed the support for the Sony NEWS machine. 28839 28840 * Kazu Hirata for caring and feeding the Renesas H8/300 port and 28841 various fixes. 28842 28843 * Katherine Holcomb for work on GNU Fortran. 28844 28845 * Manfred Hollstein for his ongoing work to keep the m88k alive, lots 28846 of testing and bug fixing, particularly of GCC configury code. 28847 28848 * Steve Holmgren for MachTen patches. 28849 28850 * Jan Hubicka for his x86 port improvements. 28851 28852 * Falk Hueffner for working on C and optimization bug reports. 28853 28854 * Bernardo Innocenti for his m68k work, including merging of 28855 ColdFire improvements and uClinux support. 28856 28857 * Christian Iseli for various bug fixes. 28858 28859 * Kamil Iskra for general m68k hacking. 28860 28861 * Lee Iverson for random fixes and MIPS testing. 28862 28863 * Andreas Jaeger for testing and benchmarking of GCC and various bug 28864 fixes. 28865 28866 * Jakub Jelinek for his SPARC work and sibling call optimizations as 28867 well as lots of bug fixes and test cases, and for improving the 28868 Java build system. 28869 28870 * Janis Johnson for ia64 testing and fixes, her quality improvement 28871 sidetracks, and web page maintenance. 28872 28873 * Kean Johnston for SCO OpenServer support and various fixes. 28874 28875 * Tim Josling for the sample language treelang based originally on 28876 Richard Kenner's "toy" language. 28877 28878 * Nicolai Josuttis for additional libstdc++ documentation. 28879 28880 * Klaus Kaempf for his ongoing work to make alpha-vms a viable 28881 target. 28882 28883 * Steven G. Kargl for work on GNU Fortran. 28884 28885 * David Kashtan of SRI adapted GCC to VMS. 28886 28887 * Ryszard Kabatek for many, many libstdc++ bug fixes and 28888 optimizations of strings, especially member functions, and for 28889 auto_ptr fixes. 28890 28891 * Geoffrey Keating for his ongoing work to make the PPC work for 28892 GNU/Linux and his automatic regression tester. 28893 28894 * Brendan Kehoe for his ongoing work with G++ and for a lot of early 28895 work in just about every part of libstdc++. 28896 28897 * Oliver M. Kellogg of Deutsche Aerospace contributed the port to the 28898 MIL-STD-1750A. 28899 28900 * Richard Kenner of the New York University Ultracomputer Research 28901 Laboratory wrote the machine descriptions for the AMD 29000, the 28902 DEC Alpha, the IBM RT PC, and the IBM RS/6000 as well as the 28903 support for instruction attributes. He also made changes to 28904 better support RISC processors including changes to common 28905 subexpression elimination, strength reduction, function calling 28906 sequence handling, and condition code support, in addition to 28907 generalizing the code for frame pointer elimination and delay slot 28908 scheduling. Richard Kenner was also the head maintainer of GCC 28909 for several years. 28910 28911 * Mumit Khan for various contributions to the Cygwin and Mingw32 28912 ports and maintaining binary releases for Microsoft Windows hosts, 28913 and for massive libstdc++ porting work to Cygwin/Mingw32. 28914 28915 * Robin Kirkham for cpu32 support. 28916 28917 * Mark Klein for PA improvements. 28918 28919 * Thomas Koenig for various bug fixes. 28920 28921 * Bruce Korb for the new and improved fixincludes code. 28922 28923 * Benjamin Kosnik for his G++ work and for leading the libstdc++-v3 28924 effort. 28925 28926 * Charles LaBrec contributed the support for the Integrated Solutions 28927 68020 system. 28928 28929 * Asher Langton and Mike Kumbera for contributing Cray pointer 28930 support to GNU Fortran, and for other GNU Fortran improvements. 28931 28932 * Jeff Law for his direction via the steering committee, 28933 coordinating the entire egcs project and GCC 2.95, rolling out 28934 snapshots and releases, handling merges from GCC2, reviewing tons 28935 of patches that might have fallen through the cracks else, and 28936 random but extensive hacking. 28937 28938 * Marc Lehmann for his direction via the steering committee and 28939 helping with analysis and improvements of x86 performance. 28940 28941 * Victor Leikehman for work on GNU Fortran. 28942 28943 * Ted Lemon wrote parts of the RTL reader and printer. 28944 28945 * Kriang Lerdsuwanakij for C++ improvements including template as 28946 template parameter support, and many C++ fixes. 28947 28948 * Warren Levy for tremendous work on libgcj (Java Runtime Library) 28949 and random work on the Java front end. 28950 28951 * Alain Lichnewsky ported GCC to the MIPS CPU. 28952 28953 * Oskar Liljeblad for hacking on AWT and his many Java bug reports 28954 and patches. 28955 28956 * Robert Lipe for OpenServer support, new testsuites, testing, etc. 28957 28958 * Weiwen Liu for testing and various bug fixes. 28959 28960 * Dave Love for his ongoing work with the Fortran front end and 28961 runtime libraries. 28962 28963 * Martin von Lo"wis for internal consistency checking infrastructure, 28964 various C++ improvements including namespace support, and tons of 28965 assistance with libstdc++/compiler merges. 28966 28967 * H.J. Lu for his previous contributions to the steering committee, 28968 many x86 bug reports, prototype patches, and keeping the GNU/Linux 28969 ports working. 28970 28971 * Greg McGary for random fixes and (someday) bounded pointers. 28972 28973 * Andrew MacLeod for his ongoing work in building a real EH system, 28974 various code generation improvements, work on the global 28975 optimizer, etc. 28976 28977 * Vladimir Makarov for hacking some ugly i960 problems, PowerPC 28978 hacking improvements to compile-time performance, overall 28979 knowledge and direction in the area of instruction scheduling, and 28980 design and implementation of the automaton based instruction 28981 scheduler. 28982 28983 * Bob Manson for his behind the scenes work on dejagnu. 28984 28985 * Philip Martin for lots of libstdc++ string and vector iterator 28986 fixes and improvements, and string clean up and testsuites. 28987 28988 * All of the Mauve project contributors, for Java test code. 28989 28990 * Bryce McKinlay for numerous GCJ and libgcj fixes and improvements. 28991 28992 * Adam Megacz for his work on the Microsoft Windows port of GCJ. 28993 28994 * Michael Meissner for LRS framework, ia32, m32r, v850, m88k, MIPS, 28995 powerpc, haifa, ECOFF debug support, and other assorted hacking. 28996 28997 * Jason Merrill for his direction via the steering committee and 28998 leading the G++ effort. 28999 29000 * Martin Michlmayr for testing GCC on several architectures using the 29001 entire Debian archive. 29002 29003 * David Miller for his direction via the steering committee, lots of 29004 SPARC work, improvements in jump.c and interfacing with the Linux 29005 kernel developers. 29006 29007 * Gary Miller ported GCC to Charles River Data Systems machines. 29008 29009 * Alfred Minarik for libstdc++ string and ios bug fixes, and turning 29010 the entire libstdc++ testsuite namespace-compatible. 29011 29012 * Mark Mitchell for his direction via the steering committee, 29013 mountains of C++ work, load/store hoisting out of loops, alias 29014 analysis improvements, ISO C `restrict' support, and serving as 29015 release manager for GCC 3.x. 29016 29017 * Alan Modra for various GNU/Linux bits and testing. 29018 29019 * Toon Moene for his direction via the steering committee, Fortran 29020 maintenance, and his ongoing work to make us make Fortran run fast. 29021 29022 * Jason Molenda for major help in the care and feeding of all the 29023 services on the gcc.gnu.org (formerly egcs.cygnus.com) 29024 machine--mail, web services, ftp services, etc etc. Doing all 29025 this work on scrap paper and the backs of envelopes would have 29026 been... difficult. 29027 29028 * Catherine Moore for fixing various ugly problems we have sent her 29029 way, including the haifa bug which was killing the Alpha & PowerPC 29030 Linux kernels. 29031 29032 * Mike Moreton for his various Java patches. 29033 29034 * David Mosberger-Tang for various Alpha improvements, and for the 29035 initial IA-64 port. 29036 29037 * Stephen Moshier contributed the floating point emulator that 29038 assists in cross-compilation and permits support for floating 29039 point numbers wider than 64 bits and for ISO C99 support. 29040 29041 * Bill Moyer for his behind the scenes work on various issues. 29042 29043 * Philippe De Muyter for his work on the m68k port. 29044 29045 * Joseph S. Myers for his work on the PDP-11 port, format checking 29046 and ISO C99 support, and continuous emphasis on (and contributions 29047 to) documentation. 29048 29049 * Nathan Myers for his work on libstdc++-v3: architecture and 29050 authorship through the first three snapshots, including 29051 implementation of locale infrastructure, string, shadow C headers, 29052 and the initial project documentation (DESIGN, CHECKLIST, and so 29053 forth). Later, more work on MT-safe string and shadow headers. 29054 29055 * Felix Natter for documentation on porting libstdc++. 29056 29057 * Nathanael Nerode for cleaning up the configuration/build process. 29058 29059 * NeXT, Inc. donated the front end that supports the Objective-C 29060 language. 29061 29062 * Hans-Peter Nilsson for the CRIS and MMIX ports, improvements to 29063 the search engine setup, various documentation fixes and other 29064 small fixes. 29065 29066 * Geoff Noer for his work on getting cygwin native builds working. 29067 29068 * Diego Novillo for his work on Tree SSA, OpenMP, SPEC performance 29069 tracking web pages and assorted fixes. 29070 29071 * David O'Brien for the FreeBSD/alpha, FreeBSD/AMD x86-64, 29072 FreeBSD/ARM, FreeBSD/PowerPC, and FreeBSD/SPARC64 ports and 29073 related infrastructure improvements. 29074 29075 * Alexandre Oliva for various build infrastructure improvements, 29076 scripts and amazing testing work, including keeping libtool issues 29077 sane and happy. 29078 29079 * Stefan Olsson for work on mt_alloc. 29080 29081 * Melissa O'Neill for various NeXT fixes. 29082 29083 * Rainer Orth for random MIPS work, including improvements to GCC's 29084 o32 ABI support, improvements to dejagnu's MIPS support, Java 29085 configuration clean-ups and porting work, etc. 29086 29087 * Hartmut Penner for work on the s390 port. 29088 29089 * Paul Petersen wrote the machine description for the Alliant FX/8. 29090 29091 * Alexandre Petit-Bianco for implementing much of the Java compiler 29092 and continued Java maintainership. 29093 29094 * Matthias Pfaller for major improvements to the NS32k port. 29095 29096 * Gerald Pfeifer for his direction via the steering committee, 29097 pointing out lots of problems we need to solve, maintenance of the 29098 web pages, and taking care of documentation maintenance in general. 29099 29100 * Andrew Pinski for processing bug reports by the dozen. 29101 29102 * Ovidiu Predescu for his work on the Objective-C front end and 29103 runtime libraries. 29104 29105 * Jerry Quinn for major performance improvements in C++ formatted 29106 I/O. 29107 29108 * Ken Raeburn for various improvements to checker, MIPS ports and 29109 various cleanups in the compiler. 29110 29111 * Rolf W. Rasmussen for hacking on AWT. 29112 29113 * David Reese of Sun Microsystems contributed to the Solaris on 29114 PowerPC port. 29115 29116 * Volker Reichelt for keeping up with the problem reports. 29117 29118 * Joern Rennecke for maintaining the sh port, loop, regmove & reload 29119 hacking. 29120 29121 * Loren J. Rittle for improvements to libstdc++-v3 including the 29122 FreeBSD port, threading fixes, thread-related configury changes, 29123 critical threading documentation, and solutions to really tricky 29124 I/O problems, as well as keeping GCC properly working on FreeBSD 29125 and continuous testing. 29126 29127 * Craig Rodrigues for processing tons of bug reports. 29128 29129 * Ola Ro"nnerup for work on mt_alloc. 29130 29131 * Gavin Romig-Koch for lots of behind the scenes MIPS work. 29132 29133 * David Ronis inspired and encouraged Craig to rewrite the G77 29134 documentation in texinfo format by contributing a first pass at a 29135 translation of the old `g77-0.5.16/f/DOC' file. 29136 29137 * Ken Rose for fixes to GCC's delay slot filling code. 29138 29139 * Paul Rubin wrote most of the preprocessor. 29140 29141 * Pe'tur Runo'lfsson for major performance improvements in C++ 29142 formatted I/O and large file support in C++ filebuf. 29143 29144 * Chip Salzenberg for libstdc++ patches and improvements to locales, 29145 traits, Makefiles, libio, libtool hackery, and "long long" support. 29146 29147 * Juha Sarlin for improvements to the H8 code generator. 29148 29149 * Greg Satz assisted in making GCC work on HP-UX for the 9000 series 29150 300. 29151 29152 * Roger Sayle for improvements to constant folding and GCC's RTL 29153 optimizers as well as for fixing numerous bugs. 29154 29155 * Bradley Schatz for his work on the GCJ FAQ. 29156 29157 * Peter Schauer wrote the code to allow debugging to work on the 29158 Alpha. 29159 29160 * William Schelter did most of the work on the Intel 80386 support. 29161 29162 * Tobias Schlu"ter for work on GNU Fortran. 29163 29164 * Bernd Schmidt for various code generation improvements and major 29165 work in the reload pass as well a serving as release manager for 29166 GCC 2.95.3. 29167 29168 * Peter Schmid for constant testing of libstdc++--especially 29169 application testing, going above and beyond what was requested for 29170 the release criteria--and libstdc++ header file tweaks. 29171 29172 * Jason Schroeder for jcf-dump patches. 29173 29174 * Andreas Schwab for his work on the m68k port. 29175 29176 * Lars Segerlund for work on GNU Fortran. 29177 29178 * Joel Sherrill for his direction via the steering committee, RTEMS 29179 contributions and RTEMS testing. 29180 29181 * Nathan Sidwell for many C++ fixes/improvements. 29182 29183 * Jeffrey Siegal for helping RMS with the original design of GCC, 29184 some code which handles the parse tree and RTL data structures, 29185 constant folding and help with the original VAX & m68k ports. 29186 29187 * Kenny Simpson for prompting libstdc++ fixes due to defect reports 29188 from the LWG (thereby keeping GCC in line with updates from the 29189 ISO). 29190 29191 * Franz Sirl for his ongoing work with making the PPC port stable 29192 for GNU/Linux. 29193 29194 * Andrey Slepuhin for assorted AIX hacking. 29195 29196 * Christopher Smith did the port for Convex machines. 29197 29198 * Danny Smith for his major efforts on the Mingw (and Cygwin) ports. 29199 29200 * Randy Smith finished the Sun FPA support. 29201 29202 * Scott Snyder for queue, iterator, istream, and string fixes and 29203 libstdc++ testsuite entries. Also for providing the patch to G77 29204 to add rudimentary support for `INTEGER*1', `INTEGER*2', and 29205 `LOGICAL*1'. 29206 29207 * Brad Spencer for contributions to the GLIBCPP_FORCE_NEW technique. 29208 29209 * Richard Stallman, for writing the original GCC and launching the 29210 GNU project. 29211 29212 * Jan Stein of the Chalmers Computer Society provided support for 29213 Genix, as well as part of the 32000 machine description. 29214 29215 * Nigel Stephens for various mips16 related fixes/improvements. 29216 29217 * Jonathan Stone wrote the machine description for the Pyramid 29218 computer. 29219 29220 * Graham Stott for various infrastructure improvements. 29221 29222 * John Stracke for his Java HTTP protocol fixes. 29223 29224 * Mike Stump for his Elxsi port, G++ contributions over the years 29225 and more recently his vxworks contributions 29226 29227 * Jeff Sturm for Java porting help, bug fixes, and encouragement. 29228 29229 * Shigeya Suzuki for this fixes for the bsdi platforms. 29230 29231 * Ian Lance Taylor for his mips16 work, general configury hacking, 29232 fixincludes, etc. 29233 29234 * Holger Teutsch provided the support for the Clipper CPU. 29235 29236 * Gary Thomas for his ongoing work to make the PPC work for 29237 GNU/Linux. 29238 29239 * Philipp Thomas for random bug fixes throughout the compiler 29240 29241 * Jason Thorpe for thread support in libstdc++ on NetBSD. 29242 29243 * Kresten Krab Thorup wrote the run time support for the Objective-C 29244 language and the fantastic Java bytecode interpreter. 29245 29246 * Michael Tiemann for random bug fixes, the first instruction 29247 scheduler, initial C++ support, function integration, NS32k, SPARC 29248 and M88k machine description work, delay slot scheduling. 29249 29250 * Andreas Tobler for his work porting libgcj to Darwin. 29251 29252 * Teemu Torma for thread safe exception handling support. 29253 29254 * Leonard Tower wrote parts of the parser, RTL generator, and RTL 29255 definitions, and of the VAX machine description. 29256 29257 * Tom Tromey for internationalization support and for his many Java 29258 contributions and libgcj maintainership. 29259 29260 * Lassi Tuura for improvements to config.guess to determine HP 29261 processor types. 29262 29263 * Petter Urkedal for libstdc++ CXXFLAGS, math, and algorithms fixes. 29264 29265 * Andy Vaught for the design and initial implementation of the GNU 29266 Fortran front end. 29267 29268 * Brent Verner for work with the libstdc++ cshadow files and their 29269 associated configure steps. 29270 29271 * Todd Vierling for contributions for NetBSD ports. 29272 29273 * Jonathan Wakely for contributing libstdc++ Doxygen notes and XHTML 29274 guidance. 29275 29276 * Dean Wakerley for converting the install documentation from HTML 29277 to texinfo in time for GCC 3.0. 29278 29279 * Krister Walfridsson for random bug fixes. 29280 29281 * Feng Wang for contributions to GNU Fortran. 29282 29283 * Stephen M. Webb for time and effort on making libstdc++ shadow 29284 files work with the tricky Solaris 8+ headers, and for pushing the 29285 build-time header tree. 29286 29287 * John Wehle for various improvements for the x86 code generator, 29288 related infrastructure improvements to help x86 code generation, 29289 value range propagation and other work, WE32k port. 29290 29291 * Ulrich Weigand for work on the s390 port. 29292 29293 * Zack Weinberg for major work on cpplib and various other bug fixes. 29294 29295 * Matt Welsh for help with Linux Threads support in GCJ. 29296 29297 * Urban Widmark for help fixing java.io. 29298 29299 * Mark Wielaard for new Java library code and his work integrating 29300 with Classpath. 29301 29302 * Dale Wiles helped port GCC to the Tahoe. 29303 29304 * Bob Wilson from Tensilica, Inc. for the Xtensa port. 29305 29306 * Jim Wilson for his direction via the steering committee, tackling 29307 hard problems in various places that nobody else wanted to work 29308 on, strength reduction and other loop optimizations. 29309 29310 * Paul Woegerer and Tal Agmon for the CRX port. 29311 29312 * Carlo Wood for various fixes. 29313 29314 * Tom Wood for work on the m88k port. 29315 29316 * Canqun Yang for work on GNU Fortran. 29317 29318 * Masanobu Yuhara of Fujitsu Laboratories implemented the machine 29319 description for the Tron architecture (specifically, the Gmicro). 29320 29321 * Kevin Zachmann helped port GCC to the Tahoe. 29322 29323 * Ayal Zaks for Swing Modulo Scheduling (SMS). 29324 29325 * Xiaoqiang Zhang for work on GNU Fortran. 29326 29327 * Gilles Zunino for help porting Java to Irix. 29328 29329 29330 The following people are recognized for their contributions to GNAT, 29331the Ada front end of GCC: 29332 * Bernard Banner 29333 29334 * Romain Berrendonner 29335 29336 * Geert Bosch 29337 29338 * Emmanuel Briot 29339 29340 * Joel Brobecker 29341 29342 * Ben Brosgol 29343 29344 * Vincent Celier 29345 29346 * Arnaud Charlet 29347 29348 * Chien Chieng 29349 29350 * Cyrille Comar 29351 29352 * Cyrille Crozes 29353 29354 * Robert Dewar 29355 29356 * Gary Dismukes 29357 29358 * Robert Duff 29359 29360 * Ed Falis 29361 29362 * Ramon Fernandez 29363 29364 * Sam Figueroa 29365 29366 * Vasiliy Fofanov 29367 29368 * Michael Friess 29369 29370 * Franco Gasperoni 29371 29372 * Ted Giering 29373 29374 * Matthew Gingell 29375 29376 * Laurent Guerby 29377 29378 * Jerome Guitton 29379 29380 * Olivier Hainque 29381 29382 * Jerome Hugues 29383 29384 * Hristian Kirtchev 29385 29386 * Jerome Lambourg 29387 29388 * Bruno Leclerc 29389 29390 * Albert Lee 29391 29392 * Sean McNeil 29393 29394 * Javier Miranda 29395 29396 * Laurent Nana 29397 29398 * Pascal Obry 29399 29400 * Dong-Ik Oh 29401 29402 * Laurent Pautet 29403 29404 * Brett Porter 29405 29406 * Thomas Quinot 29407 29408 * Nicolas Roche 29409 29410 * Pat Rogers 29411 29412 * Jose Ruiz 29413 29414 * Douglas Rupp 29415 29416 * Sergey Rybin 29417 29418 * Gail Schenker 29419 29420 * Ed Schonberg 29421 29422 * Nicolas Setton 29423 29424 * Samuel Tardieu 29425 29426 29427 The following people are recognized for their contributions of new 29428features, bug reports, testing and integration of classpath/libgcj for 29429GCC version 4.1: 29430 * Lillian Angel for `JTree' implementation and lots Free Swing 29431 additions and bugfixes. 29432 29433 * Wolfgang Baer for `GapContent' bugfixes. 29434 29435 * Anthony Balkissoon for `JList', Free Swing 1.5 updates and mouse 29436 event fixes, lots of Free Swing work including `JTable' editing. 29437 29438 * Stuart Ballard for RMI constant fixes. 29439 29440 * Goffredo Baroncelli for `HTTPURLConnection' fixes. 29441 29442 * Gary Benson for `MessageFormat' fixes. 29443 29444 * Daniel Bonniot for `Serialization' fixes. 29445 29446 * Chris Burdess for lots of gnu.xml and http protocol fixes, `StAX' 29447 and `DOM xml:id' support. 29448 29449 * Ka-Hing Cheung for `TreePath' and `TreeSelection' fixes. 29450 29451 * Archie Cobbs for build fixes, VM interface updates, 29452 `URLClassLoader' updates. 29453 29454 * Kelley Cook for build fixes. 29455 29456 * Martin Cordova for Suggestions for better `SocketTimeoutException'. 29457 29458 * David Daney for `BitSet' bugfixes, `HttpURLConnection' rewrite and 29459 improvements. 29460 29461 * Thomas Fitzsimmons for lots of upgrades to the gtk+ AWT and Cairo 29462 2D support. Lots of imageio framework additions, lots of AWT and 29463 Free Swing bugfixes. 29464 29465 * Jeroen Frijters for `ClassLoader' and nio cleanups, serialization 29466 fixes, better `Proxy' support, bugfixes and IKVM integration. 29467 29468 * Santiago Gala for `AccessControlContext' fixes. 29469 29470 * Nicolas Geoffray for `VMClassLoader' and `AccessController' 29471 improvements. 29472 29473 * David Gilbert for `basic' and `metal' icon and plaf support and 29474 lots of documenting, Lots of Free Swing and metal theme additions. 29475 `MetalIconFactory' implementation. 29476 29477 * Anthony Green for `MIDI' framework, `ALSA' and `DSSI' providers. 29478 29479 * Andrew Haley for `Serialization' and `URLClassLoader' fixes, gcj 29480 build speedups. 29481 29482 * Kim Ho for `JFileChooser' implementation. 29483 29484 * Andrew John Hughes for `Locale' and net fixes, URI RFC2986 29485 updates, `Serialization' fixes, `Properties' XML support and 29486 generic branch work, VMIntegration guide update. 29487 29488 * Bastiaan Huisman for `TimeZone' bugfixing. 29489 29490 * Andreas Jaeger for mprec updates. 29491 29492 * Paul Jenner for better `-Werror' support. 29493 29494 * Ito Kazumitsu for `NetworkInterface' implementation and updates. 29495 29496 * Roman Kennke for `BoxLayout', `GrayFilter' and `SplitPane', plus 29497 bugfixes all over. Lots of Free Swing work including styled text. 29498 29499 * Simon Kitching for `String' cleanups and optimization suggestions. 29500 29501 * Michael Koch for configuration fixes, `Locale' updates, bug and 29502 build fixes. 29503 29504 * Guilhem Lavaux for configuration, thread and channel fixes and 29505 Kaffe integration. JCL native `Pointer' updates. Logger bugfixes. 29506 29507 * David Lichteblau for JCL support library global/local reference 29508 cleanups. 29509 29510 * Aaron Luchko for JDWP updates and documentation fixes. 29511 29512 * Ziga Mahkovec for `Graphics2D' upgraded to Cairo 0.5 and new regex 29513 features. 29514 29515 * Sven de Marothy for BMP imageio support, CSS and `TextLayout' 29516 fixes. `GtkImage' rewrite, 2D, awt, free swing and date/time fixes 29517 and implementing the Qt4 peers. 29518 29519 * Casey Marshall for crypto algorithm fixes, `FileChannel' lock, 29520 `SystemLogger' and `FileHandler' rotate implementations, NIO 29521 `FileChannel.map' support, security and policy updates. 29522 29523 * Bryce McKinlay for RMI work. 29524 29525 * Audrius Meskauskas for lots of Free Corba, RMI and HTML work plus 29526 testing and documenting. 29527 29528 * Kalle Olavi Niemitalo for build fixes. 29529 29530 * Rainer Orth for build fixes. 29531 29532 * Andrew Overholt for `File' locking fixes. 29533 29534 * Ingo Proetel for `Image', `Logger' and `URLClassLoader' updates. 29535 29536 * Olga Rodimina for `MenuSelectionManager' implementation. 29537 29538 * Jan Roehrich for `BasicTreeUI' and `JTree' fixes. 29539 29540 * Julian Scheid for documentation updates and gjdoc support. 29541 29542 * Christian Schlichtherle for zip fixes and cleanups. 29543 29544 * Robert Schuster for documentation updates and beans fixes, 29545 `TreeNode' enumerations and `ActionCommand' and various fixes, XML 29546 and URL, AWT and Free Swing bugfixes. 29547 29548 * Keith Seitz for lots of JDWP work. 29549 29550 * Christian Thalinger for 64-bit cleanups, Configuration and VM 29551 interface fixes and `CACAO' integration, `fdlibm' updates. 29552 29553 * Gael Thomas for `VMClassLoader' boot packages support suggestions. 29554 29555 * Andreas Tobler for Darwin and Solaris testing and fixing, `Qt4' 29556 support for Darwin/OS X, `Graphics2D' support, `gtk+' updates. 29557 29558 * Dalibor Topic for better `DEBUG' support, build cleanups and Kaffe 29559 integration. `Qt4' build infrastructure, `SHA1PRNG' and 29560 `GdkPixbugDecoder' updates. 29561 29562 * Tom Tromey for Eclipse integration, generics work, lots of bugfixes 29563 and gcj integration including coordinating The Big Merge. 29564 29565 * Mark Wielaard for bugfixes, packaging and release management, 29566 `Clipboard' implementation, system call interrupts and network 29567 timeouts and `GdkPixpufDecoder' fixes. 29568 29569 29570 In addition to the above, all of which also contributed time and 29571energy in testing GCC, we would like to thank the following for their 29572contributions to testing: 29573 29574 * Michael Abd-El-Malek 29575 29576 * Thomas Arend 29577 29578 * Bonzo Armstrong 29579 29580 * Steven Ashe 29581 29582 * Chris Baldwin 29583 29584 * David Billinghurst 29585 29586 * Jim Blandy 29587 29588 * Stephane Bortzmeyer 29589 29590 * Horst von Brand 29591 29592 * Frank Braun 29593 29594 * Rodney Brown 29595 29596 * Sidney Cadot 29597 29598 * Bradford Castalia 29599 29600 * Jonathan Corbet 29601 29602 * Ralph Doncaster 29603 29604 * Richard Emberson 29605 29606 * Levente Farkas 29607 29608 * Graham Fawcett 29609 29610 * Mark Fernyhough 29611 29612 * Robert A. French 29613 29614 * Jo"rgen Freyh 29615 29616 * Mark K. Gardner 29617 29618 * Charles-Antoine Gauthier 29619 29620 * Yung Shing Gene 29621 29622 * David Gilbert 29623 29624 * Simon Gornall 29625 29626 * Fred Gray 29627 29628 * John Griffin 29629 29630 * Patrik Hagglund 29631 29632 * Phil Hargett 29633 29634 * Amancio Hasty 29635 29636 * Takafumi Hayashi 29637 29638 * Bryan W. Headley 29639 29640 * Kevin B. Hendricks 29641 29642 * Joep Jansen 29643 29644 * Christian Joensson 29645 29646 * Michel Kern 29647 29648 * David Kidd 29649 29650 * Tobias Kuipers 29651 29652 * Anand Krishnaswamy 29653 29654 * A. O. V. Le Blanc 29655 29656 * llewelly 29657 29658 * Damon Love 29659 29660 * Brad Lucier 29661 29662 * Matthias Klose 29663 29664 * Martin Knoblauch 29665 29666 * Rick Lutowski 29667 29668 * Jesse Macnish 29669 29670 * Stefan Morrell 29671 29672 * Anon A. Mous 29673 29674 * Matthias Mueller 29675 29676 * Pekka Nikander 29677 29678 * Rick Niles 29679 29680 * Jon Olson 29681 29682 * Magnus Persson 29683 29684 * Chris Pollard 29685 29686 * Richard Polton 29687 29688 * Derk Reefman 29689 29690 * David Rees 29691 29692 * Paul Reilly 29693 29694 * Tom Reilly 29695 29696 * Torsten Rueger 29697 29698 * Danny Sadinoff 29699 29700 * Marc Schifer 29701 29702 * Erik Schnetter 29703 29704 * Wayne K. Schroll 29705 29706 * David Schuler 29707 29708 * Vin Shelton 29709 29710 * Tim Souder 29711 29712 * Adam Sulmicki 29713 29714 * Bill Thorson 29715 29716 * George Talbot 29717 29718 * Pedro A. M. Vazquez 29719 29720 * Gregory Warnes 29721 29722 * Ian Watson 29723 29724 * David E. Young 29725 29726 * And many others 29727 29728 And finally we'd like to thank everyone who uses the compiler, submits 29729bug reports and generally reminds us why we're doing this work in the 29730first place. 29731 29732 29733File: gcc.info, Node: Option Index, Next: Keyword Index, Prev: Contributors, Up: Top 29734 29735Option Index 29736************ 29737 29738GCC's command line options are indexed here without any initial `-' or 29739`--'. Where an option has both positive and negative forms (such as 29740`-fOPTION' and `-fno-OPTION'), relevant entries in the manual are 29741indexed under the most appropriate form; it may sometimes be useful to 29742look up both forms. 29743 29744