|
|
1.1.1.5 ! root 1: .\" Copyright (c) 1991, 1992, 1993 Free Software Foundation -*-Text-*- 1.1 root 2: .\" See section COPYING for conditions for redistribution 1.1.1.5 ! root 3: .TH GCC 1 "30apr1993" "GNU Tools" "GNU Tools" 1.1 root 4: .de BP 5: .sp 6: .ti \-.2i 7: \(** 8: .. 9: .SH NAME 1.1.1.5 ! root 10: gcc, g++ \- GNU project C and C++ Compiler (v2.4) 1.1 root 11: .SH SYNOPSIS 12: .RB gcc " [" \c 13: .IR option " | " filename " ].\|.\|. 14: .br 15: .RB g++ " [" \c 16: .IR option " | " filename " ].\|.\|. 17: .SH WARNING 18: The information in this man page is an extract from the full 19: documentation of the GNU C compiler, and is limited to the meaning of 1.1.1.4 root 20: the options. This man page is not kept up to date except when 21: volunteers want to maintain it. 1.1 root 22: 1.1.1.4 root 23: For complete and current documentation, refer to the Info file `\|\c 1.1 root 24: .B gcc\c 25: \&\|' or the manual 26: .I 27: Using and Porting GNU CC (for version 2.0)\c 28: \&. Both are made from the Texinfo source file 29: .BR gcc.texinfo . 30: .SH DESCRIPTION 31: The C and C++ compilers are integrated. Both process input files 32: through one or more of four stages: preprocessing, compilation, 33: assembly, and linking. Source filename suffixes identify the source 34: language, but which name you use for the compiler governs default 35: assumptions: 36: .TP 37: .B gcc 38: assumes preprocessed (\c 39: .B .i\c 40: \&) files are C and assumes C style linking. 41: .TP 42: .B g++ 43: assumes preprocessed (\c 44: .B .i\c 45: \&) files are C++ and assumes C++ style linking. 46: .PP 47: Suffixes of source file names indicate the language and kind of 48: processing to be done: 49: 50: .ta \w'.cxx 'u 51: .B .c\c 52: \& C source; preprocess, compile, assemble 53: .br 54: .B .C\c 55: \& C++ source; preprocess, compile, assemble 56: .br 57: .B .cc\c 58: \& C++ source; preprocess, compile, assemble 59: .br 60: .B .cxx\c 61: \& C++ source; preprocess, compile, assemble 62: .br 63: .B .m\c 64: \& Objective-C source; preprocess, compile, assemble 65: .br 66: .B .i\c 1.1.1.4 root 67: \& preprocessed C; compile, assemble 68: .br 69: .B .ii\c 70: \& preprocessed C++; compile, assemble 1.1 root 71: .br 72: .B .s\c 73: \& Assembler source; assemble 74: .br 75: .B .S\c 76: \& Assembler source; preprocess, assemble 77: .br 78: .B .h\c 79: \& Preprocessor file; not usually named on command line 80: 81: .I ??\c 82: \& Other (unrecognized) files passed to linker. 83: .br 84: \& Common cases: 85: .br 86: .B .o\c 87: \& Object file 88: .br 89: .B .a\c 90: \& Archive file 91: 92: Linking is always the last stage unless you use one of the 93: .BR \-c , 94: .BR \-S , 95: or 96: .B \-E 97: options to avoid it (or unless compilation errors stop the whole 98: process). For the link stage, all 99: .B .o 100: files corresponding to source files, 101: .B \-l 102: libraries, unrecognized filenames (including named 103: .B .o 104: object files and 105: .B .a 106: archives) 107: are passed to the linker in command-line order. 108: 109: .SH OPTIONS 110: Options must be separate: `\|\c 111: .B \-dr\c 112: \&\|' is quite different from `\|\c 113: .B \-d \-r 114: \&\|'. 115: 116: Most `\|\c 117: .B \-f\c 118: \&\|' and `\|\c 119: .B \-W\c 120: \&\|' options have two contrary forms: 121: .BI \-f name 122: and 123: .BI \-fno\- name\c 124: \& (or 125: .BI \-W name 126: and 127: .BI \-Wno\- name\c 128: \&). Only the non-default forms are shown here. 129: 130: Here is a summary of all the options, grouped by type. Explanations are 131: in the following sections. 132: 133: .hy 0 134: .na 135: .TP 136: .B Overall Options 137: .br 138: \-c 139: \-S 140: \-E 141: .RI "\-o " file 142: \-pipe 143: \-v 144: .RI "\-x " language 145: 146: .TP 147: .B Language Options 148: \-ansi 149: \-fall\-virtual 150: \-fcond\-mismatch 151: \-fdollars\-in\-identifiers 152: \-fenum\-int\-equiv 153: \-fno\-asm 154: \-fno\-builtin 155: \-fno\-strict\-prototype 156: \-fsigned\-bitfields 157: \-fsigned\-char 158: \-fthis\-is\-variable 159: \-funsigned\-bitfields 160: \-funsigned\-char 161: \-fwritable\-strings 162: \-traditional 163: \-traditional\-cpp 164: \-trigraphs 165: 166: .TP 167: .B Warning Options 168: \-fsyntax\-only 169: \-pedantic 170: \-pedantic\-errors 171: \-w 172: \-W 173: \-Wall 174: \-Waggregate\-return 175: \-Wcast\-align 176: \-Wcast\-qual 1.1.1.5 ! root 177: \-Wchar\-subscript 1.1 root 178: \-Wcomment 179: \-Wconversion 180: \-Wenum\-clash 181: \-Werror 182: \-Wformat 183: .RI \-Wid\-clash\- len 184: \-Wimplicit 1.1.1.2 root 185: \-Winline 1.1 root 186: \-Wmissing\-prototypes 1.1.1.5 ! root 187: \-Wnested\-externs ! 188: \-Wno\-import 1.1.1.2 root 189: \-Wparentheses 1.1 root 190: \-Wpointer\-arith 1.1.1.5 ! root 191: \-Wredundant\-decls 1.1 root 192: \-Wreturn\-type 193: \-Wshadow 194: \-Wstrict\-prototypes 195: \-Wswitch 1.1.1.5 ! root 196: \-Wtemplate\-debugging 1.1 root 197: \-Wtraditional 198: \-Wtrigraphs 199: \-Wuninitialized 200: \-Wunused 201: \-Wwrite\-strings 202: 203: .TP 204: .B Debugging Options 205: \-a 206: .RI \-d letters 207: \-fpretend\-float 208: \-g 1.1.1.5 ! root 209: .RI \-g level ! 210: \-gcoff ! 211: \-gxcoff ! 212: \-gxcoff+ 1.1 root 213: \-gdwarf 1.1.1.5 ! root 214: \-gdwarf+ ! 215: \-gstabs ! 216: \-gstabs+ 1.1 root 217: \-ggdb 218: \-p 219: \-pg 220: \-save\-temps 1.1.1.5 ! root 221: \-print\-libgcc\-file\-name 1.1 root 222: 223: .TP 224: .B Optimization Options 225: \-fcaller\-saves 226: \-fcse\-follow\-jumps 1.1.1.5 ! root 227: \-fcse\-skip\-blocks 1.1 root 228: \-fdelayed\-branch 229: \-felide\-constructors 230: \-fexpensive\-optimizations 1.1.1.5 ! root 231: \-ffast-\math 1.1 root 232: \-ffloat\-store 233: \-fforce\-addr 234: \-fforce\-mem 235: \-finline\-functions 236: \-fkeep\-inline\-functions 237: \-fmemoize\-lookups 238: \-fno\-default\-inline 239: \-fno\-defer\-pop 240: \-fno\-function\-cse 1.1.1.5 ! root 241: \-fno\-inline ! 242: \-fno\-peephole 1.1 root 243: \-fomit\-frame\-pointer 244: \-frerun\-cse\-after\-loop 245: \-fschedule\-insns 246: \-fschedule\-insns2 247: \-fstrength\-reduce 248: \-fthread\-jumps 249: \-funroll\-all\-loops 250: \-funroll\-loops 251: \-O 252: \-O2 253: 254: .TP 255: .B Preprocessor Options 1.1.1.5 ! root 256: .RI \-A assertion 1.1 root 257: \-C 258: \-dD 259: \-dM 260: \-dN 261: .RI \-D macro [\|= defn \|] 262: \-E 263: \-H 1.1.1.5 ! root 264: .RI "\-idirafter " dir ! 265: .RI "\-include " file ! 266: .RI "\-imacros " file ! 267: .RI "\-iprefix " file ! 268: .RI "\-iwithprefix " dir 1.1 root 269: \-M 270: \-MD 271: \-MM 272: \-MMD 273: \-nostdinc 274: \-P 275: .RI \-U macro 276: \-undef 277: 278: .TP 1.1.1.5 ! root 279: .B Assembler Option ! 280: .RI \-Wa, option ! 281: ! 282: .TP 1.1 root 283: .B Linker Options 284: .RI \-l library 1.1.1.5 ! root 285: \-nostartfiles 1.1 root 286: \-nostdlib 287: \-static 1.1.1.5 ! root 288: \-shared ! 289: \-symbolic ! 290: .RI "\-Xlinker\ " option ! 291: .RI \-Wl, option ! 292: .RI "\-u " symbol 1.1 root 293: 294: .TP 295: .B Directory Options 296: .RI \-B prefix 297: .RI \-I dir 298: \-I\- 299: .RI \-L dir 300: 301: .TP 302: .B Target Options 303: .RI "\-b " machine 304: .RI "\-V " version 305: 306: .TP 1.1.1.5 ! root 307: .B Configuration Dependent Options 1.1 root 308: .I M680x0\ Options 309: .br 310: \-m68000 311: \-m68020 1.1.1.5 ! root 312: \-m68020\-40 ! 313: \-m68030 ! 314: \-m68040 1.1 root 315: \-m68881 316: \-mbitfield 317: \-mc68000 318: \-mc68020 319: \-mfpa 320: \-mnobitfield 321: \-mrtd 322: \-mshort 323: \-msoft\-float 324: 325: .I VAX Options 326: .br 327: \-mg 328: \-mgnu 329: \-munix 330: 331: .I SPARC Options 332: .br 1.1.1.5 ! root 333: \-mepilogue 1.1 root 334: \-mfpu 1.1.1.5 ! root 335: \-mhard\-float ! 336: \-mno\-fpu 1.1 root 337: \-mno\-epilogue 1.1.1.5 ! root 338: \-msoft\-float ! 339: \-msparclite ! 340: \-mv8 1.1 root 341: 342: .I Convex Options 343: .br 344: \-margcount 345: \-mc1 346: \-mc2 347: \-mnoargcount 348: 349: .I AMD29K Options 350: .br 351: \-m29000 352: \-m29050 353: \-mbw 354: \-mdw 355: \-mkernel\-registers 356: \-mlarge 357: \-mnbw 358: \-mnodw 359: \-msmall 360: \-mstack\-check 361: \-muser\-registers 362: 363: .I M88K Options 364: .br 1.1.1.5 ! root 365: \-m88000 ! 366: \-m88100 ! 367: \-m88110 1.1 root 368: \-mbig\-pic 369: \-mcheck\-zero\-division 370: \-mhandle\-large\-shift 371: \-midentify\-revision 372: \-mno\-check\-zero\-division 373: \-mno\-ocs\-debug\-info 374: \-mno\-ocs\-frame\-position 375: \-mno\-optimize\-arg\-area 1.1.1.5 ! root 376: \-mno\-seriazlize\-volatile 1.1 root 377: \-mno\-underscores 378: \-mocs\-debug\-info 379: \-mocs\-frame\-position 380: \-moptimize\-arg\-area 1.1.1.5 ! root 381: \-mserialize\-volatile 1.1 root 382: .RI \-mshort\-data\- num 383: \-msvr3 384: \-msvr4 385: \-mtrap\-large\-shift 386: \-muse\-div\-instruction 387: \-mversion\-03.00 388: \-mwarn\-passed\-structs 389: 390: .I RS6000 Options 391: .br 392: \-mfp\-in\-toc 393: \-mno\-fop\-in\-toc 394: 395: .I RT Options 396: .br 397: \-mcall\-lib\-mul 398: \-mfp\-arg\-in\-fpregs 399: \-mfp\-arg\-in\-gregs 400: \-mfull\-fp\-blocks 401: \-mhc\-struct\-return 402: \-min\-line\-mul 403: \-mminimum\-fp\-blocks 404: \-mnohc\-struct\-return 405: 406: .I MIPS Options 407: .br 408: \-mcpu=\fIcpu type\fP 409: \-mips2 410: \-mips3 411: \-mint64 412: \-mlong64 413: \-mlonglong128 414: \-mmips\-as 415: \-mgas 416: \-mrnames 417: \-mno\-rnames 418: \-mgpopt 419: \-mno\-gpopt 420: \-mstats 421: \-mno\-stats 422: \-mmemcpy 423: \-mno\-memcpy 424: \-mno\-mips\-tfile 425: \-mmips\-tfile 426: \-msoft\-float 427: \-mhard\-float 428: \-mabicalls 429: \-mno\-abicalls 430: \-mhalf\-pic 431: \-mno\-half\-pic 432: \-G \fInum\fP 1.1.1.5 ! root 433: \-nocpp 1.1 root 434: 1.1.1.2 root 435: .I i386 Options 436: .br 437: \-m486 1.1.1.5 ! root 438: \-mno\-486 ! 439: \-msoft\-float ! 440: \-mno\-fp\-ret\-in\-387 ! 441: ! 442: .I HPPA Options ! 443: .br ! 444: \-mpa\-risc\-1\-0 ! 445: \-mpa\-risc\-1\-1 ! 446: \-mkernel ! 447: \-mshared\-libs ! 448: \-mno\-shared\-libs ! 449: \-mlong\-calls ! 450: \-mdisable\-fpregs ! 451: \-mdisable\-indexing ! 452: \-mtrailing\-colon ! 453: ! 454: .I i960 Options ! 455: .br ! 456: \-m\fIcpu-type\fP ! 457: \-mnumerics 1.1.1.2 root 458: \-msoft\-float 1.1.1.5 ! root 459: \-mleaf\-procedures ! 460: \-mno\-leaf\-procedures ! 461: \-mtail\-call ! 462: \-mno\-tail\-call ! 463: \-mcomplex\-addr ! 464: \-mno\-complex\-addr ! 465: \-mcode\-align ! 466: \-mno\-code\-align ! 467: \-mic\-compat ! 468: \-mic2.0\-compat ! 469: \-mic3.0\-compat ! 470: \-masm\-compat ! 471: \-mintel\-asm ! 472: \-mstrict\-align ! 473: \-mno\-strict\-align ! 474: \-mold\-align ! 475: \-mno\-old\-align ! 476: ! 477: .I DEC Alpha Options ! 478: .br ! 479: \-mfp\-regs ! 480: \-mno\-fp\-regs ! 481: \-mno\-soft\-float ! 482: \-msoft\-float ! 483: ! 484: .I System V Options ! 485: .br ! 486: \-G ! 487: \-Qy ! 488: \-Qn ! 489: .RI \-YP, paths ! 490: .RI \-Ym, dir 1.1.1.2 root 491: 1.1 root 492: .TP 493: .B Code Generation Options 494: .RI \-fcall\-saved\- reg 495: .RI \-fcall\-used\- reg 496: .RI \-ffixed\- reg 1.1.1.5 ! root 497: \-finhibit\-size\-directive 1.1 root 498: \-fnonnull\-objects 1.1.1.5 ! root 499: \-fno\-common ! 500: \-fno\-ident ! 501: \-fno\-gnu\-linker 1.1 root 502: \-fpcc\-struct\-return 503: \-fpic 504: \-fPIC 1.1.1.5 ! root 505: \-freg\-struct\-returno 1.1 root 506: \-fshared\-data 507: \-fshort\-enums 508: \-fshort\-double 509: \-fvolatile 1.1.1.5 ! root 510: \-fvolatile\-global ! 511: \-fverbose\-asm 1.1 root 512: .ad b 513: .hy 1 514: 515: .SH OVERALL OPTIONS 516: .TP 517: .BI "\-x " "language" 518: Specify explicitly the 519: .I language\c 520: \& for the following input files (rather than choosing a default based 521: on the file name suffix) . This option applies to all following input 522: files until the next `\|\c 523: .B \-x\c 524: \&\|' option. Possible values of \c 525: .I language\c 526: \& are 527: `\|\c 528: .B c\c 529: \&\|', `\|\c 530: .B objective\-c\c 531: \&\|', `\|\c 532: .B c\-header\c 533: \&\|', `\|\c 534: .B c++\c 535: \&\|', 536: `\|\c 537: .B cpp\-output\c 538: \&\|', `\|\c 539: .B assembler\c 540: \&\|', and `\|\c 541: .B assembler\-with\-cpp\c 542: \&\|'. 543: .TP 544: .B \-x none 545: Turn off any specification of a language, so that subsequent files are 546: handled according to their file name suffixes (as they are if `\|\c 547: .B \-x\c 548: \&\|' 549: has not been used at all). 550: .PP 551: 552: If you want only some of the four stages (preprocess, compile, 553: assemble, link), you can use 554: `\|\c 555: .B \-x\c 556: \&\|' (or filename suffixes) to tell \c 557: .B gcc\c 558: \& where to start, and 559: one of the options `\|\c 560: .B \-c\c 561: \&\|', `\|\c 562: .B \-S\c 563: \&\|', or `\|\c 564: .B \-E\c 565: \&\|' to say where 566: \c 567: .B gcc\c 568: \& is to stop. Note that some combinations (for example, 569: `\|\c 570: .B \-x cpp\-output \-E\c 571: \&\|') instruct \c 572: .B gcc\c 573: \& to do nothing at all. 574: .TP 575: .B \-c 576: Compile or assemble the source files, but do not link. The compiler 577: output is an object file corresponding to each source file. 578: 579: By default, GCC makes the object file name for a source file by replacing 580: the suffix `\|\c 581: .B .c\c 582: \&\|', `\|\c 583: .B .i\c 584: \&\|', `\|\c 585: .B .s\c 586: \&\|', etc., with `\|\c 587: .B .o\c 588: \&\|'. Use 589: .B \-o\c 590: \& to select another name. 591: 592: GCC ignores any unrecognized input files (those that do not require 593: compilation or assembly) with the 594: .B \-c 595: option. 596: .TP 597: .B \-S 598: Stop after the stage of compilation proper; do not assemble. The output 599: is an assembler code file for each non-assembler input 600: file specified. 601: 602: By default, GCC makes the assembler file name for a source file by 603: replacing the suffix `\|\c 604: .B .c\c 605: \&\|', `\|\c 606: .B .i\c 607: \&\|', etc., with `\|\c 608: .B .s\c 609: \&\|'. Use 610: .B \-o\c 611: \& to select another name. 612: 613: 614: GCC ignores any input files that don't require compilation. 615: .TP 616: .B \-E 617: Stop after the preprocessing stage; do not run the compiler proper. The 618: output is preprocessed source code, which is sent to the 619: standard output. 620: 621: GCC ignores input files which don't require preprocessing. 622: .TP 623: .BI "\-o " file\c 624: \& 625: Place output in file \c 626: .I file\c 627: \&. This applies regardless to whatever 628: sort of output GCC is producing, whether it be an executable file, 629: an object file, an assembler file or preprocessed C code. 630: 631: Since only one output file can be specified, it does not make sense to 632: use `\|\c 633: .B \-o\c 634: \&\|' when compiling more than one input file, unless you are 635: producing an executable file as output. 636: 637: If you do not specify `\|\c 638: .B \-o\c 639: \&\|', the default is to put an executable file 640: in `\|\c 641: .B a.out\c 642: \&\|', the object file for `\|\c 643: .B \c 644: .I source\c 645: \&.\c 646: .I suffix\c 647: \&\c 648: \&\|' in 649: `\|\c 650: .B \c 651: .I source\c 652: \&.o\c 653: \&\|', its assembler file in `\|\c 654: .B \c 655: .I source\c 656: \&.s\c 657: \&\|', and 658: all preprocessed C source on standard output. 659: .TP 660: .B \-v 661: Print (on standard error output) the commands executed to run the stages 662: of compilation. Also print the version number of the compiler driver 663: program and of the preprocessor and the compiler proper. 664: .TP 665: .B \-pipe 666: Use pipes rather than temporary files for communication between the 667: various stages of compilation. This fails to work on some systems where 668: the assembler cannot read from a pipe; but the GNU assembler has 669: no trouble. 670: .PP 671: 672: .SH LANGUAGE OPTIONS 673: The following options control the dialect of C that the compiler 674: accepts: 675: .TP 676: .B \-ansi 677: Support all ANSI standard C programs. 678: 679: This turns off certain features of GNU C that are incompatible with 680: ANSI C, such as the \c 681: .B asm\c 682: \&, \c 683: .B inline\c 684: \& and \c 685: .B typeof\c 686: \& 687: keywords, and predefined macros such as \c 688: .B unix\c 689: \& and \c 690: .B vax\c 691: \& 692: that identify the type of system you are using. It also enables the 1.1.1.5 ! root 693: undesirable and rarely used ANSI trigraph feature, and disallows `\|\c 1.1 root 694: .B $\c 695: \&\|' as part of identifiers. 696: 697: The alternate keywords \c 698: .B __asm__\c 699: \&, \c 700: .B __extension__\c 701: \&, 702: \c 703: .B __inline__\c 704: \& and \c 705: .B __typeof__\c 706: \& continue to work despite 707: `\|\c 708: .B \-ansi\c 709: \&\|'. You would not want to use them in an ANSI C program, of 710: course, but it is useful to put them in header files that might be included 711: in compilations done with `\|\c 712: .B \-ansi\c 713: \&\|'. Alternate predefined macros 714: such as \c 715: .B __unix__\c 716: \& and \c 717: .B __vax__\c 718: \& are also available, with or 719: without `\|\c 720: .B \-ansi\c 721: \&\|'. 722: 723: The `\|\c 724: .B \-ansi\c 725: \&\|' option does not cause non-ANSI programs to be 726: rejected gratuitously. For that, `\|\c 727: .B \-pedantic\c 728: \&\|' is required in 729: addition to `\|\c 730: .B \-ansi\c 731: \&\|'. 732: 733: The preprocessor predefines a macro \c 734: .B __STRICT_ANSI__\c 735: \& when you use the `\|\c 736: .B \-ansi\c 737: \&\|' 738: option. Some header files may notice this macro and refrain 739: from declaring certain functions or defining certain macros that the 740: ANSI standard doesn't call for; this is to avoid interfering with any 741: programs that might use these names for other things. 742: .TP 743: .B \-fno\-asm 744: Do not recognize \c 745: .B asm\c 746: \&, \c 747: .B inline\c 748: \& or \c 749: .B typeof\c 750: \& as a 751: keyword. These words may then be used as identifiers. You can 752: use \c 753: .B __asm__\c 754: \&, \c 755: .B __inline__\c 756: \& and \c 757: .B __typeof__\c 758: \& instead. 759: `\|\c 760: .B \-ansi\c 761: \&\|' implies `\|\c 762: .B \-fno\-asm\c 763: \&\|'. 764: .TP 765: .B \-fno\-builtin 1.1.1.5 ! root 766: Don't recognize built-in functions that do not begin with two leading ! 767: underscores. Currently, the functions affected include \c ! 768: .B _exit\c ! 769: \&, ! 770: \c ! 771: .B abort\c ! 772: \&, \c ! 773: .B abs\c ! 774: \&, \c 1.1 root 775: .B alloca\c 1.1.1.5 ! root 776: \&, \c ! 777: .B cos\c ! 778: \&, \c ! 779: .B exit\c ! 780: \&, ! 781: \c ! 782: .B fabs\c ! 783: \&, \c ! 784: .B labs\c ! 785: \&, \c ! 786: .B memcmp\c ! 787: \&, \c ! 788: .B memcpy\c ! 789: \&, \c ! 790: .B sin\c ! 791: \&, ! 792: \c ! 793: .B sqrt\c ! 794: \&, \c ! 795: .B strcmp\c ! 796: \&, \c ! 797: .B strcpy\c ! 798: \&, and \c ! 799: .B strlen\c 1.1 root 800: \&. 1.1.1.5 ! root 801: ! 802: The `\|\c ! 803: .B \-ansi\c ! 804: \&\|' option prevents \c ! 805: .B alloca\c ! 806: \& and \c ! 807: .B _exit\c ! 808: \& from ! 809: being builtin functions. 1.1 root 810: .TP 811: .B \-fno\-strict\-prototype 1.1.1.5 ! root 812: Treat a function declaration with no arguments, such as `\|\c ! 813: .B int foo ! 814: ();\c ! 815: \&\|', as C would treat it\(em\&as saying nothing about the number of ! 816: arguments or their types (C++ only). Normally, such a declaration in ! 817: C++ means that the function \c 1.1 root 818: .B foo\c 1.1.1.5 ! root 819: \& takes no arguments. 1.1 root 820: .TP 821: .B \-trigraphs 822: Support ANSI C trigraphs. The `\|\c 823: .B \-ansi\c 824: \&\|' option implies `\|\c 825: .B \-trigraphs\c 826: \&\|'. 827: .TP 828: .B \-traditional 829: Attempt to support some aspects of traditional C compilers. 1.1.1.3 root 830: For details, see the GNU C Manual; the duplicate list here 831: has been deleted so that we won't get complaints when it 832: is out of date. 1.1 root 833: 1.1.1.3 root 834: But one note about C++ programs only (not C). `\|\c 1.1 root 835: .B \-traditional\c 1.1.1.3 root 836: \&\|' has one additional effect for C++: assignment to 1.1 root 837: .B this 838: is permitted. This is the same as the effect of `\|\c 839: .B \-fthis\-is\-variable\c 840: \&\|'. 841: .TP 842: .B \-traditional\-cpp 843: Attempt to support some aspects of traditional C preprocessors. 844: This includes the items that specifically mention the preprocessor above, 845: but none of the other effects of `\|\c 846: .B \-traditional\c 847: \&\|'. 848: .TP 849: .B \-fdollars\-in\-identifiers 850: Permit the use of `\|\c 851: .B $\c 1.1.1.5 ! root 852: \&\|' in identifiers (C++ only). You can also use ! 853: `\|\c ! 854: .B \-fno\-dollars\-in\-identifiers\c ! 855: \&\|' to explicitly prohibit use of ! 856: `\|\c 1.1 root 857: .B $\c 1.1.1.5 ! root 858: \&\|'. (GNU C++ allows `\|\c 1.1 root 859: .B $\c 1.1.1.5 ! root 860: \&\|' by default on some target systems ! 861: but not others.) 1.1 root 862: .TP 863: .B \-fenum\-int\-equiv 1.1.1.5 ! root 864: Permit implicit conversion of \c 1.1 root 865: .B int\c 1.1.1.5 ! root 866: \& to enumeration types (C++ ! 867: only). Normally GNU C++ allows conversion of \c ! 868: .B enum\c ! 869: \& to \c ! 870: .B int\c ! 871: \&, ! 872: but not the other way around. 1.1 root 873: .TP 874: .B \-fall\-virtual 1.1.1.5 ! root 875: Treat all possible member functions as virtual, implicitly. All ! 876: member functions (except for constructor functions and ! 877: .B new ! 878: or ! 879: .B delete ! 880: member operators) are treated as virtual functions of the class where ! 881: they appear. ! 882: ! 883: This does not mean that all calls to these member functions will be ! 884: made through the internal table of virtual functions. Under some ! 885: circumstances, the compiler can determine that a call to a given ! 886: virtual function can be made directly; in these cases the calls are ! 887: direct in any case. 1.1 root 888: .TP 889: .B \-fcond\-mismatch 890: Allow conditional expressions with mismatched types in the second and 891: third arguments. The value of such an expression is void. 892: .TP 893: .B \-fthis\-is\-variable 1.1.1.5 ! root 894: Permit assignment to \c 1.1 root 895: .B this\c 1.1.1.5 ! root 896: \& (C++ only). The incorporation of ! 897: user-defined free store management into C++ has made assignment to ! 898: `\|\c 1.1 root 899: .B this\c 1.1.1.5 ! root 900: \&\|' an anachronism. Therefore, by default it is invalid to ! 901: assign to \c 1.1 root 902: .B this\c 1.1.1.5 ! root 903: \& within a class member function. However, for ! 904: backwards compatibility, you can make it valid with ! 905: `\|\c ! 906: .B \-fthis-is-variable\c 1.1 root 907: \&\|'. 908: .TP 909: .B \-funsigned\-char 910: Let the type \c 911: .B char\c 912: \& be unsigned, like \c 913: .B unsigned char\c 914: \&. 915: 916: Each kind of machine has a default for what \c 917: .B char\c 918: \& should 919: be. It is either like \c 920: .B unsigned char\c 921: \& by default or like 922: \c 923: .B signed char\c 924: \& by default. 925: 926: Ideally, a portable program should always use \c 927: .B signed char\c 928: \& or 929: \c 930: .B unsigned char\c 931: \& when it depends on the signedness of an object. 932: But many programs have been written to use plain \c 933: .B char\c 934: \& and 935: expect it to be signed, or expect it to be unsigned, depending on the 936: machines they were written for. This option, and its inverse, let you 937: make such a program work with the opposite default. 938: 939: The type \c 940: .B char\c 941: \& is always a distinct type from each of 942: \c 943: .B signed char\c 944: \& and \c 945: .B unsigned char\c 946: \&, even though its behavior 947: is always just like one of those two. 948: 949: .TP 950: .B \-fsigned\-char 951: Let the type \c 952: .B char\c 953: \& be signed, like \c 954: .B signed char\c 955: \&. 956: 957: Note that this is equivalent to `\|\c 958: .B \-fno\-unsigned\-char\c 959: \&\|', which is 960: the negative form of `\|\c 961: .B \-funsigned\-char\c 962: \&\|'. Likewise, 963: `\|\c 964: .B \-fno\-signed\-char\c 965: \&\|' is equivalent to `\|\c 966: .B \-funsigned\-char\c 967: \&\|'. 968: .TP 969: .B \-fsigned\-bitfields 970: .TP 971: .B \-funsigned\-bitfields 972: .TP 973: .B \-fno\-signed\-bitfields 974: .TP 975: .B \-fno\-unsigned\-bitfields 976: These options control whether a bitfield is 977: signed or unsigned, when declared with no explicit `\|\c 978: .B signed\c 979: \&\|' or `\|\c 980: .B unsigned\c 981: \&\|' qualifier. By default, such a bitfield is 982: signed, because this is consistent: the basic integer types such as 983: \c 984: .B int\c 985: \& are signed types. 986: 987: However, when you specify `\|\c 988: .B \-traditional\c 989: \&\|', bitfields are all unsigned 990: no matter what. 991: .TP 992: .B \-fwritable\-strings 993: Store string constants in the writable data segment and don't uniquize 994: them. This is for compatibility with old programs which assume they 995: can write into string constants. `\|\c 996: .B \-traditional\c 997: \&\|' also has this 998: effect. 999: 1000: Writing into string constants is a very bad idea; ``constants'' should 1001: be constant. 1002: .PP 1003: 1004: .SH PREPROCESSOR OPTIONS 1005: These options control the C preprocessor, which is run on each C source 1006: file before actual compilation. 1007: 1008: If you use the `\|\c 1009: .B \-E\c 1010: \&\|' option, GCC does nothing except preprocessing. 1011: Some of these options make sense only together with `\|\c 1012: .B \-E\c 1013: \&\|' because 1014: they cause the preprocessor output to be unsuitable for actual 1015: compilation. 1016: .TP 1.1.1.5 ! root 1017: .BI "\-include " "file" ! 1018: Process \c ! 1019: .I file\c ! 1020: \& as input before processing the regular input file. ! 1021: In effect, the contents of \c ! 1022: .I file\c ! 1023: \& are compiled first. Any `\|\c ! 1024: .B \-D\c ! 1025: \&\|' ! 1026: and `\|\c ! 1027: .B \-U\c ! 1028: \&\|' options on the command line are always processed before ! 1029: `\|\c ! 1030: .B \-include \c ! 1031: .I file\c ! 1032: \&\c ! 1033: \&\|', regardless of the order in which they are ! 1034: written. All the `\|\c ! 1035: .B \-include\c ! 1036: \&\|' and `\|\c ! 1037: .B \-imacros\c ! 1038: \&\|' options are ! 1039: processed in the order in which they are written. ! 1040: .TP ! 1041: .BI "\-imacros " file 1.1 root 1042: Process \c 1043: .I file\c 1044: \& as input, discarding the resulting output, before 1045: processing the regular input file. Because the output generated from 1046: \c 1047: .I file\c 1048: \& is discarded, the only effect of `\|\c 1.1.1.5 ! root 1049: .B \-imacros \c 1.1 root 1050: .I file\c 1051: \&\c 1052: \&\|' is to 1053: make the macros defined in \c 1054: .I file\c 1055: \& available for use in the main 1056: input. The preprocessor evaluates any `\|\c 1057: .B \-D\c 1058: \&\|' and `\|\c 1059: .B \-U\c 1060: \&\|' options 1061: on the command line before processing `\|\c 1.1.1.5 ! root 1062: .B \-imacros\c 1.1 root 1063: .I file\c 1.1.1.5 ! root 1064: \&\|', regardless of the order in ! 1065: which they are written. All the `\|\c ! 1066: .B \-include\c ! 1067: \&\|' and `\|\c ! 1068: .B \-imacros\c ! 1069: \&\|' ! 1070: options are processed in the order in which they are written. ! 1071: .TP ! 1072: .BI "-idirafter " "dir"\c ! 1073: \& ! 1074: Add the directory \c ! 1075: .I dir\c ! 1076: \& to the second include path. The directories ! 1077: on the second include path are searched when a header file is not found ! 1078: in any of the directories in the main include path (the one that ! 1079: `\|\c ! 1080: .B \-I\c ! 1081: \&\|' adds to). ! 1082: .TP ! 1083: .BI "-iprefix " "prefix"\c ! 1084: \& ! 1085: Specify \c ! 1086: .I prefix\c ! 1087: \& as the prefix for subsequent `\|\c ! 1088: .B \-iwithprefix\c ! 1089: \&\|' ! 1090: options. ! 1091: .TP ! 1092: .BI "-iwithprefix " "dir"\c ! 1093: \& ! 1094: Add a directory to the second include path. The directory's name is ! 1095: made by concatenating \c ! 1096: .I prefix\c ! 1097: \& and \c ! 1098: .I dir\c ! 1099: \&, where \c ! 1100: .I prefix\c ! 1101: \& ! 1102: was specified previously with `\|\c ! 1103: .B \-iprefix\c ! 1104: \&\|'. 1.1 root 1105: .TP 1106: .B \-nostdinc 1107: Do not search the standard system directories for header files. Only 1108: the directories you have specified with `\|\c 1109: .B \-I\c 1110: \&\|' options (and the 1111: current directory, if appropriate) are searched. 1112: 1113: By using both `\|\c 1114: .B \-nostdinc\c 1115: \&\|' and `\|\c 1116: .B \-I\-\c 1117: \&\|', you can limit the include-file search file to only those 1118: directories you specify explicitly. 1119: .TP 1.1.1.5 ! root 1120: .B \-nostdinc++ ! 1121: Do not search for header files in the C++-specific standard directories, ! 1122: but do still search the other standard directories. ! 1123: (This option is used when building `\|\c ! 1124: .B libg++\c ! 1125: \&\|'.) ! 1126: .TP 1.1 root 1127: .B \-undef 1128: Do not predefine any nonstandard macros. (Including architecture flags). 1129: .TP 1130: .B \-E 1131: Run only the C preprocessor. Preprocess all the C source files 1132: specified and output the results to standard output or to the 1133: specified output file. 1134: .TP 1135: .B \-C 1136: Tell the preprocessor not to discard comments. Used with the 1137: `\|\c 1138: .B \-E\c 1139: \&\|' option. 1140: .TP 1141: .B \-P 1142: Tell the preprocessor not to generate `\|\c 1143: .B #line\c 1144: \&\|' commands. 1145: Used with the `\|\c 1146: .B \-E\c 1147: \&\|' option. 1148: .TP 1149: .B \-M 1150: Tell the preprocessor to output a rule suitable for \c 1151: .B make\c 1152: \& 1153: describing the dependencies of each object file. For each source file, 1154: the preprocessor outputs one \c 1155: .B make\c 1156: \&-rule whose target is the object 1157: file name for that source file and whose dependencies are all the files 1158: `\|\c 1159: .B #include\c 1160: \&\|'d in it. This rule may be a single line or may be 1161: continued with `\|\c 1162: .B \e\c 1163: \&\|'-newline if it is long. The list of rules is 1164: printed on standard output instead of the preprocessed C program. 1165: 1166: `\|\c 1167: .B \-M\c 1168: \&\|' implies `\|\c 1169: .B \-E\c 1170: \&\|'. 1171: .TP 1172: .B \-MM 1173: Like `\|\c 1174: .B \-M\c 1175: \&\|' but the output mentions only the user header files 1176: included with `\|\c 1177: .B #include "\c 1178: .I file\c 1179: \&"\c 1180: \&\|'. System header files 1181: included with `\|\c 1182: .B #include <\c 1183: .I file\c 1184: \&>\c 1185: \&\|' are omitted. 1186: .TP 1187: .B \-MD 1188: Like `\|\c 1189: .B \-M\c 1190: \&\|' but the dependency information is written to files with 1191: names made by replacing `\|\c 1.1.1.5 ! root 1192: .B .o\c 1.1 root 1193: \&\|' with `\|\c 1194: .B .d\c 1195: \&\|' at the end of the 1.1.1.5 ! root 1196: output file names. This is in addition to compiling the file as 1.1 root 1197: specified\(em\&`\|\c 1198: .B \-MD\c 1199: \&\|' does not inhibit ordinary compilation the way 1200: `\|\c 1201: .B \-M\c 1202: \&\|' does. 1203: 1204: The Mach utility `\|\c 1205: .B md\c 1206: \&\|' can be used to merge the `\|\c 1207: .B .d\c 1208: \&\|' files 1209: into a single dependency file suitable for using with the `\|\c 1210: .B make\c 1211: \&\|' 1212: command. 1213: .TP 1214: .B \-MMD 1215: Like `\|\c 1216: .B \-MD\c 1217: \&\|' except mention only user header files, not system 1218: header files. 1219: .TP 1220: .B \-H 1221: Print the name of each header file used, in addition to other normal 1222: activities. 1223: .TP 1.1.1.5 ! root 1224: .BI "-A" "question" ( answer ) ! 1225: Assert the answer ! 1226: .I answer ! 1227: for ! 1228: .I question\c ! 1229: \&, in case it is tested ! 1230: with a preprocessor conditional such as `\|\c ! 1231: .BI "#if #" question ( answer )\c ! 1232: \&\|'. `\|\c ! 1233: .B \-A\-\c ! 1234: \&\|' disables the standard ! 1235: assertions that normally describe the target machine. ! 1236: .TP ! 1237: .BI "-A" "question"\c ! 1238: \&(\c ! 1239: .I answer\c ! 1240: \&) ! 1241: Assert the answer \c ! 1242: .I answer\c ! 1243: \& for \c ! 1244: .I question\c ! 1245: \&, in case it is tested ! 1246: with a preprocessor conditional such as `\|\c ! 1247: .B #if ! 1248: #\c ! 1249: .I question\c ! 1250: \&(\c ! 1251: .I answer\c ! 1252: \&)\c ! 1253: \&\|'. `\|\c ! 1254: .B \-A-\c ! 1255: \&\|' disables the standard ! 1256: assertions that normally describe the target machine. ! 1257: .TP 1.1 root 1258: .BI \-D macro 1259: Define macro \c 1260: .I macro\c 1261: \& with the string `\|\c 1262: .B 1\c 1263: \&\|' as its definition. 1264: .TP 1265: .BI \-D macro = defn 1266: Define macro \c 1267: .I macro\c 1268: \& as \c 1269: .I defn\c 1270: \&. All instances of `\|\c 1271: .B \-D\c 1272: \&\|' on 1273: the command line are processed before any `\|\c 1274: .B \-U\c 1275: \&\|' options. 1276: .TP 1277: .BI \-U macro 1278: Undefine macro \c 1279: .I macro\c 1280: \&. `\|\c 1281: .B \-U\c 1282: \&\|' options are evaluated after all `\|\c 1283: .B \-D\c 1284: \&\|' options, but before any `\|\c 1.1.1.5 ! root 1285: .B \-include\c ! 1286: \&\|' and `\|\c ! 1287: .B \-imacros\c 1.1 root 1288: \&\|' options. 1289: .TP 1290: .B \-dM 1291: Tell the preprocessor to output only a list of the macro definitions 1292: that are in effect at the end of preprocessing. Used with the `\|\c 1293: .B \-E\c 1294: \&\|' 1295: option. 1296: .TP 1297: .B \-dD 1.1.1.5 ! root 1298: Tell the preprocessor to pass all macro definitions into the output, in 1.1 root 1299: their proper sequence in the rest of the output. 1300: .TP 1301: .B \-dN 1302: Like `\|\c 1303: .B \-dD\c 1304: \&\|' except that the macro arguments and contents are omitted. 1305: Only `\|\c 1306: .B #define \c 1307: .I name\c 1308: \&\c 1309: \&\|' is included in the output. 1310: .PP 1311: 1.1.1.5 ! root 1312: .SH ASSEMBLER OPTION ! 1313: .TP ! 1314: .BI "-Wa," "option"\c ! 1315: \& ! 1316: Pass \c ! 1317: .I option\c ! 1318: \& as an option to the assembler. If \c ! 1319: .I option\c ! 1320: \& ! 1321: contains commas, it is split into multiple options at the commas. ! 1322: .PP ! 1323: 1.1 root 1324: .SH LINKER OPTIONS 1325: These options come into play when the compiler links object files into 1326: an executable output file. They are meaningless if the compiler is 1327: not doing a link step. 1328: .TP 1329: .I object-file-name 1330: A file name that does not end in a special recognized suffix is 1331: considered to name an object file or library. (Object files are 1332: distinguished from libraries by the linker according to the file 1333: contents.) If GCC does a link step, these object files are used as input 1334: to the linker. 1335: .TP 1336: .BI \-l library\c 1337: \& 1338: Use the library named \c 1339: .I library\c 1340: \& when linking. 1341: 1342: The linker searches a standard list of directories for the library, 1343: which is actually a file named `\|\c 1344: .B lib\c 1345: .I library\c 1346: \&.a\c 1347: \&\|'. The linker 1348: then uses this file as if it had been specified precisely by name. 1349: 1350: The directories searched include several standard system directories 1351: plus any that you specify with `\|\c 1352: .B \-L\c 1353: \&\|'. 1354: 1355: Normally the files found this way are library files\(em\&archive files 1356: whose members are object files. The linker handles an archive file by 1357: scanning through it for members which define symbols that have so far 1358: been referenced but not defined. However, if the linker finds an 1359: ordinary object file rather than a library, the object file is linked 1360: in the usual fashion. The only difference between using an `\|\c 1361: .B \-l\c 1362: \&\|' option and specifying a file 1363: name is that `\|\c 1364: .B \-l\c 1365: \&\|' surrounds 1366: .I library 1367: with `\|\c 1368: .B lib\c 1369: \&\|' and `\|\c 1370: .B .a\c 1371: \&\|' and searches several directories. 1372: .TP 1.1.1.5 ! root 1373: .B \-lobjc ! 1374: You need this special case of the ! 1375: .B \-l ! 1376: option in order to link an Objective C program. ! 1377: .TP ! 1378: .B \-nostartfiles ! 1379: Do not use the standard system startup files when linking. ! 1380: The standard libraries are used normally. ! 1381: .TP 1.1 root 1382: .B \-nostdlib 1383: Don't use the standard system libraries and startup files when linking. 1384: Only the files you specify will be passed to the linker. 1385: .TP 1386: .B \-static 1387: On systems that support dynamic linking, this prevents linking with the shared 1.1.1.4 root 1388: libraries. On other systems, this option has no effect. 1.1.1.5 ! root 1389: .TP ! 1390: .B \-shared ! 1391: Produce a shared object which can then be linked with other objects to ! 1392: form an executable. Only a few systems support this option. ! 1393: .TP ! 1394: .B \-symbolic ! 1395: Bind references to global symbols when building a shared object. Warn ! 1396: about any unresolved references (unless overridden by the link editor ! 1397: option `\|\c ! 1398: .B ! 1399: \-Xlinker \-z \-Xlinker defs\c ! 1400: \&\|'). Only a few systems support ! 1401: this option. ! 1402: .TP ! 1403: .BI "-Xlinker " "option" ! 1404: Pass \c ! 1405: .I option ! 1406: as an option to the linker. You can use this to ! 1407: supply system-specific linker options which GNU CC does not know how to ! 1408: recognize. ! 1409: ! 1410: If you want to pass an option that takes an argument, you must use ! 1411: `\|\c ! 1412: .B \-Xlinker\c ! 1413: \&\|' twice, once for the option and once for the argument. ! 1414: For example, to pass `\|\c ! 1415: .B ! 1416: \-assert definitions\c ! 1417: \&\|', you must write ! 1418: `\|\c ! 1419: .B ! 1420: \-Xlinker \-assert \-Xlinker definitions\c ! 1421: \&\|'. It does not work to write ! 1422: `\|\c ! 1423: .B ! 1424: \-Xlinker "-assert definitions"\c ! 1425: \&\|', because this passes the entire ! 1426: string as a single argument, which is not what the linker expects. ! 1427: .TP ! 1428: .BI "-Wl," "option"\c ! 1429: \& ! 1430: Pass \c ! 1431: .I option\c ! 1432: \& as an option to the linker. If \c ! 1433: .I option\c ! 1434: \& contains ! 1435: commas, it is split into multiple options at the commas. ! 1436: .TP ! 1437: .BI "-u " "symbol" ! 1438: Pretend the symbol ! 1439: .I symbol ! 1440: is undefined, to force linking of ! 1441: library modules to define it. You can use `\|\c ! 1442: .B \-u\c ! 1443: \&\|' multiple times with ! 1444: different symbols to force loading of additional library modules. 1.1 root 1445: .PP 1446: 1447: .SH DIRECTORY OPTIONS 1448: These options specify directories to search for header files, for 1449: libraries and for parts of the compiler: 1450: .TP 1451: .BI "\-I" "dir"\c 1452: \& 1453: Append directory \c 1454: .I dir\c 1455: \& to the list of directories searched for include files. 1456: .TP 1457: .B \-I\- 1458: Any directories you specify with `\|\c 1459: .B \-I\c 1460: \&\|' options before the `\|\c 1461: .B \-I\-\c 1462: \&\|' 1463: option are searched only for the case of `\|\c 1464: .B 1465: #include "\c 1466: .I file\c 1467: .B 1468: \&"\c 1469: \&\|'; 1470: they are not searched for `\|\c 1471: .B #include <\c 1472: .I file\c 1473: \&>\c 1474: \&\|'. 1475: 1476: If additional directories are specified with `\|\c 1477: .B \-I\c 1478: \&\|' options after 1479: the `\|\c 1480: .B \-I\-\c 1481: \&\|', these directories are searched for all `\|\c 1482: .B #include\c 1483: \&\|' 1484: directives. (Ordinarily \c 1485: .I all\c 1486: \& `\|\c 1487: .B \-I\c 1488: \&\|' directories are used 1489: this way.) 1490: 1491: In addition, the `\|\c 1492: .B \-I\-\c 1493: \&\|' option inhibits the use of the current 1494: directory (where the current input file came from) as the first search 1495: directory for `\|\c 1496: .B 1497: #include "\c 1498: .I file\c 1499: .B 1500: \&"\c 1501: \&\|'. There is no way to 1502: override this effect of `\|\c 1503: .B \-I\-\c 1504: \&\|'. With `\|\c 1505: .B \-I.\c 1506: \&\|' you can specify 1507: searching the directory which was current when the compiler was 1508: invoked. That is not exactly the same as what the preprocessor does 1509: by default, but it is often satisfactory. 1510: 1511: `\|\c 1512: .B \-I\-\c 1513: \&\|' does not inhibit the use of the standard system directories 1514: for header files. Thus, `\|\c 1515: .B \-I\-\c 1516: \&\|' and `\|\c 1517: .B \-nostdinc\c 1518: \&\|' are 1519: independent. 1520: .TP 1521: .BI "\-L" "dir"\c 1522: \& 1523: Add directory \c 1524: .I dir\c 1525: \& to the list of directories to be searched 1526: for `\|\c 1527: .B \-l\c 1528: \&\|'. 1529: .TP 1530: .BI "\-B" "prefix"\c 1531: \& 1532: This option specifies where to find the executables, libraries and 1533: data files of the compiler itself. 1534: 1535: The compiler driver program runs one or more of the subprograms 1536: `\|\c 1537: .B cpp\c 1538: \&\|', `\|\c 1539: .B cc1\c 1540: \&\|' (or, for C++, `\|\c 1541: .B cc1plus\c 1542: \&\|'), `\|\c 1543: .B as\c 1544: \&\|' and `\|\c 1545: .B ld\c 1546: \&\|'. It tries 1547: \c 1548: .I prefix\c 1549: \& as a prefix for each program it tries to run, both with and 1550: without `\|\c 1551: .B \c 1552: .I machine\c 1553: \&/\c 1554: .I version\c 1555: \&/\c 1556: \&\|'. 1557: 1558: For each subprogram to be run, the compiler driver first tries the 1559: `\|\c 1560: .B \-B\c 1561: \&\|' prefix, if any. If that name is not found, or if `\|\c 1562: .B \-B\c 1563: \&\|' 1564: was not specified, the driver tries two standard prefixes, which are 1565: `\|\c 1566: .B /usr/lib/gcc/\c 1567: \&\|' and `\|\c 1.1.1.2 root 1568: .B /usr/local/lib/gcc-lib/\c 1.1 root 1569: \&\|'. If neither of 1570: those results in a file name that is found, the compiler driver 1571: searches for the unmodified program 1572: name, using the directories specified in your 1573: `\|\c 1574: .B PATH\c 1575: \&\|' environment variable. 1576: 1577: The run-time support file `\|\c 1578: .B libgcc.a\c 1579: \&\|' is also searched for using the 1580: `\|\c 1581: .B \-B\c 1582: \&\|' prefix, if needed. If it is not found there, the two 1583: standard prefixes above are tried, and that is all. The file is left 1584: out of the link if it is not found by those means. Most of the time, 1585: on most machines, `\|\c 1586: .B libgcc.a\c 1587: \&\|' is not actually necessary. 1588: 1589: You can get a similar result from the environment variable 1590: \c 1591: .B GCC_EXEC_PREFIX\c 1592: \&; if it is defined, its value is used as a prefix 1593: in the same way. If both the `\|\c 1594: .B \-B\c 1595: \&\|' option and the 1596: \c 1597: .B GCC_EXEC_PREFIX\c 1598: \& variable are present, the `\|\c 1599: .B \-B\c 1600: \&\|' option is 1601: used first and the environment variable value second. 1602: .PP 1603: 1604: .SH WARNING OPTIONS 1605: Warnings are diagnostic messages that report constructions which 1606: are not inherently erroneous but which are risky or suggest there 1607: may have been an error. 1608: 1609: These options control the amount and kinds of warnings produced by GNU 1610: CC: 1611: .TP 1612: .B \-fsyntax\-only 1613: Check the code for syntax errors, but don't emit any output. 1614: .TP 1615: .B \-w 1616: Inhibit all warning messages. 1617: .TP 1.1.1.5 ! root 1618: .B \-Wno\-import ! 1619: Inhibit warning messages about the use of ! 1620: .BR #import . ! 1621: .TP 1.1 root 1622: .B \-pedantic 1623: Issue all the warnings demanded by strict ANSI standard C; reject 1624: all programs that use forbidden extensions. 1625: 1626: Valid ANSI standard C programs should compile properly with or without 1627: this option (though a rare few will require `\|\c 1628: .B \-ansi\c 1629: \&\|'). However, 1630: without this option, certain GNU extensions and traditional C features 1631: are supported as well. With this option, they are rejected. There is 1632: no reason to \c 1633: .I use\c 1634: \& this option; it exists only to satisfy pedants. 1635: 1636: `\|\c 1637: .B \-pedantic\c 1638: \&\|' does not cause warning messages for use of the 1639: alternate keywords whose names begin and end with `\|\c 1640: .B __\c 1641: \&\|'. Pedantic 1642: warnings are also disabled in the expression that follows 1643: \c 1644: .B __extension__\c 1645: \&. However, only system header files should use 1646: these escape routes; application programs should avoid them. 1647: .TP 1648: .B \-pedantic\-errors 1649: Like `\|\c 1650: .B \-pedantic\c 1651: \&\|', except that errors are produced rather than 1652: warnings. 1653: .TP 1654: .B \-W 1655: Print extra warning messages for these events: 1656: .TP 1657: \ \ \ \(bu 1658: A nonvolatile automatic variable might be changed by a call to 1659: \c 1660: .B longjmp\c 1661: \&. These warnings are possible only in 1662: optimizing compilation. 1663: 1664: The compiler sees only the calls to \c 1665: .B setjmp\c 1666: \&. It cannot know 1667: where \c 1668: .B longjmp\c 1669: \& will be called; in fact, a signal handler could 1670: call it at any point in the code. As a result, you may get a warning 1671: even when there is in fact no problem because \c 1672: .B longjmp\c 1673: \& cannot 1674: in fact be called at the place which would cause a problem. 1675: .TP 1676: \ \ \ \(bu 1677: A function can return either with or without a value. (Falling 1678: off the end of the function body is considered returning without 1679: a value.) For example, this function would evoke such a 1680: warning: 1681: .sp 1682: .br 1683: foo\ (a) 1684: .br 1685: { 1686: .br 1687: \ \ if\ (a\ >\ 0) 1688: .br 1689: \ \ \ \ return\ a; 1690: .br 1691: } 1692: .br 1693: .sp 1694: 1695: Spurious warnings can occur because GNU CC does not realize that 1696: certain functions (including \c 1697: .B abort\c 1698: \& and \c 1699: .B longjmp\c 1700: \&) 1701: will never return. 1702: .TP 1703: \ \ \ \(bu 1704: An expression-statement contains no side effects. 1705: .TP 1706: \ \ \ \(bu 1707: An unsigned value is compared against zero with `\|\c 1708: .B >\c 1709: \&\|' or `\|\c 1710: .B <=\c 1711: \&\|'. 1712: .PP 1713: .TP 1714: .B \-Wimplicit 1715: Warn whenever a function or parameter is implicitly declared. 1716: .TP 1717: .B \-Wreturn\-type 1718: Warn whenever a function is defined with a return-type that defaults 1719: to \c 1720: .B int\c 1721: \&. Also warn about any \c 1722: .B return\c 1723: \& statement with no 1724: return-value in a function whose return-type is not \c 1725: .B void\c 1726: \&. 1727: .TP 1728: .B \-Wunused 1729: Warn whenever a local variable is unused aside from its declaration, 1730: whenever a function is declared static but never defined, and whenever 1731: a statement computes a result that is explicitly not used. 1732: .TP 1733: .B \-Wswitch 1734: Warn whenever a \c 1735: .B switch\c 1736: \& statement has an index of enumeral type 1737: and lacks a \c 1738: .B case\c 1739: \& for one or more of the named codes of that 1740: enumeration. (The presence of a \c 1741: .B default\c 1742: \& label prevents this 1743: warning.) \c 1744: .B case\c 1745: \& labels outside the enumeration range also 1746: provoke warnings when this option is used. 1747: .TP 1748: .B \-Wcomment 1749: Warn whenever a comment-start sequence `\|\c 1750: .B /*\c 1751: \&\|' appears in a comment. 1752: .TP 1753: .B \-Wtrigraphs 1754: Warn if any trigraphs are encountered (assuming they are enabled). 1755: .TP 1756: .B \-Wformat 1757: Check calls to \c 1758: .B printf\c 1759: \& and \c 1760: .B scanf\c 1761: \&, etc., to make sure that 1762: the arguments supplied have types appropriate to the format string 1763: specified. 1764: .TP 1.1.1.5 ! root 1765: .B \-Wchar\-subscripts ! 1766: Warn if an array subscript has type ! 1767: .BR char . ! 1768: This is a common cause of error, as programmers often forget that this ! 1769: type is signed on some machines. ! 1770: .TP 1.1 root 1771: .B \-Wuninitialized 1772: An automatic variable is used without first being initialized. 1773: 1774: These warnings are possible only in optimizing compilation, 1775: because they require data flow information that is computed only 1776: when optimizing. If you don't specify `\|\c 1777: .B \-O\c 1778: \&\|', you simply won't 1779: get these warnings. 1780: 1781: These warnings occur only for variables that are candidates for 1782: register allocation. Therefore, they do not occur for a variable that 1783: is declared \c 1784: .B volatile\c 1785: \&, or whose address is taken, or whose size 1786: is other than 1, 2, 4 or 8 bytes. Also, they do not occur for 1787: structures, unions or arrays, even when they are in registers. 1788: 1789: Note that there may be no warning about a variable that is used only 1790: to compute a value that itself is never used, because such 1791: computations may be deleted by data flow analysis before the warnings 1792: are printed. 1793: 1794: These warnings are made optional because GNU CC is not smart 1795: enough to see all the reasons why the code might be correct 1796: despite appearing to have an error. Here is one example of how 1797: this can happen: 1798: 1799: .sp 1800: .br 1801: { 1802: .br 1803: \ \ int\ x; 1804: .br 1805: \ \ switch\ (y) 1806: .br 1807: \ \ \ \ { 1808: .br 1809: \ \ \ \ case\ 1:\ x\ =\ 1; 1810: .br 1811: \ \ \ \ \ \ break; 1812: .br 1813: \ \ \ \ case\ 2:\ x\ =\ 4; 1814: .br 1815: \ \ \ \ \ \ break; 1816: .br 1817: \ \ \ \ case\ 3:\ x\ =\ 5; 1818: .br 1819: \ \ \ \ } 1820: .br 1821: \ \ foo\ (x); 1822: .br 1823: } 1824: .br 1825: .sp 1826: 1827: 1828: If the value of \c 1829: .B y\c 1830: \& is always 1, 2 or 3, then \c 1831: .B x\c 1832: \& is 1833: always initialized, but GNU CC doesn't know this. Here is 1834: another common case: 1835: 1836: .sp 1837: .br 1838: { 1839: .br 1840: \ \ int\ save_y; 1841: .br 1842: \ \ if\ (change_y)\ save_y\ =\ y,\ y\ =\ new_y; 1843: .br 1844: \ \ .\|.\|. 1845: .br 1846: \ \ if\ (change_y)\ y\ =\ save_y; 1847: .br 1848: } 1849: .br 1850: .sp 1851: 1852: 1853: This has no bug because \c 1854: .B save_y\c 1855: \& is used only if it is set. 1856: 1857: Some spurious warnings can be avoided if you declare as 1858: \c 1859: .B volatile\c 1860: \& all the functions you use that never return. 1861: .TP 1.1.1.2 root 1862: .B \-Wparentheses 1863: Warn if parentheses are omitted in certain contexts. 1.1 root 1864: .TP 1.1.1.5 ! root 1865: .B \-Wtemplate\-debugging ! 1866: When using templates in a C++ program, warn if debugging is not yet ! 1867: fully available (C++ only). ! 1868: .TP 1.1 root 1869: .B \-Wall 1870: All of the above `\|\c 1871: .B \-W\c 1872: \&\|' options combined. These are all the 1873: options which pertain to usage that we recommend avoiding and that we 1874: believe is easy to avoid, even in conjunction with macros. 1875: .PP 1876: 1877: The remaining `\|\c 1878: .B \-W.\|.\|.\c 1879: \&\|' options are not implied by `\|\c 1880: .B \-Wall\c 1881: \&\|' 1882: because they warn about constructions that we consider reasonable to 1883: use, on occasion, in clean programs. 1884: .TP 1885: .B \-Wtraditional 1886: Warn about certain constructs that behave differently in traditional and 1887: ANSI C. 1888: .TP 1889: \ \ \ \(bu 1890: Macro arguments occurring within string constants in the macro body. 1891: These would substitute the argument in traditional C, but are part of 1892: the constant in ANSI C. 1893: .TP 1894: \ \ \ \(bu 1895: A function declared external in one block and then used after the end of 1896: the block. 1897: .TP 1898: \ \ \ \(bu 1899: A \c 1900: .B switch\c 1901: \& statement has an operand of type \c 1902: .B long\c 1903: \&. 1904: .PP 1905: .TP 1906: .B \-Wshadow 1907: Warn whenever a local variable shadows another local variable. 1908: .TP 1909: .BI "\-Wid\-clash\-" "len"\c 1910: \& 1911: Warn whenever two distinct identifiers match in the first \c 1912: .I len\c 1913: \& 1914: characters. This may help you prepare a program that will compile 1915: with certain obsolete, brain-damaged compilers. 1916: .TP 1917: .B \-Wpointer\-arith 1918: Warn about anything that depends on the ``size of'' a function type or 1919: of \c 1920: .B void\c 1921: \&. GNU C assigns these types a size of 1, for 1922: convenience in calculations with \c 1923: .B void *\c 1924: \& pointers and pointers 1925: to functions. 1926: .TP 1927: .B \-Wcast\-qual 1928: Warn whenever a pointer is cast so as to remove a type qualifier from 1929: the target type. For example, warn if a \c 1930: .B const char *\c 1931: \& is cast 1932: to an ordinary \c 1933: .B char *\c 1934: \&. 1935: .TP 1936: .B \-Wcast\-align 1937: Warn whenever a pointer is cast such that the required alignment of the 1938: target is increased. For example, warn if a \c 1939: .B char *\c 1940: \& is cast to 1941: an \c 1942: .B int *\c 1943: \& on machines where integers can only be accessed at 1944: two- or four-byte boundaries. 1945: .TP 1946: .B \-Wwrite\-strings 1947: Give string constants the type \c 1948: .B const char[\c 1949: .I length\c 1950: \&]\c 1951: \& so that 1952: copying the address of one into a non-\c 1953: .B const\c 1954: \& \c 1955: .B char *\c 1956: \& 1957: pointer will get a warning. These warnings will help you find at 1958: compile time code that can try to write into a string constant, but 1959: only if you have been very careful about using \c 1960: .B const\c 1961: \& in 1962: declarations and prototypes. Otherwise, it will just be a nuisance; 1963: this is why we did not make `\|\c 1964: .B \-Wall\c 1965: \&\|' request these warnings. 1966: .TP 1967: .B \-Wconversion 1968: Warn if a prototype causes a type conversion that is different from what 1969: would happen to the same argument in the absence of a prototype. This 1970: includes conversions of fixed point to floating and vice versa, and 1971: conversions changing the width or signedness of a fixed point argument 1972: except when the same as the default promotion. 1973: .TP 1.1.1.2 root 1974: .B \-Waggregate\-return 1975: Warn if any functions that return structures or unions are defined or 1976: called. (In languages where you can return an array, this also elicits 1977: a warning.) 1978: .TP 1979: .B \-Wstrict\-prototypes 1980: Warn if a function is declared or defined without specifying the 1981: argument types. (An old-style function definition is permitted without 1982: a warning if preceded by a declaration which specifies the argument 1983: types.) 1984: .TP 1985: .B \-Wmissing\-prototypes 1986: Warn if a global function is defined without a previous prototype 1987: declaration. This warning is issued even if the definition itself 1988: provides a prototype. The aim is to detect global functions that fail 1989: to be declared in header files. 1990: .TP 1.1.1.5 ! root 1991: .B \-Wredundant-decls ! 1992: Warn if anything is declared more than once in the same scope, even in ! 1993: cases where multiple declaration is valid and changes nothing. ! 1994: .TP ! 1995: .B \-Wnested-externs ! 1996: Warn if an \c ! 1997: .B extern\c ! 1998: \& declaration is encountered within an function. ! 1999: .TP 1.1 root 2000: .B \-Wenum\-clash 1.1.1.5 ! root 2001: Warn about conversion between different enumeration types (C++ only). 1.1 root 2002: .TP 2003: .B \-Woverloaded\-virtual 1.1.1.5 ! root 2004: (C++ only.) 1.1 root 2005: In a derived class, the definitions of virtual functions must match 2006: the type signature of a virtual function declared in the base class. 2007: Use this option to request warnings when a derived class declares a 2008: function that may be an erroneous attempt to define a virtual 2009: function: that is, warn when a function with the same name as a 2010: virtual function in the base class, but with a type signature that 2011: doesn't match any virtual functions from the base class. 1.1.1.2 root 2012: .TP 2013: .B \-Winline 2014: Warn if a function can not be inlined, and either it was declared as inline, 2015: or else the 2016: .B \-finline\-functions 2017: option was given. 2018: .TP 2019: .B \-Werror 2020: Treat warnings as errors; abort compilation after any warning. 1.1 root 2021: .PP 2022: 2023: .SH DEBUGGING OPTIONS 2024: GNU CC has various special options that are used for debugging 2025: either your program or GCC: 2026: .TP 2027: .B \-g 2028: Produce debugging information in the operating system's native format 1.1.1.5 ! root 2029: (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging ! 2030: information. ! 2031: ! 2032: On most systems that use stabs format, `\|\c 1.1 root 2033: .B \-g\c 1.1.1.5 ! root 2034: \&\|' enables use of extra ! 2035: debugging information that only GDB can use; this extra information ! 2036: makes debugging work better in GDB but will probably make other debuggers ! 2037: crash or ! 2038: refuse to read the program. If you want to control for certain whether ! 2039: to generate the extra information, use `\|\c ! 2040: .B \-gstabs+\c ! 2041: \&\|', `\|\c ! 2042: .B \-gstabs\c ! 2043: \&\|', 1.1 root 2044: `\|\c 1.1.1.5 ! root 2045: .B \-gxcoff+\c ! 2046: \&\|', `\|\c ! 2047: .B \-gxcoff\c ! 2048: \&\|', `\|\c ! 2049: .B \-gdwarf+\c ! 2050: \&\|', or `\|\c ! 2051: .B \-gdwarf\c ! 2052: \&\|' ! 2053: (see below). 1.1 root 2054: 2055: Unlike most other C compilers, GNU CC allows you to use `\|\c 2056: .B \-g\c 2057: \&\|' with 2058: `\|\c 2059: .B \-O\c 2060: \&\|'. The shortcuts taken by optimized code may occasionally 2061: produce surprising results: some variables you declared may not exist 2062: at all; flow of control may briefly move where you did not expect it; 2063: some statements may not be executed because they compute constant 2064: results or their values were already at hand; some statements may 2065: execute in different places because they were moved out of loops. 2066: 2067: Nevertheless it proves possible to debug optimized output. This makes 2068: it reasonable to use the optimizer for programs that might have bugs. 2069: 1.1.1.5 ! root 2070: The following options are useful when GNU CC is generated with the ! 2071: capability for more than one debugging format. 1.1 root 2072: .TP 2073: .B \-ggdb 1.1.1.5 ! root 2074: Produce debugging information in the native format (if that is supported), ! 2075: including GDB extensions if at all possible. 1.1 root 2076: .TP 1.1.1.5 ! root 2077: .B \-gstabs ! 2078: Produce debugging information in stabs format (if that is supported), ! 2079: without GDB extensions. This is the format used by DBX on most BSD ! 2080: systems. 1.1 root 2081: .TP 1.1.1.5 ! root 2082: .B \-gstabs+ ! 2083: Produce debugging information in stabs format (if that is supported), ! 2084: using GNU extensions understood only by the GNU debugger (GDB). The ! 2085: use of these extensions is likely to make other debuggers crash or ! 2086: refuse to read the program. ! 2087: .TP ! 2088: .B \-gcoff ! 2089: Produce debugging information in COFF format (if that is supported). ! 2090: This is the format used by SDB on most System V systems prior to ! 2091: System V Release 4. ! 2092: .TP ! 2093: .B \-gxcoff ! 2094: Produce debugging information in XCOFF format (if that is supported). ! 2095: This is the format used by the DBX debugger on IBM RS/6000 systems. ! 2096: .TP ! 2097: .B \-gxcoff+ ! 2098: Produce debugging information in XCOFF format (if that is supported), ! 2099: using GNU extensions understood only by the GNU debugger (GDB). The ! 2100: use of these extensions is likely to make other debuggers crash or ! 2101: refuse to read the program. 1.1 root 2102: .TP 2103: .B \-gdwarf 2104: Produce debugging information in DWARF format (if that is supported). 1.1.1.5 ! root 2105: This is the format used by SDB on most System V Release 4 systems. ! 2106: .TP ! 2107: .B \-gdwarf+ ! 2108: Produce debugging information in DWARF format (if that is supported), ! 2109: using GNU extensions understood only by the GNU debugger (GDB). The ! 2110: use of these extensions is likely to make other debuggers crash or ! 2111: refuse to read the program. 1.1 root 2112: .PP 2113: .BI "\-g" "level" 2114: .br 2115: .BI "\-ggdb" "level" 2116: .br 1.1.1.5 ! root 2117: .BI "\-gstabs" "level" 1.1 root 2118: .br 1.1.1.5 ! root 2119: .BI "\-gcoff" "level" ! 2120: .BI "\-gxcoff" "level" 1.1 root 2121: .TP 2122: .BI "\-gdwarf" "level" 2123: Request debugging information and also use \c 2124: .I level\c 2125: \& to specify how 2126: much information. The default level is 2. 2127: 2128: Level 1 produces minimal information, enough for making backtraces in 2129: parts of the program that you don't plan to debug. This includes 2130: descriptions of functions and external variables, but no information 2131: about local variables and no line numbers. 1.1.1.5 ! root 2132: ! 2133: Level 3 includes extra information, such as all the macro definitions ! 2134: present in the program. Some debuggers support macro expansion when ! 2135: you use `\|\c ! 2136: .B \-g3\c ! 2137: \&\|'. 1.1 root 2138: .TP 2139: .B \-p 2140: Generate extra code to write profile information suitable for the 2141: analysis program \c 2142: .B prof\c 2143: \&. 2144: .TP 2145: .B \-pg 2146: Generate extra code to write profile information suitable for the 2147: analysis program \c 2148: .B gprof\c 2149: \&. 2150: .TP 2151: .B \-a 2152: Generate extra code to write profile information for basic blocks, 2153: which will record the number of times each basic block is executed. 2154: This data could be analyzed by a program like \c 2155: .B tcov\c 2156: \&. Note, 2157: however, that the format of the data is not what \c 2158: .B tcov\c 2159: \& expects. 2160: Eventually GNU \c 2161: .B gprof\c 2162: \& should be extended to process this data. 2163: .TP 2164: .BI "\-d" "letters"\c 2165: \& 2166: Says to make debugging dumps during compilation at times specified by 2167: \c 2168: .I letters\c 2169: \&. This is used for debugging the compiler. The file names 2170: for most of the dumps are made by appending a word to the source file 2171: name (e.g. `\|\c 2172: .B foo.c.rtl\c 2173: \&\|' or `\|\c 2174: .B foo.c.jump\c 2175: \&\|'). 2176: .TP 2177: .B \-dM 2178: Dump all macro definitions, at the end of preprocessing, and write no 2179: output. 2180: .TP 2181: .B \-dN 2182: Dump all macro names, at the end of preprocessing. 2183: .TP 2184: .B \-dD 2185: Dump all macro definitions, at the end of preprocessing, in addition to 2186: normal output. 2187: .TP 2188: .B \-dy 2189: Dump debugging information during parsing, to standard error. 2190: .TP 2191: .B \-dr 2192: Dump after RTL generation, to `\|\c 2193: .B \c 2194: .I file\c 2195: \&.rtl\c 2196: \&\|'. 2197: .TP 2198: .B \-dx 2199: Just generate RTL for a function instead of compiling it. Usually used 2200: with `\|\c 2201: .B r\c 2202: \&\|'. 2203: .TP 2204: .B \-dj 2205: Dump after first jump optimization, to `\|\c 2206: .B \c 2207: .I file\c 2208: \&.jump\c 2209: \&\|'. 2210: .TP 2211: .B \-ds 2212: Dump after CSE (including the jump optimization that sometimes 2213: follows CSE), to `\|\c 2214: .B \c 2215: .I file\c 2216: \&.cse\c 2217: \&\|'. 2218: .TP 2219: .B \-dL 2220: Dump after loop optimization, to `\|\c 2221: .B \c 2222: .I file\c 2223: \&.loop\c 2224: \&\|'. 2225: .TP 2226: .B \-dt 2227: Dump after the second CSE pass (including the jump optimization that 2228: sometimes follows CSE), to `\|\c 2229: .B \c 2230: .I file\c 2231: \&.cse2\c 2232: \&\|'. 2233: .TP 2234: .B \-df 2235: Dump after flow analysis, to `\|\c 2236: .B \c 2237: .I file\c 2238: \&.flow\c 2239: \&\|'. 2240: .TP 2241: .B \-dc 2242: Dump after instruction combination, to `\|\c 2243: .B \c 2244: .I file\c 2245: \&.combine\c 2246: \&\|'. 2247: .TP 2248: .B \-dS 2249: Dump after the first instruction scheduling pass, to 2250: `\|\c 2251: .B \c 2252: .I file\c 2253: \&.sched\c 2254: \&\|'. 2255: .TP 2256: .B \-dl 2257: Dump after local register allocation, to `\|\c 2258: .B \c 2259: .I file\c 2260: \&.lreg\c 2261: \&\|'. 2262: .TP 2263: .B \-dg 2264: Dump after global register allocation, to `\|\c 2265: .B \c 2266: .I file\c 2267: \&.greg\c 2268: \&\|'. 2269: .TP 2270: .B \-dR 2271: Dump after the second instruction scheduling pass, to 2272: `\|\c 2273: .B \c 2274: .I file\c 2275: \&.sched2\c 2276: \&\|'. 2277: .TP 2278: .B \-dJ 2279: Dump after last jump optimization, to `\|\c 2280: .B \c 2281: .I file\c 2282: \&.jump2\c 2283: \&\|'. 2284: .TP 2285: .B \-dd 2286: Dump after delayed branch scheduling, to `\|\c 2287: .B \c 2288: .I file\c 2289: \&.dbr\c 2290: \&\|'. 2291: .TP 2292: .B \-dk 2293: Dump after conversion from registers to stack, to `\|\c 2294: .B \c 2295: .I file\c 2296: \&.stack\c 2297: \&\|'. 2298: .TP 1.1.1.5 ! root 2299: .B \-da ! 2300: Produce all the dumps listed above. ! 2301: .TP 1.1 root 2302: .B \-dm 2303: Print statistics on memory usage, at the end of the run, to 2304: standard error. 2305: .TP 2306: .B \-dp 2307: Annotate the assembler output with a comment indicating which 2308: pattern and alternative was used. 2309: .TP 2310: .B \-fpretend\-float 2311: When running a cross-compiler, pretend that the target machine uses the 2312: same floating point format as the host machine. This causes incorrect 2313: output of the actual floating constants, but the actual instruction 2314: sequence will probably be the same as GNU CC would make when running on 2315: the target machine. 2316: .TP 2317: .B \-save\-temps 2318: Store the usual ``temporary'' intermediate files permanently; place them 2319: in the current directory and name them based on the source file. Thus, 2320: compiling `\|\c 2321: .B foo.c\c 2322: \&\|' with `\|\c 2323: .B \-c \-save\-temps\c 2324: \&\|' would produce files 2325: `\|\c 2326: .B foo.cpp\c 2327: \&\|' and `\|\c 2328: .B foo.s\c 2329: \&\|', as well as `\|\c 2330: .B foo.o\c 2331: \&\|'. 1.1.1.5 ! root 2332: .TP ! 2333: .B \-print\-libgcc\-file\-name ! 2334: Print the full absolute name of the library file `\|\c ! 2335: .B libgcc.a\c ! 2336: \&\|' that ! 2337: would be used when linking\(em\&and do not do anything else. With this ! 2338: option, GNU CC does not compile or link anything; it just prints the ! 2339: file name. 1.1 root 2340: .PP 2341: 2342: .SH OPTIMIZATION OPTIONS 2343: These options control various sorts of optimizations: 1.1.1.5 ! root 2344: .PP 1.1 root 2345: .B \-O 1.1.1.5 ! root 2346: .TP ! 2347: .B \-O1 1.1 root 2348: Optimize. Optimizing compilation takes somewhat more time, and a lot 2349: more memory for a large function. 2350: 2351: Without `\|\c 2352: .B \-O\c 2353: \&\|', the compiler's goal is to reduce the cost of 2354: compilation and to make debugging produce the expected results. 2355: Statements are independent: if you stop the program with a breakpoint 2356: between statements, you can then assign a new value to any variable or 2357: change the program counter to any other statement in the function and 2358: get exactly the results you would expect from the source code. 2359: 2360: Without `\|\c 2361: .B \-O\c 2362: \&\|', only variables declared \c 2363: .B register\c 2364: \& are 2365: allocated in registers. The resulting compiled code is a little worse 2366: than produced by PCC without `\|\c 2367: .B \-O\c 2368: \&\|'. 2369: 2370: With `\|\c 2371: .B \-O\c 2372: \&\|', the compiler tries to reduce code size and execution 2373: time. 2374: 2375: When you specify `\|\c 2376: .B \-O\c 2377: \&\|', `\|\c 2378: .B \-fthread\-jumps\c 2379: \&\|' and 2380: `\|\c 2381: .B \-fdelayed\-branch\c 2382: \&\|' are turned on. On some machines other 2383: flags may also be turned on. 2384: .TP 2385: .B \-O2 1.1.1.5 ! root 2386: Optimize even more. Nearly all supported optimizations that do not ! 2387: involve a space-speed tradeoff are performed. As compared to 1.1 root 2388: .B \-O\c 1.1.1.5 ! root 2389: \&, ! 2390: this option increases both compilation time and the performance of the 1.1 root 2391: generated code. 2392: 1.1.1.5 ! root 2393: .B \-O2 ! 2394: turns on all ! 2395: .BI \-f flag ! 2396: options that enable more optimization, except for 1.1 root 2397: .B \-funroll\-loops\c 1.1.1.5 ! root 2398: \&, ! 2399: .B \-funroll\-all\-loops ! 2400: and ! 2401: .BR \-fomit\-frame\-pointer . ! 2402: .TP ! 2403: .B \-O0 ! 2404: Do not optimize. ! 2405: ! 2406: If you use multiple ! 2407: .B \-O ! 2408: options, with or without level numbers, the last such option is the ! 2409: one that is effective. 1.1 root 2410: .PP 2411: 2412: Options of the form `\|\c 2413: .B \-f\c 2414: .I flag\c 2415: \&\c 2416: \&\|' specify machine-independent 2417: flags. Most flags have both positive and negative forms; the negative 2418: form of `\|\c 2419: .B \-ffoo\c 2420: \&\|' would be `\|\c 2421: .B \-fno\-foo\c 2422: \&\|'. The following list shows 2423: only one form\(em\&the one which is not the default. 2424: You can figure out the other form by either removing `\|\c 2425: .B no\-\c 2426: \&\|' or 2427: adding it. 2428: .TP 2429: .B \-ffloat\-store 2430: Do not store floating point variables in registers. This 2431: prevents undesirable excess precision on machines such as the 2432: 68000 where the floating registers (of the 68881) keep more 2433: precision than a \c 2434: .B double\c 2435: \& is supposed to have. 2436: 2437: For most programs, the excess precision does only good, but a few 2438: programs rely on the precise definition of IEEE floating point. 2439: Use `\|\c 2440: .B \-ffloat\-store\c 2441: \&\|' for such programs. 2442: .TP 2443: .B \-fmemoize\-lookups 2444: .TP 2445: .B \-fsave\-memoized 1.1.1.5 ! root 2446: Use heuristics to compile faster (C++ only). These heuristics are not ! 2447: enabled by default, since they are only effective for certain input ! 2448: files. Other input files compile more slowly. 1.1 root 2449: 2450: The first time the compiler must build a call to a member function (or 2451: reference to a data member), it must (1) determine whether the class 2452: implements member functions of that name; (2) resolve which member 2453: function to call (which involves figuring out what sorts of type 2454: conversions need to be made); and (3) check the visibility of the member 2455: function to the caller. All of this adds up to slower compilation. 2456: Normally, the second time a call is made to that member function (or 2457: reference to that data member), it must go through the same lengthy 2458: process again. This means that code like this 2459: .sp 2460: .br 1.1.1.5 ! root 2461: cout\ <<\ "This\ "\ <<\ p\ <<\ "\ has\ "\ <<\ n\ <<\ "\ legs.\en"; 1.1 root 2462: .br 2463: .sp 2464: makes six passes through all three steps. By using a software cache, 2465: a ``hit'' significantly reduces this cost. Unfortunately, using the 2466: cache introduces another layer of mechanisms which must be implemented, 2467: and so incurs its own overhead. `\|\c 2468: .B \-fmemoize\-lookups\c 2469: \&\|' enables 2470: the software cache. 2471: 2472: Because access privileges (visibility) to members and member functions 2473: may differ from one function context to the next, 2474: .B g++ 1.1.1.5 ! root 2475: may need to flush the cache. With the `\|\c 1.1 root 2476: .B \-fmemoize\-lookups\c 2477: \&\|' flag, the cache is flushed after every 2478: function that is compiled. The `\|\c 2479: \-fsave\-memoized\c 2480: \&\|' flag enables the same software cache, but when the compiler 2481: determines that the context of the last function compiled would yield 2482: the same access privileges of the next function to compile, it 2483: preserves the cache. 2484: This is most helpful when defining many member functions for the same 2485: class: with the exception of member functions which are friends of 2486: other classes, each member function has exactly the same access 2487: privileges as every other, and the cache need not be flushed. 2488: .TP 2489: .B \-fno\-default\-inline 1.1.1.5 ! root 2490: Don't make member functions inline by default merely because they are ! 2491: defined inside the class scope (C++ only). 1.1 root 2492: .TP 2493: .B \-fno\-defer\-pop 2494: Always pop the arguments to each function call as soon as that 2495: function returns. For machines which must pop arguments after a 2496: function call, the compiler normally lets arguments accumulate on the 2497: stack for several function calls and pops them all at once. 2498: .TP 2499: .B \-fforce\-mem 2500: Force memory operands to be copied into registers before doing 2501: arithmetic on them. This may produce better code by making all 2502: memory references potential common subexpressions. When they are 2503: not common subexpressions, instruction combination should 2504: eliminate the separate register-load. I am interested in hearing 2505: about the difference this makes. 2506: .TP 2507: .B \-fforce\-addr 2508: Force memory address constants to be copied into registers before 2509: doing arithmetic on them. This may produce better code just as 2510: `\|\c 2511: .B \-fforce\-mem\c 2512: \&\|' may. I am interested in hearing about the 2513: difference this makes. 2514: .TP 2515: .B \-fomit\-frame\-pointer 2516: Don't keep the frame pointer in a register for functions that 2517: don't need one. This avoids the instructions to save, set up and 2518: restore frame pointers; it also makes an extra register available 2519: in many functions. \c 2520: .I It also makes debugging impossible on 2521: most machines.\c 2522: \& 2523: 2524: On some machines, such as the Vax, this flag has no effect, because 2525: the standard calling sequence automatically handles the frame pointer 2526: and nothing is saved by pretending it doesn't exist. The 2527: machine-description macro \c 2528: .B FRAME_POINTER_REQUIRED\c 2529: \& controls 2530: whether a target machine supports this flag. 2531: .TP 2532: .B \-finline\-functions 2533: Integrate all simple functions into their callers. The compiler 2534: heuristically decides which functions are simple enough to be worth 2535: integrating in this way. 2536: 2537: If all calls to a given function are integrated, and the function is 2538: declared \c 2539: .B static\c 2540: \&, then GCC normally does not output the function as 2541: assembler code in its own right. 2542: .TP 2543: .B \-fcaller\-saves 2544: Enable values to be allocated in registers that will be clobbered by 2545: function calls, by emitting extra instructions to save and restore the 2546: registers around such calls. Such allocation is done only when it 2547: seems to result in better code than would otherwise be produced. 2548: 2549: This option is enabled by default on certain machines, usually those 2550: which have no call-preserved registers to use instead. 2551: .TP 2552: .B \-fkeep\-inline\-functions 2553: Even if all calls to a given function are integrated, and the function 2554: is declared \c 2555: .B static\c 2556: \&, nevertheless output a separate run-time 2557: callable version of the function. 2558: .TP 2559: .B \-fno\-function\-cse 2560: Do not put function addresses in registers; make each instruction that 2561: calls a constant function contain the function's address explicitly. 2562: 2563: This option results in less efficient code, but some strange hacks 2564: that alter the assembler output may be confused by the optimizations 2565: performed when this option is not used. 1.1.1.5 ! root 2566: .TP ! 2567: .B \-fno\-peephole ! 2568: Disable any machine-specific peephole optimizations. ! 2569: .TP ! 2570: .B \-ffast-math ! 2571: This option allows GCC to violate some ANSI or IEEE rules/specifications ! 2572: in the interest of optimizing code for speed. For example, it allows ! 2573: the compiler to assume arguments to the \c ! 2574: .B sqrt\c ! 2575: \& function are ! 2576: non-negative numbers. ! 2577: ! 2578: This option should never be turned on by any `\|\c ! 2579: .B \-O\c ! 2580: \&\|' option since ! 2581: it can result in incorrect output for programs which depend on ! 2582: an exact implementation of IEEE or ANSI rules/specifications for ! 2583: math functions. 1.1 root 2584: .PP 2585: 2586: The following options control specific optimizations. The `\|\c 2587: .B \-O2\c 2588: \&\|' 2589: option turns on all of these optimizations except `\|\c 2590: .B \-funroll\-loops\c 2591: \&\|' 2592: and `\|\c 2593: .B \-funroll\-all\-loops\c 2594: \&\|'. 2595: 2596: The `\|\c 2597: .B \-O\c 2598: \&\|' option usually turns on 2599: the `\|\c 2600: .B \-fthread\-jumps\c 2601: \&\|' and `\|\c 2602: .B \-fdelayed\-branch\c 2603: \&\|' options, but 2604: specific machines may change the default optimizations. 2605: 2606: You can use the following flags in the rare cases when ``fine-tuning'' 2607: of optimizations to be performed is desired. 2608: .TP 2609: .B \-fstrength\-reduce 2610: Perform the optimizations of loop strength reduction and 2611: elimination of iteration variables. 2612: .TP 2613: .B \-fthread\-jumps 2614: Perform optimizations where we check to see if a jump branches to a 2615: location where another comparison subsumed by the first is found. If 2616: so, the first branch is redirected to either the destination of the 2617: second branch or a point immediately following it, depending on whether 2618: the condition is known to be true or false. 2619: .TP 2620: .B \-funroll\-loops 2621: Perform the optimization of loop unrolling. This is only done for loops 2622: whose number of iterations can be determined at compile time or run time. 2623: .TP 2624: .B \-funroll\-all\-loops 2625: Perform the optimization of loop unrolling. This is done for all loops. 2626: This usually makes programs run more slowly. 2627: .TP 2628: .B \-fcse\-follow\-jumps 1.1.1.5 ! root 2629: In common subexpression elimination, scan through jump instructions ! 2630: when the target of the jump is not reached by any other path. For ! 2631: example, when CSE encounters an \c ! 2632: .B if\c ! 2633: \& statement with an ! 2634: \c ! 2635: .B else\c ! 2636: \& clause, CSE will follow the jump when the condition ! 2637: tested is false. ! 2638: .TP ! 2639: .B \-fcse\-skip\-blocks ! 2640: This is similar to `\|\c ! 2641: .B \-fcse\-follow\-jumps\c ! 2642: \&\|', but causes CSE to ! 2643: follow jumps which conditionally skip over blocks. When CSE ! 2644: encounters a simple \c ! 2645: .B if\c ! 2646: \& statement with no else clause, ! 2647: `\|\c ! 2648: .B \-fcse\-skip\-blocks\c ! 2649: \&\|' causes CSE to follow the jump around the ! 2650: body of the \c ! 2651: .B if\c ! 2652: \&. 1.1 root 2653: .TP 2654: .B \-frerun\-cse\-after\-loop 2655: Re-run common subexpression elimination after loop optimizations has been 2656: performed. 2657: .TP 2658: .B \-felide\-constructors 1.1.1.5 ! root 2659: Elide constructors when this seems plausible (C++ only). With this ! 2660: flag, GNU C++ initializes \c ! 2661: .B y\c ! 2662: \& directly from the call to \c ! 2663: .B foo\c ! 2664: \& ! 2665: without going through a temporary in the following code: ! 2666: 1.1 root 2667: .sp 2668: .br 2669: A\ foo\ (); 2670: .br 1.1.1.5 ! root 2671: A\ y\ =\ foo\ (); 1.1 root 2672: .br 2673: .sp 1.1.1.5 ! root 2674: ! 2675: Without this option, GNU C++ first initializes \c 1.1 root 2676: .B y\c 1.1.1.5 ! root 2677: \& by calling the ! 2678: appropriate constructor for type \c ! 2679: .B A\c ! 2680: \&; then assigns the result of ! 2681: \c ! 2682: .B foo\c ! 2683: \& to a temporary; and, finally, replaces the initial valyue of ! 2684: `\|\c ! 2685: .B y\c ! 2686: \&\|' with the temporary. ! 2687: ! 2688: The default behavior (`\|\c ! 2689: .B \-fno\-elide\-constructors\c ! 2690: \&\|') is specified by ! 2691: the draft ANSI C++ standard. If your program's constructors have side ! 2692: effects, using `\|\c ! 2693: .B \-felide-constructors\c ! 2694: \&\|' can make your program act ! 2695: differently, since some constructor calls may be omitted. 1.1 root 2696: .TP 2697: .B \-fexpensive\-optimizations 2698: Perform a number of minor optimizations that are relatively expensive. 2699: .TP 2700: .B \-fdelayed\-branch 2701: If supported for the target machine, attempt to reorder instructions 2702: to exploit instruction slots available after delayed branch 2703: instructions. 2704: .TP 2705: .B \-fschedule\-insns 2706: If supported for the target machine, attempt to reorder instructions to 2707: eliminate execution stalls due to required data being unavailable. This 2708: helps machines that have slow floating point or memory load instructions 2709: by allowing other instructions to be issued until the result of the load 2710: or floating point instruction is required. 2711: .TP 2712: .B \-fschedule\-insns2 2713: Similar to `\|\c 2714: .B \-fschedule\-insns\c 2715: \&\|', but requests an additional pass of 2716: instruction scheduling after register allocation has been done. This is 2717: especially useful on machines with a relatively small number of 2718: registers and where memory load instructions take more than one cycle. 2719: .PP 2720: 2721: .SH TARGET OPTIONS 2722: By default, GNU CC compiles code for the same type of machine that you 2723: are using. However, it can also be installed as a cross-compiler, to 2724: compile for some other type of machine. In fact, several different 2725: configurations of GNU CC, for different target machines, can be 2726: installed side by side. Then you specify which one to use with the 2727: `\|\c 2728: .B \-b\c 2729: \&\|' option. 2730: 2731: In addition, older and newer versions of GNU CC can be installed side 2732: by side. One of them (probably the newest) will be the default, but 2733: you may sometimes wish to use another. 2734: .TP 2735: .BI "\-b " "machine"\c 2736: \& 2737: The argument \c 2738: .I machine\c 2739: \& specifies the target machine for compilation. 2740: This is useful when you have installed GNU CC as a cross-compiler. 2741: 2742: The value to use for \c 2743: .I machine\c 2744: \& is the same as was specified as the 2745: machine type when configuring GNU CC as a cross-compiler. For 2746: example, if a cross-compiler was configured with `\|\c 2747: .B configure 2748: i386v\c 2749: \&\|', meaning to compile for an 80386 running System V, then you 2750: would specify `\|\c 2751: .B \-b i386v\c 2752: \&\|' to run that cross compiler. 2753: 2754: When you do not specify `\|\c 2755: .B \-b\c 2756: \&\|', it normally means to compile for 2757: the same type of machine that you are using. 2758: .TP 2759: .BI "\-V " "version"\c 2760: \& 2761: The argument \c 2762: .I version\c 2763: \& specifies which version of GNU CC to run. 2764: This is useful when multiple versions are installed. For example, 2765: \c 2766: .I version\c 2767: \& might be `\|\c 2768: .B 2.0\c 2769: \&\|', meaning to run GNU CC version 2.0. 2770: 2771: The default version, when you do not specify `\|\c 2772: .B \-V\c 2773: \&\|', is controlled 2774: by the way GNU CC is installed. Normally, it will be a version that 2775: is recommended for general use. 2776: .PP 2777: 2778: .SH MACHINE DEPENDENT OPTIONS 2779: Each of the target machine types can have its own special options, 2780: starting with `\|\c 2781: .B \-m\c 2782: \&\|', to choose among various hardware models or 2783: configurations\(em\&for example, 68010 vs 68020, floating coprocessor or 2784: none. A single installed version of the compiler can compile for any 2785: model or configuration, according to the options specified. 2786: 1.1.1.5 ! root 2787: Some configurations of the compiler also support additional special ! 2788: options, usually for command-line compatibility with other compilers on ! 2789: the same platform. ! 2790: 1.1 root 2791: These are the `\|\c 2792: .B \-m\c 2793: \&\|' options defined for the 68000 series: 2794: .TP 1.1.1.5 ! root 2795: .B \-m68000 ! 2796: .TP ! 2797: .B \-mc68000 ! 2798: Generate output for a 68000. This is the default when the compiler is ! 2799: configured for 68000-based systems. ! 2800: .TP 1.1 root 2801: .B \-m68020 2802: .TP 2803: .B \-mc68020 2804: Generate output for a 68020 (rather than a 68000). This is the 1.1.1.5 ! root 2805: default when the compiler is configured for 68020-based systems. 1.1 root 2806: .TP 2807: .B \-m68881 2808: Generate output containing 68881 instructions for floating point. 1.1.1.5 ! root 2809: This is the default for most 68020-based systems unless ! 2810: .B \-nfp ! 2811: was specified when the compiler was configured. ! 2812: .TP ! 2813: .B \-m68030 ! 2814: Generate output for a 68030. This is the default when the compiler is ! 2815: configured for 68030-based systems. ! 2816: .TP ! 2817: .B \-m68040 ! 2818: Generate output for a 68040. This is the default when the compiler is ! 2819: configured for 68040-based systems. ! 2820: .TP ! 2821: .B \-m68020\-40 ! 2822: Generate output for a 68040, without using any of the new instructions. ! 2823: This results in code which can run relatively efficiently on either a ! 2824: 68020/68881 or a 68030 or a 68040. 1.1 root 2825: .TP 2826: .B \-mfpa 2827: Generate output containing Sun FPA instructions for floating point. 2828: .TP 2829: .B \-msoft\-float 2830: Generate output containing library calls for floating point. 2831: .I 2832: WARNING: 2833: the requisite libraries are not part of GNU CC. Normally the 2834: facilities of the machine's usual C compiler are used, but this can't 2835: be done directly in cross-compilation. You must make your own 2836: arrangements to provide suitable library functions for cross-compilation. 2837: .TP 2838: .B \-mshort 2839: Consider type \c 2840: .B int\c 2841: \& to be 16 bits wide, like \c 2842: .B short int\c 2843: \&. 2844: .TP 2845: .B \-mnobitfield 2846: Do not use the bit-field instructions. `\|\c 2847: .B \-m68000\c 2848: \&\|' implies 2849: `\|\c 2850: .B \-mnobitfield\c 2851: \&\|'. 2852: .TP 2853: .B \-mbitfield 2854: Do use the bit-field instructions. `\|\c 2855: .B \-m68020\c 2856: \&\|' implies 2857: `\|\c 2858: .B \-mbitfield\c 2859: \&\|'. This is the default if you use the unmodified 2860: sources. 2861: .TP 2862: .B \-mrtd 2863: Use a different function-calling convention, in which functions 2864: that take a fixed number of arguments return with the \c 2865: .B rtd\c 2866: \& 2867: instruction, which pops their arguments while returning. This 2868: saves one instruction in the caller since there is no need to pop 2869: the arguments there. 2870: 2871: This calling convention is incompatible with the one normally 2872: used on Unix, so you cannot use it if you need to call libraries 2873: compiled with the Unix compiler. 2874: 2875: Also, you must provide function prototypes for all functions that 2876: take variable numbers of arguments (including \c 2877: .B printf\c 2878: \&); 2879: otherwise incorrect code will be generated for calls to those 2880: functions. 2881: 2882: In addition, seriously incorrect code will result if you call a 2883: function with too many arguments. (Normally, extra arguments are 2884: harmlessly ignored.) 2885: 2886: The \c 2887: .B rtd\c 2888: \& instruction is supported by the 68010 and 68020 2889: processors, but not by the 68000. 2890: .PP 2891: 2892: These `\|\c 2893: .B \-m\c 2894: \&\|' options are defined for the Vax: 2895: .TP 2896: .B \-munix 2897: Do not output certain jump instructions (\c 2898: .B aobleq\c 2899: \& and so on) 2900: that the Unix assembler for the Vax cannot handle across long 2901: ranges. 2902: .TP 2903: .B \-mgnu 2904: Do output those jump instructions, on the assumption that you 2905: will assemble with the GNU assembler. 2906: .TP 2907: .B \-mg 2908: Output code for g-format floating point numbers instead of d-format. 2909: .PP 2910: 2911: These `\|\c 2912: .B \-m\c 1.1.1.5 ! root 2913: \&\|' switches are supported on the SPARC: ! 2914: ! 2915: .PP 1.1 root 2916: .B \-mfpu 1.1.1.5 ! root 2917: .TP ! 2918: .B \-mhard\-float 1.1 root 2919: Generate output containing floating point instructions. This is the 1.1.1.5 ! root 2920: default. ! 2921: .PP ! 2922: .B \-mno\-fpu 1.1 root 2923: .TP 1.1.1.5 ! root 2924: .B \-msoft\-float ! 2925: Generate output containing library calls for floating point. ! 2926: .I Warning: ! 2927: there is no GNU floating-point library for SPARC. ! 2928: Normally the facilities of the machine's usual C compiler are used, but ! 2929: this cannot be done directly in cross-compilation. You must make your ! 2930: own arrangements to provide suitable library functions for ! 2931: cross-compilation. ! 2932: ! 2933: .B \-msoft\-float ! 2934: changes the calling convention in the output file; ! 2935: therefore, it is only useful if you compile ! 2936: .I all ! 2937: of a program with this option. ! 2938: .PP 1.1 root 2939: .B \-mno\-epilogue 1.1.1.5 ! root 2940: .TP ! 2941: .B \-mepilogue ! 2942: With ! 2943: .B \-mepilogue ! 2944: (the default), the compiler always emits code for ! 2945: function exit at the end of each function. Any function exit in ! 2946: the middle of the function (such as a return statement in C) will ! 2947: generate a jump to the exit code at the end of the function. ! 2948: ! 2949: With ! 2950: .BR \-mno\-epilogue , ! 2951: the compiler tries to emit exit code inline at every function exit. ! 2952: .PP ! 2953: .B \-mv8 ! 2954: .TP ! 2955: .B \-msparclite ! 2956: These two options select variations on the SPARC architecture. ! 2957: ! 2958: By default (unless specifically configured for the Fujitsu SPARClite), ! 2959: GCC generates code for the v7 variant of the SPARC architecture. ! 2960: ! 2961: .B \-mv8 ! 2962: will give you SPARC v8 code. The only difference from v7 ! 2963: code is that the compiler emits the integer multiply and integer ! 2964: divide instructions which exist in SPARC v8 but not in SPARC v7. ! 2965: ! 2966: .B \-msparclite ! 2967: will give you SPARClite code. This adds the integer ! 2968: multiply, integer divide step and scan (ffs) instructions which ! 2969: exist in SPARClite but not in SPARC v7. 1.1 root 2970: .PP 2971: 2972: These `\|\c 2973: .B \-m\c 2974: \&\|' options are defined for the Convex: 2975: .TP 2976: .B \-mc1 2977: Generate output for a C1. This is the default when the compiler is 2978: configured for a C1. 2979: .TP 2980: .B \-mc2 2981: Generate output for a C2. This is the default when the compiler is 2982: configured for a C2. 2983: .TP 2984: .B \-margcount 2985: Generate code which puts an argument count in the word preceding each 2986: argument list. Some nonportable Convex and Vax programs need this word. 2987: (Debuggers don't, except for functions with variable-length argument 2988: lists; this info is in the symbol table.) 2989: .TP 2990: .B \-mnoargcount 2991: Omit the argument count word. This is the default if you use the 2992: unmodified sources. 2993: .PP 2994: 2995: These `\|\c 2996: .B \-m\c 2997: \&\|' options are defined for the AMD Am29000: 2998: .TP 2999: .B \-mdw 3000: Generate code that assumes the DW bit is set, i.e., that byte and 3001: halfword operations are directly supported by the hardware. This is the 3002: default. 3003: .TP 3004: .B \-mnodw 3005: Generate code that assumes the DW bit is not set. 3006: .TP 3007: .B \-mbw 3008: Generate code that assumes the system supports byte and halfword write 3009: operations. This is the default. 3010: .TP 3011: .B \-mnbw 3012: Generate code that assumes the systems does not support byte and 3013: halfword write operations. This implies `\|\c 3014: .B \-mnodw\c 3015: \&\|'. 3016: .TP 3017: .B \-msmall 3018: Use a small memory model that assumes that all function addresses are 3019: either within a single 256 KB segment or at an absolute address of less 3020: than 256K. This allows the \c 3021: .B call\c 3022: \& instruction to be used instead 3023: of a \c 3024: .B const\c 3025: \&, \c 3026: .B consth\c 3027: \&, \c 3028: .B calli\c 3029: \& sequence. 3030: .TP 3031: .B \-mlarge 3032: Do not assume that the \c 3033: .B call\c 3034: \& instruction can be used; this is the 3035: default. 3036: .TP 3037: .B \-m29050 3038: Generate code for the Am29050. 3039: .TP 3040: .B \-m29000 3041: Generate code for the Am29000. This is the default. 3042: .TP 3043: .B \-mkernel\-registers 3044: Generate references to registers \c 3045: .B gr64-gr95\c 3046: \& instead of 3047: \c 3048: .B gr96-gr127\c 3049: \&. This option can be used when compiling kernel code 3050: that wants a set of global registers disjoint from that used by 3051: user-mode code. 3052: 3053: Note that when this option is used, register names in `\|\c 3054: .B \-f\c 3055: \&\|' flags 3056: must use the normal, user-mode, names. 3057: .TP 3058: .B \-muser\-registers 3059: Use the normal set of global registers, \c 3060: .B gr96-gr127\c 3061: \&. This is the 3062: default. 3063: .TP 3064: .B \-mstack\-check 3065: Insert a call to \c 3066: .B __msp_check\c 3067: \& after each stack adjustment. This 3068: is often used for kernel code. 3069: .PP 3070: 3071: These `\|\c 3072: .B \-m\c 3073: \&\|' options are defined for Motorola 88K architectures: 3074: .TP 1.1.1.5 ! root 3075: .B \-m88000 ! 3076: Generate code that works well on both the m88100 and the ! 3077: m88110. ! 3078: .TP ! 3079: .B \-m88100 ! 3080: Generate code that works best for the m88100, but that also ! 3081: runs on the m88110. ! 3082: .TP ! 3083: .B \-m88110 ! 3084: Generate code that works best for the m88110, and may not run ! 3085: on the m88100. 1.1 root 3086: .TP 3087: .B \-midentify\-revision 3088: Include an \c 3089: .B ident\c 3090: \& directive in the assembler output recording the 3091: source file name, compiler name and version, timestamp, and compilation 3092: flags used. 3093: .TP 3094: .B \-mno\-underscores 3095: In assembler output, emit symbol names without adding an underscore 3096: character at the beginning of each name. The default is to use an 3097: underscore as prefix on each name. 3098: .TP 3099: .B \-mno\-check\-zero\-division 3100: .TP 3101: .B \-mcheck\-zero\-division 3102: Early models of the 88K architecture had problems with division by zero; 3103: in particular, many of them didn't trap. Use these options to avoid 3104: including (or to include explicitly) additional code to detect division 3105: by zero and signal an exception. All GCC configurations for the 88K use 3106: `\|\c 3107: .B \-mcheck\-zero\-division\c 3108: \&\|' by default. 3109: .TP 3110: .B \-mocs\-debug\-info 3111: .TP 3112: .B \-mno\-ocs\-debug\-info 3113: Include (or omit) additional debugging information (about 3114: registers used in each stack frame) as specified in the 88Open Object 3115: Compatibility Standard, ``OCS''. This extra information is not needed 3116: by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to 3117: include this information; other 88k configurations omit this information 3118: by default. 3119: .TP 3120: .B \-mocs\-frame\-position 3121: .TP 3122: .B \-mno\-ocs\-frame\-position 3123: Force (or do not require) register values to be stored in a particular 3124: place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2, 3125: and BCS configurations use `\|\c 3126: .B \-mocs\-frame\-position\c 3127: \&\|'; other 88k 3128: configurations have the default `\|\c 3129: .B \-mno\-ocs\-frame\-position\c 3130: \&\|'. 3131: .TP 3132: .B \-moptimize\-arg\-area 3133: .TP 3134: .B \-mno\-optimize\-arg\-area 3135: Control how to store function arguments in stack frames. 3136: `\|\c 3137: .B \-moptimize\-arg\-area\c 3138: \&\|' saves space, but may break some 3139: debuggers (not GDB). `\|\c 3140: .B \-mno\-optimize\-arg\-area\c 3141: \&\|' conforms better to 3142: standards. By default GCC does not optimize the argument area. 3143: .TP 3144: .BI "\-mshort\-data\-" "num"\c 3145: \& 3146: .I num\c 3147: \& 3148: Generate smaller data references by making them relative to \c 3149: .B r0\c 3150: \&, 3151: which allows loading a value using a single instruction (rather than the 3152: usual two). You control which data references are affected by 3153: specifying \c 3154: .I num\c 3155: \& with this option. For example, if you specify 3156: `\|\c 3157: .B \-mshort\-data\-512\c 3158: \&\|', then the data references affected are those 3159: involving displacements of less than 512 bytes. 3160: `\|\c 3161: .B \-mshort\-data\-\c 3162: .I num\c 3163: \&\c 3164: \&\|' is not effective for \c 3165: .I num\c 3166: \& greater 3167: than 64K. 1.1.1.5 ! root 3168: .PP ! 3169: .B \-mserialize-volatile 1.1 root 3170: .TP 1.1.1.5 ! root 3171: .B \-mno-serialize-volatile ! 3172: Do, or do not, generate code to guarantee sequential consistency of ! 3173: volatile memory references. ! 3174: ! 3175: GNU CC always guarantees consistency by default, for the preferred ! 3176: processor submodel. How this is done depends on the submodel. ! 3177: ! 3178: The m88100 processor does not reorder memory references and so always ! 3179: provides sequential consistency. If you use `\|\c ! 3180: .B \-m88100\c ! 3181: \&\|', GNU CC does ! 3182: not generate any special instructions for sequential consistency. ! 3183: ! 3184: The order of memory references made by the m88110 processor does not ! 3185: always match the order of the instructions requesting those references. ! 3186: In particular, a load instruction may execute before a preceding store ! 3187: instruction. Such reordering violates sequential consistency of ! 3188: volatile memory references, when there are multiple processors. When ! 3189: you use `\|\c ! 3190: .B \-m88000\c ! 3191: \&\|' or `\|\c ! 3192: .B \-m88110\c ! 3193: \&\|', GNU CC generates special ! 3194: instructions when appropriate, to force execution in the proper order. ! 3195: ! 3196: The extra code generated to guarantee consistency may affect the ! 3197: performance of your application. If you know that you can safely forgo ! 3198: this guarantee, you may use the option `\|\c ! 3199: .B \-mno-serialize-volatile\c ! 3200: \&\|'. ! 3201: ! 3202: If you use the `\|\c ! 3203: .B \-m88100\c ! 3204: \&\|' option but require sequential consistency ! 3205: when running on the m88110 processor, you should use ! 3206: `\|\c ! 3207: .B \-mserialize-volatile\c ! 3208: \&\|'. ! 3209: .PP 1.1 root 3210: .B \-msvr4 3211: .TP 3212: .B \-msvr3 3213: Turn on (`\|\c 3214: .B \-msvr4\c 3215: \&\|') or off (`\|\c 3216: .B \-msvr3\c 3217: \&\|') compiler extensions 3218: related to System V release 4 (SVr4). This controls the following: 3219: .TP 3220: \ \ \ \(bu 3221: Which variant of the assembler syntax to emit (which you can select 3222: independently using `\|\c 1.1.1.5 ! root 3223: .B \-mversion\-03.00\c 1.1 root 3224: \&\|'). 3225: .TP 3226: \ \ \ \(bu 3227: `\|\c 3228: .B \-msvr4\c 3229: \&\|' makes the C preprocessor recognize `\|\c 3230: .B #pragma weak\c 3231: \&\|' 3232: .TP 3233: \ \ \ \(bu 3234: `\|\c 3235: .B \-msvr4\c 3236: \&\|' makes GCC issue additional declaration directives used in 3237: SVr4. 3238: .PP 3239: `\|\c 3240: .B \-msvr3\c 3241: \&\|' is the default for all m88K configurations except 3242: the SVr4 configuration. 3243: .TP 3244: .B \-mtrap\-large\-shift 3245: .TP 3246: .B \-mhandle\-large\-shift 3247: Include code to detect bit-shifts of more than 31 bits; respectively, 3248: trap such shifts or emit code to handle them properly. By default GCC 3249: makes no special provision for large bit shifts. 3250: .TP 3251: .B \-muse\-div\-instruction 3252: Very early models of the 88K architecture didn't have a divide 3253: instruction, so GCC avoids that instruction by default. Use this option 3254: to specify that it's safe to use the divide instruction. 3255: .TP 3256: .B \-mversion\-03.00 1.1.1.5 ! root 3257: In the DG/UX configuration, there are two flavors of SVr4. This option ! 3258: modifies ! 3259: .B \-msvr4 ! 3260: to select whether the hybrid-COFF or real-ELF ! 3261: flavor is used. All other configurations ignore this option. 1.1 root 3262: .TP 3263: .B \-mwarn\-passed\-structs 3264: Warn when a function passes a struct as an argument or result. 3265: Structure-passing conventions have changed during the evolution of the C 3266: language, and are often the source of portability problems. By default, 3267: GCC issues no such warning. 3268: .PP 3269: These options are defined for the IBM RS6000: 3270: 3271: .PP 3272: .B \-mfp\-in\-toc 3273: .TP 3274: .B \-mno\-fp\-in\-toc 3275: Control whether or not floating-point constants go in the Table of 3276: Contents (TOC), a table of all global variable and function addresses. By 3277: default GCC puts floating-point constants there; if the TOC overflows, 3278: `\|\c 3279: .B \-mno\-fp\-in\-toc\c 3280: \&\|' will reduce the size of the TOC, which may avoid 3281: the overflow. 3282: 3283: .PP 3284: These `\|\c 3285: .B \-m\c 3286: \&\|' options are defined for the IBM RT PC: 3287: .TP 3288: .B \-min\-line\-mul 3289: Use an in-line code sequence for integer multiplies. This is the 3290: default. 3291: .TP 3292: .B \-mcall\-lib\-mul 3293: Call \c 3294: .B lmul$$\c 3295: \& for integer multiples. 3296: .TP 3297: .B \-mfull\-fp\-blocks 3298: Generate full-size floating point data blocks, including the minimum 3299: amount of scratch space recommended by IBM. This is the default. 3300: .TP 3301: .B \-mminimum\-fp\-blocks 3302: Do not include extra scratch space in floating point data blocks. This 3303: results in smaller code, but slower execution, since scratch space must 3304: be allocated dynamically. 3305: .TP 3306: .B \-mfp\-arg\-in\-fpregs 3307: Use a calling sequence incompatible with the IBM calling convention in 3308: which floating point arguments are passed in floating point registers. 3309: Note that \c 3310: .B varargs.h\c 3311: \& and \c 3312: .B stdargs.h\c 3313: \& will not work with 3314: floating point operands if this option is specified. 3315: .TP 3316: .B \-mfp\-arg\-in\-gregs 3317: Use the normal calling convention for floating point arguments. This is 3318: the default. 3319: .TP 3320: .B \-mhc\-struct\-return 3321: Return structures of more than one word in memory, rather than in a 3322: register. This provides compatibility with the MetaWare HighC (hc) 3323: compiler. Use `\|\c 3324: .B \-fpcc\-struct\-return\c 3325: \&\|' for compatibility with the 3326: Portable C Compiler (pcc). 3327: .TP 3328: .B \-mnohc\-struct\-return 3329: Return some structures of more than one word in registers, when 3330: convenient. This is the default. For compatibility with the 3331: IBM-supplied compilers, use either `\|\c 3332: .B \-fpcc\-struct\-return\c 3333: \&\|' or 3334: `\|\c 3335: .B \-mhc\-struct\-return\c 3336: \&\|'. 3337: .PP 3338: These `\|\c 3339: .B \-m\c 3340: \&\|' options are defined for the MIPS family of computers: 3341: .TP 3342: .BI "\-mcpu=" "cpu-type" 3343: Assume the defaults for the machine type 3344: .I cpu-type 3345: when 1.1.1.3 root 3346: scheduling instructions. The default 1.1 root 3347: .I cpu-type 3348: is 3349: .BR default , 3350: which picks the longest cycles times for any of the machines, in order 3351: that the code run at reasonable rates on all MIPS cpu's. Other 3352: choices for 3353: .I cpu-type 3354: are 3355: .BR r2000 , 3356: .BR r3000 , 3357: .BR r4000 , 3358: and 3359: .BR r6000 . 3360: While picking a specific 3361: .I cpu-type 3362: will schedule things appropriately for that particular chip, the 3363: compiler will not generate any code that does not meet level 1 of the 3364: MIPS ISA (instruction set architecture) without the 3365: .B \-mips2 3366: or 3367: .B \-mips3 3368: switches being used. 3369: .TP 3370: .B \-mips2 3371: Issue instructions from level 2 of the MIPS ISA (branch likely, square 3372: root instructions). The 3373: .B \-mcpu=r4000 3374: or 3375: .B \-mcpu=r6000 1.1.1.3 root 3376: switch must be used in conjunction with 1.1 root 3377: .BR \-mips2 . 3378: .TP 3379: .B \-mips3 3380: Issue instructions from level 3 of the MIPS ISA (64 bit instructions). 3381: The 3382: .B \-mcpu=r4000 1.1.1.3 root 3383: switch must be used in conjunction with 1.1 root 3384: .BR \-mips2 . 3385: .TP 3386: .B \-mint64 3387: .TP 3388: .B \-mlong64 3389: .TP 3390: .B \-mlonglong128 3391: These options don't work at present. 3392: .TP 3393: .B \-mmips\-as 3394: Generate code for the MIPS assembler, and invoke 3395: .B mips\-tfile 3396: to add normal debug information. This is the default for all 3397: platforms except for the OSF/1 reference platform, using the OSF/rose 1.1.1.2 root 3398: object format. If any of the 1.1 root 3399: .BR \-ggdb , 3400: .BR \-gstabs , 3401: or 3402: .B \-gstabs+ 3403: switches are used, the 3404: .B mips\-tfile 3405: program will encapsulate the stabs within MIPS ECOFF. 3406: .TP 3407: .B \-mgas 3408: Generate code for the GNU assembler. This is the default on the OSF/1 3409: reference platform, using the OSF/rose object format. 3410: .TP 3411: .B \-mrnames 3412: .TP 3413: .B \-mno\-rnames 3414: The 3415: .B \-mrnames 3416: switch says to output code using the MIPS software names for the 3417: registers, instead of the hardware names (ie, 3418: .B a0 3419: instead of 3420: .BR $4 ). 3421: The GNU assembler does not support the 3422: .B \-mrnames 3423: switch, and the MIPS assembler will be instructed to run the MIPS C 3424: preprocessor over the source file. The 3425: .B \-mno\-rnames 3426: switch is default. 3427: .TP 3428: .B \-mgpopt 3429: .TP 3430: .B \-mno\-gpopt 3431: The 3432: .B \-mgpopt 3433: switch says to write all of the data declarations before the 3434: instructions in the text section, to all the MIPS assembler to 3435: generate one word memory references instead of using two words for 3436: short global or static data items. This is on by default if 3437: optimization is selected. 3438: .TP 3439: .B \-mstats 3440: .TP 3441: .B \-mno\-stats 3442: For each non-inline function processed, the 3443: .B \-mstats 3444: switch causes the compiler to emit one line to the standard error file 3445: to print statistics about the program (number of registers saved, 3446: stack size, etc.). 3447: .TP 3448: .B \-mmemcpy 3449: .TP 3450: .B \-mno\-memcpy 3451: The 3452: .B \-mmemcpy 3453: switch makes all block moves call the appropriate string function 3454: .RB ( memcpy 3455: or 3456: .BR bcopy ) 3457: instead of possibly generating inline code. 3458: .TP 3459: .B \-mmips\-tfile 3460: .TP 3461: .B \-mno\-mips\-tfile 3462: The 3463: .B \-mno\-mips\-tfile 3464: switch causes the compiler not postprocess the object file with the 3465: .B mips\-tfile 3466: program, after the MIPS assembler has generated it to add debug 3467: support. If 3468: .B mips\-tfile 3469: is not run, then no local variables will be available to the debugger. 3470: In addition, 3471: .B stage2 3472: and 3473: .B stage3 3474: objects will have the temporary file names passed to the assembler 3475: embedded in the object file, which means the objects will not compare 3476: the same. 3477: .TP 3478: .B \-msoft\-float 3479: Generate output containing library calls for floating point. 3480: .I 3481: WARNING: 3482: the requisite libraries are not part of GNU CC. Normally the 3483: facilities of the machine's usual C compiler are used, but this can't 3484: be done directly in cross-compilation. You must make your own 3485: arrangements to provide suitable library functions for cross-compilation. 3486: .TP 3487: .B \-mhard\-float 3488: Generate output containing floating point instructions. This is the 3489: default if you use the unmodified sources. 3490: .TP 3491: .B \-mfp64 3492: Assume that the 3493: .B FR 3494: bit in the status word is on, and that there are 32 64-bit floating 3495: point registers, instead of 32 32-bit floating point registers. You 3496: must also specify the 3497: .B \-mcpu=r4000 3498: and 3499: .B \-mips3 3500: switches. 3501: .TP 3502: .B \-mfp32 3503: Assume that there are 32 32-bit floating point registers. This is the 3504: default. 1.1.1.5 ! root 3505: .PP 1.1 root 3506: .B \-mabicalls 1.1.1.5 ! root 3507: .TP ! 3508: .B \-mno\-abicalls ! 3509: Emit (or do not emit) the 1.1 root 3510: .BR \&.abicalls , 3511: .BR \&.cpload , 3512: and 3513: .B \&.cprestore 3514: pseudo operations that some System V.4 ports use for position 3515: independent code. 3516: .TP 3517: .B \-mhalf\-pic 3518: .TP 3519: .B \-mno\-half\-pic 3520: The 3521: .B \-mhalf\-pic 3522: switch says to put pointers to extern references into the data section 3523: and load them up, rather than put the references in the text section. 3524: This option does not work at present. 3525: .B 3526: .BI \-G num 3527: Put global and static items less than or equal to 3528: .I num 3529: bytes into the small data or bss sections instead of the normal data 3530: or bss section. This allows the assembler to emit one word memory 3531: reference instructions based on the global pointer 3532: .RB ( gp 3533: or 3534: .BR $28 ), 3535: instead of the normal two words used. By default, 3536: .I num 3537: is 8 when the MIPS assembler is used, and 0 when the GNU 3538: assembler is used. The 3539: .BI \-G num 3540: switch is also passed to the assembler and linker. All modules should 3541: be compiled with the same 3542: .BI \-G num 3543: value. 1.1.1.5 ! root 3544: .TP ! 3545: .B \-nocpp ! 3546: Tell the MIPS assembler to not run it's preprocessor over user ! 3547: assembler files (with a `\|\c ! 3548: .B .s\c ! 3549: \&\|' suffix) when assembling them. ! 3550: .PP ! 3551: These `\|\c ! 3552: .B \-m\c ! 3553: \&\|' options are defined for the Intel 80386 family of computers: ! 3554: ! 3555: .B \-m486 ! 3556: .TP ! 3557: .B \-mno\-486 ! 3558: Control whether or not code is optimized for a 486 instead of an ! 3559: 386. Code generated for a 486 will run on a 386 and vice versa. ! 3560: .TP ! 3561: .B \-msoft\-float ! 3562: Generate output containing library calls for floating point. ! 3563: .I Warning: ! 3564: the requisite libraries are not part of GNU CC. ! 3565: Normally the facilities of the machine's usual C compiler are used, but ! 3566: this can't be done directly in cross-compilation. You must make your ! 3567: own arrangements to provide suitable library functions for ! 3568: cross-compilation. ! 3569: ! 3570: On machines where a function returns floating point results in the 80387 ! 3571: register stack, some floating point opcodes may be emitted even if ! 3572: `\|\c ! 3573: .B \-msoft-float\c ! 3574: \&\|' is used. ! 3575: .TP ! 3576: .B \-mno-fp-ret-in-387 ! 3577: Do not use the FPU registers for return values of functions. ! 3578: ! 3579: The usual calling convention has functions return values of types ! 3580: \c ! 3581: .B float\c ! 3582: \& and \c ! 3583: .B double\c ! 3584: \& in an FPU register, even if there ! 3585: is no FPU. The idea is that the operating system should emulate ! 3586: an FPU. ! 3587: ! 3588: The option `\|\c ! 3589: .B \-mno-fp-ret-in-387\c ! 3590: \&\|' causes such values to be returned ! 3591: in ordinary CPU registers instead. ! 3592: .PP ! 3593: These `\|\c ! 3594: .B \-m\c ! 3595: \&\|' options are defined for the HPPA family of computers: ! 3596: .TP ! 3597: .B \-mpa-risc-1-0 ! 3598: Generate code for a PA 1.0 processor. ! 3599: .TP ! 3600: .B \-mpa-risc-1-1 ! 3601: Generate code for a PA 1.1 processor. ! 3602: .TP ! 3603: .B \-mkernel ! 3604: Generate code which is suitable for use in kernels. Specifically, avoid ! 3605: \c ! 3606: .B add\c ! 3607: \& instructions in which one of the arguments is the DP register; ! 3608: generate \c ! 3609: .B addil\c ! 3610: \& instructions instead. This avoids a rather serious ! 3611: bug in the HP-UX linker. ! 3612: .TP ! 3613: .B \-mshared-libs ! 3614: Generate code that can be linked against HP-UX shared libraries. This option ! 3615: is not fully function yet, and is not on by default for any PA target. Using ! 3616: this option can cause incorrect code to be generated by the compiler. ! 3617: .TP ! 3618: .B \-mno-shared-libs ! 3619: Don't generate code that will be linked against shared libraries. This is ! 3620: the default for all PA targets. ! 3621: .TP ! 3622: .B \-mlong-calls ! 3623: Generate code which allows calls to functions greater than 256K away from ! 3624: the caller when the caller and callee are in the same source file. Do ! 3625: not turn this option on unless code refuses to link with "branch out of ! 3626: range errors" from the linker. ! 3627: .TP ! 3628: .B \-mdisable-fpregs ! 3629: Prevent floating point registers from being used in any manner. This is ! 3630: necessary for compiling kernels which perform lazy context switching of ! 3631: floating point registers. If you use this option and attempt to perform ! 3632: floating point operations, the compiler will abort. ! 3633: .TP ! 3634: .B \-mdisable-indexing ! 3635: Prevent the compiler from using indexing address modes. This avoids some ! 3636: rather obscure problems when compiling MIG generated code under MACH. ! 3637: .TP ! 3638: .B \-mtrailing-colon ! 3639: Add a colon to the end of label definitions (for ELF assemblers). ! 3640: .PP ! 3641: These `\|\c ! 3642: .B \-m\c ! 3643: \&\|' options are defined for the Intel 80960 family of computers: ! 3644: .TP ! 3645: .BI "\-m" "cpu-type" ! 3646: Assume the defaults for the machine type ! 3647: .I cpu-type ! 3648: for instruction and addressing-mode availability and alignment. ! 3649: The default ! 3650: .I cpu-type ! 3651: is ! 3652: .BR kb ; ! 3653: other choices are ! 3654: .BR ka , ! 3655: .BR mc , ! 3656: .BR ca , ! 3657: .BR cf , ! 3658: .BR sa , ! 3659: and ! 3660: .BR sb . ! 3661: .TP ! 3662: .B \-mnumerics ! 3663: .TP ! 3664: .B \-msoft\-float ! 3665: The ! 3666: .B \-mnumerics ! 3667: option indicates that the processor does support ! 3668: floating-point instructions. The ! 3669: .B \-msoft\-float ! 3670: option indicates ! 3671: that floating-point support should not be assumed. ! 3672: .TP ! 3673: .B \-mleaf\-procedures ! 3674: .TP ! 3675: .B \-mno\-leaf\-procedures ! 3676: Do (or do not) attempt to alter leaf procedures to be callable with the ! 3677: .I bal ! 3678: instruction as well as ! 3679: .IR call . ! 3680: This will result in more ! 3681: efficient code for explicit calls when the ! 3682: .I bal ! 3683: instruction can be ! 3684: substituted by the assembler or linker, but less efficient code in other ! 3685: cases, such as calls via function pointers, or using a linker that doesn't ! 3686: support this optimization. ! 3687: .TP ! 3688: .B \-mtail\-call ! 3689: .TP ! 3690: .B \-mno\-tail\-call ! 3691: Do (or do not) make additional attempts (beyond those of the ! 3692: machine-independent portions of the compiler) to optimize tail-recursive ! 3693: calls into branches. You may not want to do this because the detection of ! 3694: cases where this is not valid is not totally complete. The default is ! 3695: .BR \-mno\-tail\-call . ! 3696: .TP ! 3697: .B \-mcomplex\-addr ! 3698: .TP ! 3699: .B \-mno\-complex\-addr ! 3700: Assume (or do not assume) that the use of a complex addressing mode is a ! 3701: win on this implementation of the i960. Complex addressing modes may not ! 3702: be worthwhile on the K-series, but they definitely are on the C-series. ! 3703: The default is currently ! 3704: .B \-mcomplex\-addr ! 3705: for all processors except ! 3706: the CB and CC. ! 3707: .TP ! 3708: .B \-mcode\-align ! 3709: .TP ! 3710: .B \-mno\-code\-align ! 3711: Align code to 8-byte boundaries for faster fetching (or don't bother). ! 3712: Currently turned on by default for C-series implementations only. ! 3713: .TP ! 3714: .B \-mic\-compat ! 3715: .TP ! 3716: .B \-mic2.0\-compat ! 3717: .TP ! 3718: .B \-mic3.0\-compat ! 3719: Enable compatibility with iC960 v2.0 or v3.0. ! 3720: .TP ! 3721: .B \-masm\-compat ! 3722: .TP ! 3723: .B \-mintel\-asm ! 3724: Enable compatibility with the iC960 assembler. ! 3725: .TP ! 3726: .B \-mstrict\-align ! 3727: .TP ! 3728: .B \-mno\-strict\-align ! 3729: Do not permit (do permit) unaligned accesses. ! 3730: .TP ! 3731: .B \-mold\-align ! 3732: Enable structure-alignment compatibility with Intel's gcc release version ! 3733: 1.3 (based on gcc 1.37). Currently this is buggy in that ! 3734: .B #pragma align 1 ! 3735: is always assumed as well, and cannot be turned off. ! 3736: .PP ! 3737: These `\|\c ! 3738: .B \-m\c ! 3739: \&\|' options are defined for the DEC Alpha implementations: ! 3740: .TP ! 3741: .B \-mno-soft-float ! 3742: .TP ! 3743: .B \-msoft-float ! 3744: Use (do not use) the hardware floating-point instructions for ! 3745: floating-point operations. When \c ! 3746: .B \-msoft-float\c ! 3747: \& is specified, ! 3748: functions in `\|\c ! 3749: .B libgcc1.c\c ! 3750: \&\|' will be used to perform floating-point ! 3751: operations. Unless they are replaced by routines that emulate the ! 3752: floating-point operations, or compiled in such a way as to call such ! 3753: emulations routines, these routines will issue floating-point ! 3754: operations. If you are compiling for an Alpha without floating-point ! 3755: operations, you must ensure that the library is built so as not to call ! 3756: them. ! 3757: ! 3758: Note that Alpha implementations without floating-point operations are ! 3759: required to have floating-point registers. ! 3760: .TP ! 3761: .B \-mfp-reg ! 3762: .TP ! 3763: .B \-mno-fp-regs ! 3764: Generate code that uses (does not use) the floating-point register set. ! 3765: .B \-mno-fp-regs\c ! 3766: \& implies \c ! 3767: .B \-msoft-float\c ! 3768: \&. If the floating-point ! 3769: register set is not used, floating point operands are passed in integer ! 3770: registers as if they were integers and floating-point results are passed ! 3771: in $0 instead of $f0. This is a non-standard calling sequence, so any ! 3772: function with a floating-point argument or return value called by code ! 3773: compiled with \c ! 3774: .B \-mno-fp-regs\c ! 3775: \& must also be compiled with that ! 3776: option. ! 3777: ! 3778: A typical use of this option is building a kernel that does not use, ! 3779: and hence need not save and restore, any floating-point registers. ! 3780: .PP ! 3781: These additional options are available on System V Release 4 for ! 3782: compatibility with other compilers on those systems: ! 3783: .TP ! 3784: .B \-G ! 3785: On SVr4 systems, \c ! 3786: .B gcc\c ! 3787: \& accepts the option `\|\c ! 3788: .B \-G\c ! 3789: \&\|' (and passes ! 3790: it to the system linker), for compatibility with other compilers. ! 3791: However, we suggest you use `\|\c ! 3792: .B \-symbolic\c ! 3793: \&\|' or `\|\c ! 3794: .B \-shared\c ! 3795: \&\|' as ! 3796: appropriate, instead of supplying linker options on the \c ! 3797: .B gcc\c ! 3798: \& ! 3799: command line. ! 3800: .TP ! 3801: .B \-Qy ! 3802: Identify the versions of each tool used by the compiler, in a ! 3803: \c ! 3804: .B .ident\c ! 3805: \& assembler directive in the output. ! 3806: .TP ! 3807: .B \-Qn ! 3808: Refrain from adding \c ! 3809: .B .ident\c ! 3810: \& directives to the output file (this is ! 3811: the default). ! 3812: .TP ! 3813: .BI "-YP," "dirs"\c ! 3814: \& ! 3815: Search the directories \c ! 3816: .I dirs\c ! 3817: \&, and no others, for libraries ! 3818: specified with `\|\c ! 3819: .B \-l\c ! 3820: \&\|'. You can separate directory entries in ! 3821: \c ! 3822: .I dirs\c ! 3823: \& from one another with colons. ! 3824: .TP ! 3825: .BI "-Ym," "dir"\c ! 3826: \& ! 3827: Look in the directory \c ! 3828: .I dir\c ! 3829: \& to find the M4 preprocessor. ! 3830: The assembler uses this option. 1.1 root 3831: .PP 3832: 3833: .SH CODE GENERATION OPTIONS 3834: These machine-independent options control the interface conventions 3835: used in code generation. 3836: 3837: Most of them begin with `\|\c 3838: \-f\c 3839: \&\|'. These options have both positive and negative forms; the negative form 3840: of `\|\c 3841: .B \-ffoo\c 3842: \&\|' would be `\|\c 3843: .B \-fno\-foo\c 3844: \&\|'. In the table below, only 3845: one of the forms is listed\(em\&the one which is not the default. You 3846: can figure out the other form by either removing `\|\c 3847: .B no\-\c 3848: \&\|' or adding 3849: it. 3850: .TP 3851: .B \-fnonnull\-objects 1.1.1.5 ! root 3852: Assume that objects reached through references are not null ! 3853: (C++ only). ! 3854: 1.1 root 3855: Normally, GNU C++ makes conservative assumptions about objects reached 1.1.1.5 ! root 3856: through references. For example, the compiler must check that \c 1.1 root 3857: .B a\c 1.1.1.5 ! root 3858: \& ! 3859: is not null in code like the following: ! 3860: ! 3861: .sp 1.1 root 3862: .br 1.1.1.5 ! root 3863: obj\ &a\ =\ g\ (); 1.1 root 3864: .br 1.1.1.5 ! root 3865: a.f\ (2); 1.1 root 3866: .br 1.1.1.5 ! root 3867: .sp ! 3868: 1.1 root 3869: Checking that references of this sort have non-null values requires 3870: extra code, however, and it is unnecessary for many programs. You can 3871: use `\|\c 1.1.1.5 ! root 3872: .B \-fnonnull-objects\c ! 3873: \&\|' to omit the checks for null, if your ! 3874: program doesn't require checking. 1.1 root 3875: .TP 3876: .B \-fpcc\-struct\-return 3877: Use the same convention for returning \c 3878: .B struct\c 3879: \& and \c 3880: .B union\c 3881: \& 3882: values that is used by the usual C compiler on your system. This 3883: convention is less efficient for small structures, and on many 3884: machines it fails to be reentrant; but it has the advantage of 3885: allowing intercallability between GCC-compiled code and PCC-compiled 3886: code. 3887: .TP 1.1.1.5 ! root 3888: .B \-freg\-struct\-return ! 3889: Use the convention that ! 3890: .B struct ! 3891: and ! 3892: .B union ! 3893: values are returned in registers when possible. This is more ! 3894: efficient for small structures than ! 3895: .BR \-fpcc\-struct\-return . ! 3896: ! 3897: If you specify neither ! 3898: .B \-fpcc\-struct\-return ! 3899: nor ! 3900: .BR \-freg\-struct\-return , ! 3901: GNU CC defaults to whichever convention is standard for the target. ! 3902: If there is no standard convention, GNU CC defaults to ! 3903: .BR \-fpcc\-struct\-return . ! 3904: .TP 1.1 root 3905: .B \-fshort\-enums 3906: Allocate to an \c 3907: .B enum\c 3908: \& type only as many bytes as it needs for the 3909: declared range of possible values. Specifically, the \c 3910: .B enum\c 3911: \& type 3912: will be equivalent to the smallest integer type which has enough room. 3913: .TP 3914: .B \-fshort\-double 3915: Use the same size for 3916: .B double 3917: as for 3918: .B float 3919: \&. 3920: .TP 3921: .B \-fshared\-data 3922: Requests that the data and non-\c 3923: .B const\c 3924: \& variables of this 3925: compilation be shared data rather than private data. The distinction 3926: makes sense only on certain operating systems, where shared data is 3927: shared between processes running the same program, while private data 3928: exists in one copy per process. 3929: .TP 3930: .B \-fno\-common 3931: Allocate even uninitialized global variables in the bss section of the 3932: object file, rather than generating them as common blocks. This has the 3933: effect that if the same variable is declared (without \c 3934: .B extern\c 3935: \&) in 3936: two different compilations, you will get an error when you link them. 3937: The only reason this might be useful is if you wish to verify that the 3938: program will work on other systems which always work this way. 3939: .TP 1.1.1.5 ! root 3940: .B \-fno\-ident ! 3941: Ignore the `\|\c ! 3942: .B #ident\c ! 3943: \&\|' directive. ! 3944: .TP ! 3945: .B \-fno\-gnu\-linker ! 3946: Do not output global initializations (such as C++ constructors and ! 3947: destructors) in the form used by the GNU linker (on systems where the GNU ! 3948: linker is the standard method of handling them). Use this option when ! 3949: you want to use a non-GNU linker, which also requires using the ! 3950: \c ! 3951: .B collect2\c ! 3952: \& program to make sure the system linker includes ! 3953: constructors and destructors. (\c ! 3954: .B collect2\c ! 3955: \& is included in the GNU CC ! 3956: distribution.) For systems which \c ! 3957: .I must\c ! 3958: \& use \c ! 3959: .B collect2\c ! 3960: \&, the ! 3961: compiler driver \c ! 3962: .B gcc\c ! 3963: \& is configured to do this automatically. ! 3964: .TP ! 3965: .B \-finhibit-size-directive ! 3966: Don't output a \c ! 3967: .B .size\c ! 3968: \& assembler directive, or anything else that ! 3969: would cause trouble if the function is split in the middle, and the ! 3970: two halves are placed at locations far apart in memory. This option is ! 3971: used when compiling `\|\c ! 3972: .B crtstuff.c\c ! 3973: \&\|'; you should not need to use it ! 3974: for anything else. ! 3975: .TP ! 3976: .B \-fverbose-asm ! 3977: Put extra commentary information in the generated assembly code to ! 3978: make it more readable. This option is generally only of use to those ! 3979: who actually need to read the generated assembly code (perhaps while ! 3980: debugging the compiler itself). ! 3981: .TP 1.1 root 3982: .B \-fvolatile 3983: Consider all memory references through pointers to be volatile. 3984: .TP 1.1.1.5 ! root 3985: .B \-fvolatile\-global ! 3986: Consider all memory references to extern and global data items to ! 3987: be volatile. ! 3988: .TP 1.1 root 3989: .B \-fpic 3990: If supported for the target machines, generate position-independent code, 3991: suitable for use in a shared library. 3992: .TP 3993: .B \-fPIC 3994: If supported for the target machine, emit position-independent code, 3995: suitable for dynamic linking, even if branches need large displacements. 3996: .TP 3997: .BI "\-ffixed\-" "reg"\c 3998: \& 3999: Treat the register named \c 4000: .I reg\c 4001: \& as a fixed register; generated code 4002: should never refer to it (except perhaps as a stack pointer, frame 4003: pointer or in some other fixed role). 4004: 4005: \c 4006: .I reg\c 4007: \& must be the name of a register. The register names accepted 4008: are machine-specific and are defined in the \c 4009: .B REGISTER_NAMES\c 4010: \& 4011: macro in the machine description macro file. 4012: 4013: This flag does not have a negative form, because it specifies a 4014: three-way choice. 4015: .TP 4016: .BI "\-fcall\-used\-" "reg"\c 4017: \& 4018: Treat the register named \c 4019: .I reg\c 4020: \& as an allocatable register that is 4021: clobbered by function calls. It may be allocated for temporaries or 4022: variables that do not live across a call. Functions compiled this way 4023: will not save and restore the register \c 4024: .I reg\c 4025: \&. 4026: 4027: Use of this flag for a register that has a fixed pervasive role in the 4028: machine's execution model, such as the stack pointer or frame pointer, 4029: will produce disastrous results. 4030: 4031: This flag does not have a negative form, because it specifies a 4032: three-way choice. 4033: .TP 4034: .BI "\-fcall\-saved\-" "reg"\c 4035: \& 4036: Treat the register named \c 4037: .I reg\c 4038: \& as an allocatable register saved by 4039: functions. It may be allocated even for temporaries or variables that 4040: live across a call. Functions compiled this way will save and restore 4041: the register \c 4042: .I reg\c 4043: \& if they use it. 4044: 4045: Use of this flag for a register that has a fixed pervasive role in the 4046: machine's execution model, such as the stack pointer or frame pointer, 4047: will produce disastrous results. 4048: 4049: A different sort of disaster will result from the use of this flag for 4050: a register in which function values may be returned. 4051: 4052: This flag does not have a negative form, because it specifies a 4053: three-way choice. 4054: .PP 4055: 4056: .SH PRAGMAS 4057: Two `\|\c 4058: .B #pragma\c 4059: \&\|' directives are supported for GNU C++, to permit using the same 4060: header file for two purposes: as a definition of interfaces to a given 4061: object class, and as the full definition of the contents of that object class. 4062: .TP 4063: .B #pragma interface 1.1.1.5 ! root 4064: (C++ only.) 1.1 root 4065: Use this directive in header files that define object classes, to save 4066: space in most of the object files that use those classes. Normally, 4067: local copies of certain information (backup copies of inline member 4068: functions, debugging information, and the internal tables that 4069: implement virtual functions) must be kept in each object file that 4070: includes class definitions. You can use this pragma to avoid such 4071: duplication. When a header file containing `\|\c 4072: .B #pragma interface\c 4073: \&\|' is included in a compilation, this auxiliary information 4074: will not be generated (unless the main input source file itself uses 4075: `\|\c 4076: .B #pragma implementation\c 4077: \&\|'). Instead, the object files will contain references to be 4078: resolved at link time. 4079: .tr !" 4080: .TP 4081: .B #pragma implementation 4082: .TP 4083: .BI "#pragma implementation !" objects .h! 1.1.1.5 ! root 4084: (C++ only.) 1.1 root 4085: Use this pragma in a main input file, when you want full output from 4086: included header files to be generated (and made globally visible). 4087: The included header file, in turn, should use `\|\c 4088: .B #pragma interface\c 4089: \&\|'. 4090: Backup copies of inline member functions, debugging information, and 4091: the internal tables used to implement virtual functions are all 4092: generated in implementation files. 4093: 4094: If you use `\|\c 4095: .B #pragma implementation\c 4096: \&\|' with no argument, it applies to an include file with the same 4097: basename as your source file; for example, in `\|\c 4098: .B allclass.cc\c 4099: \&\|', `\|\c 4100: .B #pragma implementation\c 4101: \&\|' by itself is equivalent to `\|\c 4102: .B 4103: #pragma implementation "allclass.h"\c 4104: \&\|'. Use the string argument if you want a single implementation 4105: file to include code from multiple header files. 4106: 4107: There is no way to split up the contents of a single header file into 4108: multiple implementation files. 4109: .SH FILES 4110: .ta \w'LIBDIR/g++\-include 'u 4111: file.c C source file 4112: .br 4113: file.h C header (preprocessor) file 4114: .br 4115: file.i preprocessed C source file 4116: .br 4117: file.C C++ source file 4118: .br 4119: file.cc C++ source file 4120: .br 4121: file.cxx C++ source file 4122: .br 4123: file.m Objective-C source file 4124: .br 4125: file.s assembly language file 4126: .br 4127: file.o object file 4128: .br 4129: a.out link edited output 4130: .br 4131: \fITMPDIR\fR/cc\(** temporary files 4132: .br 4133: \fILIBDIR\fR/cpp preprocessor 4134: .br 4135: \fILIBDIR\fR/cc1 compiler for C 4136: .br 4137: \fILIBDIR\fR/cc1plus compiler for C++ 4138: .br 4139: \fILIBDIR\fR/collect linker front end needed on some machines 4140: .br 4141: \fILIBDIR\fR/libgcc.a GCC subroutine library 4142: .br 4143: /lib/crt[01n].o start-up routine 4144: .br 4145: \fILIBDIR\fR/ccrt0 additional start-up routine for C++ 4146: .br 4147: /lib/libc.a standard C library, see 4148: .IR intro (3) 4149: .br 4150: /usr/include standard directory for 4151: .B #include 4152: files 4153: .br 4154: \fILIBDIR\fR/include standard gcc directory for 4155: .B #include 4156: files 4157: .br 4158: \fILIBDIR\fR/g++\-include additional g++ directory for 4159: .B #include 4160: .sp 4161: .I LIBDIR 4162: is usually 4163: .B /usr/local/lib/\c 4164: .IR machine / version . 4165: .br 4166: .I TMPDIR 4167: comes from the environment variable 4168: .B TMPDIR 4169: (default 4170: .B /usr/tmp 4171: if available, else 4172: .B /tmp\c 4173: \&). 4174: .SH "SEE ALSO" 4175: cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1). 4176: .br 4177: .RB "`\|" gcc "\|', `\|" cpp \|', 4178: .RB `\| as \|', `\| ld \|', 4179: and 4180: .RB `\| gdb \|' 4181: entries in 4182: .B info\c 4183: \&. 4184: .br 4185: .I 4186: Using and Porting GNU CC (for version 2.0)\c 1.1.1.5 ! root 4187: , Richard M. Stallman; 1.1 root 4188: .I 4189: The C Preprocessor\c 1.1.1.5 ! root 4190: , Richard M. Stallman; 1.1 root 4191: .I 1.1.1.5 ! root 4192: Debugging with GDB: the GNU Source-Level Debugger\c ! 4193: , Richard M. Stallman and Roland H. Pesch; 1.1 root 4194: .I 4195: Using as: the GNU Assembler\c 1.1.1.5 ! root 4196: , Dean Elsner, Jay Fenlason & friends; 1.1 root 4197: .I 1.1.1.5 ! root 4198: ld: the GNU linker\c ! 4199: , Steve Chamberlain and Roland Pesch. 1.1 root 4200: 4201: .SH BUGS 1.1.1.5 ! root 4202: For instructions on reporting bugs, see the GCC manual. ! 4203: 1.1 root 4204: .SH COPYING 1.1.1.5 ! root 4205: Copyright (c) 1991, 1992, 1993 Free Software Foundation, Inc. 1.1 root 4206: .PP 4207: Permission is granted to make and distribute verbatim copies of 4208: this manual provided the copyright notice and this permission notice 4209: are preserved on all copies. 4210: .PP 4211: Permission is granted to copy and distribute modified versions of this 4212: manual under the conditions for verbatim copying, provided that the 4213: entire resulting derived work is distributed under the terms of a 4214: permission notice identical to this one. 4215: .PP 4216: Permission is granted to copy and distribute translations of this 4217: manual into another language, under the above conditions for modified 4218: versions, except that this permission notice may be included in 4219: translations approved by the Free Software Foundation instead of in 4220: the original English. 4221: .SH AUTHORS 4222: See the GNU CC Manual for the contributors to GNU CC.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.