]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common.opt
PR translation/79183
[thirdparty/gcc.git] / gcc / common.opt
CommitLineData
3272db82 1; Options for the language- and target-independent parts of the compiler.
2e9da478 2
fbd26352 3; Copyright (C) 2003-2019 Free Software Foundation, Inc.
3272db82 4;
5; This file is part of GCC.
6;
7; GCC is free software; you can redistribute it and/or modify it under
8; the terms of the GNU General Public License as published by the Free
8c4c00c1 9; Software Foundation; either version 3, or (at your option) any later
3272db82 10; version.
a0c938f0 11;
3272db82 12; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13; WARRANTY; without even the implied warranty of MERCHANTABILITY or
14; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15; for more details.
a0c938f0 16;
3272db82 17; You should have received a copy of the GNU General Public License
8c4c00c1 18; along with GCC; see the file COPYING3. If not see
19; <http://www.gnu.org/licenses/>.
3272db82 20
a4b0007b 21; See the GCC internals manual (options.texi) for a description of this file's format.
3272db82 22
23; Please try to keep this file in ASCII collating order.
24
0f8defe5 25Variable
26int target_flags
27
2c5d2e39 28Variable
29int optimize
30
31Variable
32int optimize_size
33
9b0d2865 34Variable
35int optimize_debug
36
d2807aa3 37; Not used directly to control optimizations, only to save -Ofast
38; setting for "optimize" attributes.
39Variable
40int optimize_fast
41
90336809 42; True if this is the lto front end. This is used to disable gimple
43; generation and lowering passes that are normally run on the output
44; of a front end. These passes must be bypassed for lto since they
45; have already been done before the gimple was written.
46Variable
47bool in_lto_p = false
48
4c4a180d 49; This variable is set to non-0 only by LTO front-end. 1 indicates that
50; the output produced will be used for incrmeental linking (thus weak symbols
278cec16 51; can still be bound) and 2 indicates that the IL is going to be linked and
52; and output to LTO object file.
4c4a180d 53Variable
278cec16 54enum incremental_link flag_incremental_link = INCREMENTAL_LINK_NONE
4c4a180d 55
f3f006ad 56; 0 means straightforward implementation of complex divide acceptable.
57; 1 means wide ranges of inputs must work for complex divide.
58; 2 means C99-like requirements for complex multiply and divide.
59Variable
60int flag_complex_method = 1
61
f3f006ad 62; Language specific warning pass for unused results.
63Variable
64bool flag_warn_unused_result = false
65
56f280c4 66Variable
67int *param_values
68
6bd9d862 69; Nonzero if we should write GIMPLE bytecode for link-time optimization.
70Variable
71int flag_generate_lto
72
9f28dc4c 73; Nonzero if we should write GIMPLE bytecode for offload compilation.
74Variable
75int flag_generate_offload = 0
76
6bd9d862 77; Nonzero means we should be saving declaration info into a .X file.
78Variable
79int flag_gen_aux_info = 0
80
81; Nonzero if we are compiling code for a shared library, zero for
82; executable.
83Variable
84int flag_shlib
85
470a0ecd 86; These two are really VEC(char_p,heap) *.
87
88Variable
89void *flag_instrument_functions_exclude_functions
90
91Variable
92void *flag_instrument_functions_exclude_files
93
d7175aef 94; Generic structs (e.g. templates not explicitly specialized)
95; may not have a compilation unit associated with them, and so
96; may need to be treated differently from ordinary structs.
97;
98; Structs only handled by reference (indirectly), will also usually
99; not need as much debugging information.
100
101Variable
102enum debug_struct_file debug_struct_ordinary[DINFO_USAGE_NUM_ENUMS] = { DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY }
103
104Variable
105enum debug_struct_file debug_struct_generic[DINFO_USAGE_NUM_ENUMS] = { DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY }
106
cc4fa57a 107; True if we should exit after parsing options.
108Variable
109bool exit_after_options
110
111; Type(s) of debugging information we are producing (if any). See
112; flag-types.h for the definitions of the different possible types of
113; debugging information.
114Variable
115enum debug_info_type write_symbols = NO_DEBUG
116
117; Level of debugging information we are producing. See flag-types.h
118; for the definitions of the different possible levels.
119Variable
120enum debug_info_levels debug_info_level = DINFO_LEVEL_NONE
121
122; Nonzero means use GNU-only extensions in the generated symbolic
123; debugging information. Currently, this only has an effect when
dc75b246 124; write_symbols is set to DBX_DEBUG or XCOFF_DEBUG.
cc4fa57a 125Variable
126bool use_gnu_debug_info_extensions
127
9faf44d6 128; Original value of maximum field alignment in bytes, specified via
129; -fpack-struct=<value>.
130Variable
131unsigned int initial_max_fld_align = TARGET_DEFAULT_PACK_STRUCT
132
ab3728ee 133; Type of stack check.
134Variable
135enum stack_check_type flag_stack_check = NO_STACK_CHECK
136
8c0dd614 137; True if stack usage information needs to be computed.
138Variable
139bool flag_stack_usage_info = false
140
9faf44d6 141; -dA causes debug commentary information to be produced in
142; the generated assembly code (to make it more readable). This option
143; is generally only of use to those who actually need to read the
144; generated assembly code (perhaps while debugging the compiler itself).
145; Currently, this switch is only used by dwarf2out.c; however, it is intended
146; to be a catchall for printing debug information in the assembler file.
147Variable
148int flag_debug_asm
149
e6c4532a 150; How many NOP insns to place at each function entry by default
151Variable
152HOST_WIDE_INT function_entry_patch_area_size
153
154; And how far the real asm entry point is into this area
155Variable
156HOST_WIDE_INT function_entry_patch_area_start
f78f10d6 157
158; Balance between GNAT encodings and standard DWARF to emit.
159Variable
160enum dwarf_gnat_encodings gnat_encodings = DWARF_GNAT_ENCODINGS_DEFAULT
161
9faf44d6 162; -dP causes the rtl to be emitted as a comment in assembly.
163Variable
164int flag_dump_rtl_in_asm
165
166; Whether -da was passed (used only in handle_common_deferred_options).
167Variable
168bool flag_dump_all_passed
169
170; Other flags saying which kinds of debugging dump have been requested.
171
172Variable
173int rtl_dump_and_exit
174
175Variable
176int flag_print_asm_name
177
0e763b2a 178; Name of top-level original source file (what was input to cpp).
179; This comes from the #-command at the beginning of the actual input.
180; If there isn't any there, then this is the cc1 input file name.
181Variable
182const char *main_input_filename
183
184; Pointer to base name in main_input_filename, with directories and a
185; single final extension removed, and the length of this base
186; name.
187
188Variable
189const char *main_input_basename
190
191Variable
192int main_input_baselength
193
9faf44d6 194; Which options have been printed by --help.
195Variable
196char *help_printed
197
d62a5950 198; Which enums have been printed by --help. 0 = not printed, no
199; relevant options seen, 1 = relevant option seen, not yet printed, 2
200; = printed.
201Variable
202char *help_enum_printed
203
9faf44d6 204; The number of columns for --help output.
205Variable
206unsigned int help_columns
207
208; Whether this options structure has been through finish_options
209Variable
210bool flag_opts_finished
211
9e46467d 212; What the sanitizer should instrument
213Variable
214unsigned int flag_sanitize
215
c2598081 216; What sanitizers should recover from errors
217Variable
9917317a 218unsigned int flag_sanitize_recover = (SANITIZE_UNDEFINED | SANITIZE_UNDEFINED_NONDEFAULT | SANITIZE_KERNEL_ADDRESS) & ~(SANITIZE_UNREACHABLE | SANITIZE_RETURN)
c2598081 219
ccec7674 220; What the coverage sanitizers should instrument
221Variable
222unsigned int flag_sanitize_coverage
d29e939c 223
6aaca0b4 224; Flag whether a prefix has been added to dump_base_name
225Variable
226bool dump_base_name_prefixed = false
227
56686608 228; Flag whether HSA generation has been explicitely disabled
229Variable
230bool flag_disable_hsa = false
231
e28aa114 232###
233Driver
234
5789e05b 235-assemble
236Driver Alias(S)
237
238-compile
239Driver Alias(c)
240
6e8a18d1 241-completion=
242Common Driver Joined Undocumented
243Provide bash completion for options starting with provided string.
244
5789e05b 245-coverage
246Driver Alias(coverage)
247
248-debug
249Common Alias(g)
250
251-dump
252Common Separate Alias(d)
253
254-dump=
255Common Joined Alias(d)
256
257-dumpbase
258Common Separate Alias(dumpbase)
259
260-dumpdir
261Common Separate Alias(dumpdir)
262
263-entry
264Driver Separate Alias(e)
265
266-entry=
267Driver Joined Alias(e)
268
269-extra-warnings
270Common Warning Alias(Wextra)
271
272-for-assembler
273Driver Separate Alias(Xassembler)
274
275-for-assembler=
276Driver JoinedOrMissing Alias(Xassembler)
277
278-for-linker
279Driver Separate Alias(Xlinker)
280
281-for-linker=
282Driver JoinedOrMissing Alias(Xlinker)
283
284-force-link
285Driver Separate Alias(u)
286
287-force-link=
288Driver Joined Alias(u)
289
e690b385 290-help
5789e05b 291Common Driver Var(help_flag)
8fb42bbc 292Display this information.
e690b385 293
87c75316 294-help=
e28aa114 295Common Driver Report Joined
8fb42bbc 296--help=<class> Display descriptions of a specific class of options. <class> is one or more of optimizers, target, warnings, undocumented, params.
da3b1bab 297
5789e05b 298-language
299Driver Separate Alias(x)
300
301-language=
302Driver Joined Alias(x)
303
304-library-directory
305Driver Separate Alias(L)
306
307-library-directory=
308Driver Joined Alias(L)
309
310-no-canonical-prefixes
311Driver Alias(no-canonical-prefixes)
312
313-no-standard-libraries
314Driver Alias(nostdlib)
315
70eb49f5 316-no-sysroot-suffix
317Driver Var(no_sysroot_suffix)
318
5789e05b 319-no-warnings
320Common Alias(w)
321
322-optimize
323Common Alias(O)
324
325-output
326Common Driver Separate Alias(o) MissingArgError(missing filename after %qs)
327
328-output=
329Common Driver Joined Alias(o) MissingArgError(missing filename after %qs)
330
331-pass-exit-codes
332Driver Alias(pass-exit-codes)
333
334-pedantic
29438999 335Common Alias(Wpedantic)
5789e05b 336
337-pedantic-errors
338Common Alias(pedantic-errors)
339
340-pie
1412b935 341Driver Alias(pie)
5789e05b 342
6d1ab23d 343-static-pie
344Driver Alias(static-pie)
345
5789e05b 346-pipe
347Driver Alias(pipe)
348
349-prefix
350Driver Separate Alias(B)
351
352-prefix=
353Driver JoinedOrMissing Alias(B)
354
355-preprocess
356Driver Alias(E)
357
358-print-file-name
359Driver Separate Alias(print-file-name=)
360
361-print-file-name=
362Driver JoinedOrMissing Alias(print-file-name=)
363
364-print-libgcc-file-name
365Driver Alias(print-libgcc-file-name)
366
367-print-multi-directory
368Driver Alias(print-multi-directory)
369
370-print-multi-lib
371Driver Alias(print-multi-lib)
372
373-print-multi-os-directory
374Driver Alias(print-multi-os-directory)
375
77adc39e 376-print-multiarch
377Driver Alias(print-multiarch)
378
5789e05b 379-print-prog-name
380Driver Separate Alias(print-prog-name=)
381
382-print-prog-name=
383Driver JoinedOrMissing Alias(print-prog-name=)
384
385-print-search-dirs
386Driver Alias(print-search-dirs)
387
388-print-sysroot
389Driver Alias(print-sysroot)
390
391-print-sysroot-headers-suffix
392Driver Alias(print-sysroot-headers-suffix)
393
394-profile
395Common Alias(p)
396
397-save-temps
398Driver Alias(save-temps)
399
400-shared
1412b935 401Driver Alias(shared)
5789e05b 402
403-specs
404Driver Separate Alias(specs=)
405
406-specs=
407Driver Joined Alias(specs=)
408
409-static
410Driver Alias(static)
411
412-symbolic
413Driver Alias(symbolic)
414
e690b385 415-target-help
e28aa114 416Common Driver
8fb42bbc 417Alias for --help=target.
87c75316 418
5789e05b 419-time
420Driver Alias(time)
421
422-verbose
423Driver Alias(v)
424
425;; The driver used to convert options such as --help into forms such
426;; as -fhelp; the following four entries are for compatibility with
427;; any direct uses of those (undocumented) -f forms
87c75316 428fhelp
5789e05b 429Common Driver Alias(-help)
87c75316 430
431fhelp=
5789e05b 432Common Driver Joined Alias(-help=)
87c75316 433
434ftarget-help
5789e05b 435Common Driver Alias(-target-help)
87c75316 436
39932bd2 437fversion
5789e05b 438Common Driver Alias(-version)
39932bd2 439
87c75316 440-param
441Common Separate
8fb42bbc 442--param <param>=<value> Set parameter <param> to value. See below for a complete list of parameters.
e690b385 443
5789e05b 444-param=
445Common Joined Alias(-param)
446
447-sysroot
448Driver Separate Alias(-sysroot=)
449
e28aa114 450-sysroot=
451Driver JoinedOrMissing
452
e690b385 453-version
e28aa114 454Common Driver
455
456B
457Driver Joined Separate
458
459E
460Driver
e690b385 461
cb22f930 462L
463Driver Joined Separate
464
3bfde2af 465N
466Driver
467
da3b1bab 468O
46f8e3b0 469Common JoinedOrMissing Optimization
8fb42bbc 470-O<number> Set optimization level to <number>.
da3b1bab 471
472Os
46f8e3b0 473Common Optimization
8fb42bbc 474Optimize for space rather than speed.
da3b1bab 475
1ebc0b9f 476Ofast
477Common Optimization
8fb42bbc 478Optimize for speed disregarding exact standards compliance.
1ebc0b9f 479
9b0d2865 480Og
481Common Optimization
8fb42bbc 482Optimize for debugging experience rather than speed or size.
9b0d2865 483
3bfde2af 484Q
485Driver
486
487Qn
488Driver Negative(Qy)
489
490Qy
491Driver Negative(Qn)
492
f37ef985 493R
494Driver Joined Separate
495
e28aa114 496S
497Driver
498
f37ef985 499T
500Driver Joined Separate
501
502Tbss
503Driver Separate
504
69304750 505Tbss=
506Driver Joined
507
f37ef985 508Tdata
509Driver Separate
510
69304750 511Tdata=
512Driver Joined
513
f37ef985 514Ttext
515Driver Separate
516
69304750 517Ttext=
518Driver Joined
519
da3b1bab 520W
67089c6b 521Common RejectNegative Warning Alias(Wextra)
8fb42bbc 522This switch is deprecated; use -Wextra instead.
da3b1bab 523
e28aa114 524Wa,
a1408eb3 525Driver JoinedOrMissing RejectNegative
e28aa114 526
527Wl,
a1408eb3 528Driver JoinedOrMissing RejectNegative
e28aa114 529
530Wp,
a1408eb3 531Driver JoinedOrMissing RejectNegative
e28aa114 532
6f2f567f 533Waggregate-return
87c75316 534Common Var(warn_aggregate_return) Warning
8fb42bbc 535Warn about returning structures, unions or arrays.
6f2f567f 536
228bf2b8 537Waggressive-loop-optimizations
538Common Var(warn_aggressive_loop_optimizations) Init(1) Warning
8fb42bbc 539Warn if a loop with constant number of iterations triggers undefined behavior.
228bf2b8 540
5bc96398 541Warray-bounds
e8831472 542Common Var(warn_array_bounds) Warning
8fb42bbc 543Warn if an array is accessed out of bounds.
5bc96398 544
e4fd7af1 545Warray-bounds=
52368c34 546Common Joined RejectNegative UInteger Var(warn_array_bounds) Warning IntegerRange(0, 2)
8fb42bbc 547Warn if an array is accessed out of bounds.
e4fd7af1 548
9b2d6d13 549Wattributes
87c75316 550Common Var(warn_attributes) Init(1) Warning
8fb42bbc 551Warn about inappropriate attribute usage.
9b2d6d13 552
7f68559b 553Wattribute-alias
554Common Alias(Wattribute_alias=, 1, 0) Warning
898c6fe1 555Warn about type safety and similar errors and mismatches in declarations with alias attributes.
7f68559b 556
08cc1019 557Wattribute-alias=
558Common Joined RejectNegative UInteger Var(warn_attribute_alias) Init(1) Warning IntegerRange(0, 2)
898c6fe1 559Warn about type safety and similar errors and mismatches in declarations with alias attributes.
08cc1019 560
2832ed10 561Wcannot-profile
562Common Var(warn_cannot_profile) Init(1) Warning
563Warn when profiling instrumentation was requested, but could not be applied to
564a certain function.
565
6f2f567f 566Wcast-align
87c75316 567Common Var(warn_cast_align) Warning
8fb42bbc 568Warn about pointer casts which increase alignment.
6f2f567f 569
7ceee42d 570Wcast-align=strict
571Common Var(warn_cast_align,2) Warning
572Warn about pointer casts which increase alignment.
573
3a79f5da 574Wcpp
575Common Var(warn_cpp) Init(1) Warning
8fb42bbc 576Warn when a #warning directive is encountered.
3a79f5da 577
1323f5b0 578Wattribute-warning
579Common Var(warn_attribute_warning) Init(1) Warning
580Warn about uses of __attribute__((warning)) declarations.
581
9d1cdb74 582Wdeprecated
583Common Var(warn_deprecated) Init(1) Warning
584Warn if a deprecated compiler feature, class, method, or field is used.
585
6f2f567f 586Wdeprecated-declarations
87c75316 587Common Var(warn_deprecated_decl) Init(1) Warning
8fb42bbc 588Warn about uses of __attribute__((deprecated)) declarations.
6f2f567f 589
590Wdisabled-optimization
87c75316 591Common Var(warn_disabled_optimization) Warning
8fb42bbc 592Warn when an optimization pass is disabled.
6f2f567f 593
594Werror
2e9da478 595Common Var(warnings_are_errors)
8fb42bbc 596Treat all warnings as errors.
6f2f567f 597
76f02516 598Werror=
599Common Joined
8fb42bbc 600Treat specified warning as error.
76f02516 601
da3b1bab 602Wextra
a0ded67b 603Common Var(extra_warnings) Warning
8fb42bbc 604Print extra (possibly unwanted) warnings.
da3b1bab 605
295acf4f 606Wfatal-errors
2e9da478 607Common Var(flag_fatal_errors)
8fb42bbc 608Exit on the first error occurred.
295acf4f 609
6fdade09 610Wframe-larger-than=
8e18705e 611Common RejectNegative Joined Host_Wide_Int ByteSize Warning Var(warn_frame_larger_than_size) Init(HOST_WIDE_INT_MAX)
612-Wframe-larger-than=<byte-size> Warn if a function's stack frame requires in excess of <byte-size>.
6fdade09 613
f74ea1c2 614Wfree-nonheap-object
615Common Var(warn_free_nonheap_object) Init(1) Warning
8fb42bbc 616Warn when attempting to free a non-heap object.
f74ea1c2 617
56686608 618Whsa
619Common Var(warn_hsa) Init(1) Warning
620Warn when a function cannot be expanded to HSAIL.
621
3c77f69c 622Wimplicit-fallthrough
12663602 623Common Alias(Wimplicit-fallthrough=,3,0) Warning
624
625Wimplicit-fallthrough=
52368c34 626Common Var(warn_implicit_fallthrough) RejectNegative Joined UInteger Warning IntegerRange(0, 5)
3c77f69c 627Warn when a switch case falls through.
628
6f2f567f 629Winline
87c75316 630Common Var(warn_inline) Warning
8fb42bbc 631Warn when an inlined function cannot be inlined.
6f2f567f 632
1cd6e20d 633Winvalid-memory-model
634Common Var(warn_invalid_memory_model) Init(1) Warning
635Warn when an atomic memory model parameter is known to be outside the valid range.
636
6f2f567f 637Wlarger-than-
67089c6b 638Common RejectNegative Joined Warning Undocumented Alias(Wlarger-than=)
17c66687 639
640Wlarger-than=
8e18705e 641Common RejectNegative Joined Host_Wide_Int ByteSize Warning Var(warn_larger_than_size) Init(HOST_WIDE_INT_MAX)
642-Wlarger-than=<byte-size> Warn if an object's size exceeds <byte-size>.
6f2f567f 643
7675e968 644Wnonnull-compare
645Var(warn_nonnull_compare) Warning
646Warn if comparing pointer parameter with nonnull attribute with NULL.
647
254d68a9 648Wnull-dereference
5463f502 649Common Var(warn_null_dereference) Warning
8fb42bbc 650Warn if dereferencing a NULL pointer may lead to erroneous or undefined behavior.
254d68a9 651
7e3cc681 652Wunsafe-loop-optimizations
b97fffd6 653Common Ignore Warning
654Does nothing. Preserved for backward compatibility.
7e3cc681 655
6f2f567f 656Wmissing-noreturn
7ca909c6 657Common Warning Alias(Wsuggest-attribute=noreturn)
6f2f567f 658
c8902726 659Wodr
01cb9cf7 660Common Var(warn_odr_violations) Init(1) Warning
8fb42bbc 661Warn about some C++ One Definition Rule violations during link time optimization.
c8902726 662
55972f40 663Woverflow
87c75316 664Common Var(warn_overflow) Init(1) Warning
8fb42bbc 665Warn about overflow in arithmetic expressions.
55972f40 666
40175f70 667Wlto-type-mismatch
668Common Var(warn_lto_type_mismatch) Init(1) Warning
8fb42bbc 669During link time optimization warn about mismatched types of global declarations.
40175f70 670
6f2f567f 671Wpacked
87c75316 672Common Var(warn_packed) Warning
8fb42bbc 673Warn when the packed attribute has no effect on struct layout.
6f2f567f 674
675Wpadded
87c75316 676Common Var(warn_padded) Warning
8fb42bbc 677Warn when padding is required to align structure members.
6f2f567f 678
29438999 679Wpedantic
04afd878 680Common Var(pedantic) Init(0) Warning
8fb42bbc 681Issue warnings needed for strict compliance to the standard.
29438999 682
f22a2cb7 683Wreturn-local-addr
684Common Var(warn_return_local_addr) Init(1) Warning
685Warn about returning a pointer/reference to a local or temporary variable.
686
6f2f567f 687Wshadow
87c75316 688Common Var(warn_shadow) Warning
50d3ad71 689Warn when one variable shadows another. Same as -Wshadow=global.
690
691Wshadow=global
692Common Warning Alias(Wshadow)
693Warn when one variable shadows another (globally).
694
695Wshadow=local
696Common Var(warn_shadow_local) Warning EnabledBy(Wshadow)
697Warn when one local variable shadows another local variable or parameter.
698
699Wshadow-local
700Common Warning Undocumented Alias(Wshadow=local)
701
702Wshadow=compatible-local
703Common Var(warn_shadow_compatible_local) Warning EnabledBy(Wshadow=local)
704Warn when one local variable shadows another local variable or parameter of compatible type.
705
706Wshadow-compatible-local
707Common Warning Undocumented Alias(Wshadow=compatible-local)
6f2f567f 708
f1a0edff 709Wstack-protector
87c75316 710Common Var(warn_stack_protect) Warning
8fb42bbc 711Warn when not issuing stack smashing protection for some reason.
f1a0edff 712
8c0dd614 713Wstack-usage=
8e18705e 714Common Joined RejectNegative Host_Wide_Int ByteSize Var(warn_stack_usage) Warning Init(HOST_WIDE_INT_MAX)
715-Wstack-usage=<byte-size> Warn if stack usage might exceed <byte-size>.
8c0dd614 716
6f2f567f 717Wstrict-aliasing
87c75316 718Common Warning
8fb42bbc 719Warn about code which might break strict aliasing rules.
6f2f567f 720
c1628b55 721Wstrict-aliasing=
77b27208 722Common Joined RejectNegative UInteger Var(warn_strict_aliasing) Warning
8fb42bbc 723Warn about code which might break strict aliasing rules.
c1628b55 724
add6ee5e 725Wstrict-overflow
e8831472 726Common Warning
8fb42bbc 727Warn about optimizations that assume that signed overflow is undefined.
add6ee5e 728
729Wstrict-overflow=
77b27208 730Common Joined RejectNegative UInteger Var(warn_strict_overflow) Warning
8fb42bbc 731Warn about optimizations that assume that signed overflow is undefined.
add6ee5e 732
60722a03 733Wsuggest-attribute=cold
734Common Var(warn_suggest_attribute_cold) Warning
735Warn about functions which might be candidates for __attribute__((cold)).
736
2c06958d 737Wsuggest-attribute=const
738Common Var(warn_suggest_attribute_const) Warning
8fb42bbc 739Warn about functions which might be candidates for __attribute__((const)).
2c06958d 740
741Wsuggest-attribute=pure
742Common Var(warn_suggest_attribute_pure) Warning
8fb42bbc 743Warn about functions which might be candidates for __attribute__((pure)).
2c06958d 744
43d60d64 745Wsuggest-attribute=noreturn
746Common Var(warn_suggest_attribute_noreturn) Warning
8fb42bbc 747Warn about functions which might be candidates for __attribute__((noreturn)).
43d60d64 748
bd5ef087 749Wsuggest-attribute=malloc
750Common Var(warn_suggest_attribute_malloc) Warning
751Warn about functions which might be candidates for __attribute__((malloc)).
752
fb6c6e54 753Wsuggest-final-types
754Common Var(warn_suggest_final_types) Warning
8fb42bbc 755Warn about C++ polymorphic types where adding final keyword would improve code quality.
fb6c6e54 756
757Wsuggest-final-methods
758Common Var(warn_suggest_final_methods) Warning
8fb42bbc 759Warn about C++ virtual methods where adding final keyword would improve code quality.
fb6c6e54 760
1398da0f 761Wswitch-unreachable
762Common Var(warn_switch_unreachable) Warning Init(1)
763Warn about statements between switch's controlling expression and the first
764case.
765
6f2f567f 766Wsystem-headers
87c75316 767Common Var(warn_system_headers) Warning
8fb42bbc 768Do not suppress warnings from system headers.
6f2f567f 769
8bc8a8f4 770Wtrampolines
771Common Var(warn_trampolines) Warning
8fb42bbc 772Warn whenever a trampoline is generated.
8bc8a8f4 773
100b67da 774Wtype-limits
70059cea 775Common Var(warn_type_limits) Warning EnabledBy(Wextra)
8fb42bbc 776Warn if a comparison is always true or always false due to the limited range of the data type.
100b67da 777
6f2f567f 778Wuninitialized
fbb6fbd8 779Common Var(warn_uninitialized) Warning EnabledBy(Wextra)
8fb42bbc 780Warn about uninitialized automatic variables.
6f2f567f 781
8c3e8d68 782Wmaybe-uninitialized
fbb6fbd8 783Common Var(warn_maybe_uninitialized) Warning EnabledBy(Wuninitialized)
8fb42bbc 784Warn about maybe uninitialized automatic variables.
8c3e8d68 785
6f2f567f 786Wunreachable-code
eec0fa3f 787Common Ignore Warning
cc029bec 788Does nothing. Preserved for backward compatibility.
6f2f567f 789
da3b1bab 790Wunused
278e3a1f 791Common Var(warn_unused) Init(0) Warning
8fb42bbc 792Enable all -Wunused- warnings.
da3b1bab 793
abc6c64f 794Wunused-but-set-parameter
1090f26f 795Common Var(warn_unused_but_set_parameter) Warning EnabledBy(Wunused && Wextra)
8fb42bbc 796Warn when a function parameter is only set, otherwise unused.
abc6c64f 797
798Wunused-but-set-variable
fbb6fbd8 799Common Var(warn_unused_but_set_variable) Warning EnabledBy(Wunused)
8fb42bbc 800Warn when a variable is only set, otherwise unused.
abc6c64f 801
6f2f567f 802Wunused-function
fbb6fbd8 803Common Var(warn_unused_function) Warning EnabledBy(Wunused)
8fb42bbc 804Warn when a function is unused.
6f2f567f 805
806Wunused-label
fbb6fbd8 807Common Var(warn_unused_label) Warning EnabledBy(Wunused)
8fb42bbc 808Warn when a label is unused.
6f2f567f 809
810Wunused-parameter
1090f26f 811Common Var(warn_unused_parameter) Warning EnabledBy(Wunused && Wextra)
8fb42bbc 812Warn when a function parameter is unused.
6f2f567f 813
814Wunused-value
fbb6fbd8 815Common Var(warn_unused_value) Warning EnabledBy(Wunused)
8fb42bbc 816Warn when an expression value is unused.
6f2f567f 817
818Wunused-variable
fbb6fbd8 819Common Var(warn_unused_variable) Warning EnabledBy(Wunused)
8fb42bbc 820Warn when a variable is unused.
6f2f567f 821
c81ed7c1 822Wcoverage-mismatch
21cd990d 823Common Var(warn_coverage_mismatch) Init(1) Warning
8fb42bbc 824Warn in case profiles in -fprofile-use do not match.
c81ed7c1 825
c5fdd880 826Wmissing-profile
827Common Var(warn_missing_profile) Init(1) Warning
828Warn in case profiles in -fprofile-use do not exist.
829
928efcfe 830Wvector-operation-performance
831Common Var(warn_vector_operation_performance) Warning
8fb42bbc 832Warn when a vector operation is compiled outside the SIMD.
928efcfe 833
e28aa114 834Xassembler
835Driver Separate
836
837Xlinker
838Driver Separate
839
840Xpreprocessor
841Driver Separate
842
3bfde2af 843Z
844Driver
845
e690b385 846aux-info
6bd9d862 847Common Separate Var(aux_info_file_name)
8fb42bbc 848-aux-info <file> Emit declaration information into <file>.
e690b385 849
850aux-info=
67089c6b 851Common Joined Alias(aux-info)
e690b385 852
853auxbase
6bd9d862 854Common Separate RejectDriver Var(aux_base_name)
e690b385 855
856auxbase-strip
e28aa114 857Common Separate RejectDriver
858
5789e05b 859coverage
860Driver
861
e28aa114 862c
863Driver
e690b385 864
865d
866Common Joined
8fb42bbc 867-d<letters> Enable dumps from specific passes of the compiler.
e690b385 868
869dumpbase
6bd9d862 870Common Separate Var(dump_base_name)
8fb42bbc 871-dumpbase <file> Set the file basename to be used for dumps.
e690b385 872
50ca7c37 873dumpdir
6bd9d862 874Common Separate Var(dump_dir_name)
8fb42bbc 875-dumpdir <dir> Set the directory name to be used for dumps.
50ca7c37 876
e28aa114 877dumpmachine
878Driver
879
880dumpspecs
881Driver
882
883dumpversion
884Driver
885
0812bb06 886dumpfullversion
887Driver
888
5789e05b 889e
890Driver Joined Separate
891
455188e9 892; This option has historically been passed down to the linker by an
893; accident of a %{e*} spec, so ensure it continues to be passed down
894; as a single option. The supported option for this purpose is
895; -rdynamic. See PR 47390.
896export-dynamic
897Driver Undocumented
898
82a16202 899; The version of the C++ ABI in use. The following values are allowed:
900;
901; 0: The version of the ABI believed most conformant with the C++ ABI
902; specification. This ABI may change as bugs are discovered and fixed.
903; Therefore, 0 will not necessarily indicate the same ABI in different
904; versions of G++.
905;
f591db9a 906; 1: The version of the ABI first used in G++ 3.2. No longer selectable.
82a16202 907;
1d524ff7 908; 2: The version of the ABI first used in G++ 3.4, and the default
909; until GCC 4.9.
29e2e80a 910;
911; 3: The version of the ABI that fixes the missing underscore
912; in template non-type arguments of pointer type.
913;
914; 4: The version of the ABI that introduces unambiguous mangling of
87d553db 915; vector types. First selectable in G++ 4.5.
e9e7c198 916;
4d7aaf8e 917; 5: The version of the ABI that ignores attribute const/noreturn
87d553db 918; in function pointer mangling, and corrects mangling of decltype and
4d7aaf8e 919; function parameters used in other parameters and the return type.
87d553db 920; First selectable in G++ 4.6.
4d7aaf8e 921;
2d847c18 922; 6: The version of the ABI that doesn't promote scoped enums to int and
923; changes the mangling of template argument packs, const/static_cast,
924; prefix ++ and --, and a class scope function used as a template
925; argument.
72fc0f64 926; First selectable in G++ 4.7.
927;
dc78d83a 928; 7: The version of the ABI that treats nullptr_t as a builtin type and
929; corrects the mangling of lambdas in default argument scope.
fbcdace8 930; First selectable in G++ 4.8.
862e5b6d 931;
932; 8: The version of the ABI that corrects the substitution behavior of
933; function types with function-cv-qualifiers.
399fbdbd 934; First selectable in G++ 4.9 and default in G++ 5.
935;
42af8c2a 936; 9: The version of the ABI that corrects the alignment of nullptr_t.
937; First selectable and default in G++ 5.2.
938;
939; 10: The version of the ABI that mangles attributes that affect type
940; identity, such as ia32 calling convention attributes (stdcall, etc.)
941; Default in G++ 6 (set in c_common_post_options).
862e5b6d 942;
7896267d 943; 11: The version of the ABI that corrects mangling of sizeof... expressions
944; and introduces new inheriting constructor handling.
17fdf85c 945; Default in G++ 7.
946;
5d11282b 947; 12: Corrects the calling convention for classes with only deleted copy/move
532d84ff 948; constructors and changes passing/returning of empty records.
a1dbee61 949; Default in G++ 8.1.
950;
951; 13: Fixes the accidental change in 12 to the calling convention for classes
952; with deleted copy constructor and trivial move constructor.
953; Default in G++ 8.2.
5d11282b 954;
82a16202 955; Additional positive integers will be assigned as new versions of
956; the ABI become the default version of the ABI.
e100aadc 957fabi-version=
f2c0954e 958Common Joined RejectNegative UInteger Var(flag_abi_version) Init(0)
8fb42bbc 959The version of the C++ ABI in use.
e100aadc 960
56dfa44a 961faggressive-loop-optimizations
8fb42bbc 962Common Report Var(flag_aggressive_loop_optimizations) Optimization Init(1)
963Aggressively optimize loops using language constraints.
56dfa44a 964
ecdb6d1a 965falign-functions
6848a0ae 966Common Report Var(flag_align_functions) Optimization
8fb42bbc 967Align the start of functions.
ecdb6d1a 968
941a4893 969falign-functions=
6848a0ae 970Common RejectNegative Joined Var(str_align_functions) Optimization
941a4893 971
32cc215b 972flimit-function-alignment
973Common Report Var(flag_limit_function_alignment) Optimization Init(0)
974
ecdb6d1a 975falign-jumps
6848a0ae 976Common Report Var(flag_align_jumps) Optimization
8fb42bbc 977Align labels which are only reached by jumping.
ecdb6d1a 978
941a4893 979falign-jumps=
6848a0ae 980Common RejectNegative Joined Var(str_align_jumps) Optimization
941a4893 981
ecdb6d1a 982falign-labels
6848a0ae 983Common Report Var(flag_align_labels) Optimization
8fb42bbc 984Align all labels.
ecdb6d1a 985
941a4893 986falign-labels=
6848a0ae 987Common RejectNegative Joined Var(str_align_labels) Optimization
941a4893 988
ecdb6d1a 989falign-loops
6848a0ae 990Common Report Var(flag_align_loops) Optimization
8fb42bbc 991Align the start of loops.
ecdb6d1a 992
941a4893 993falign-loops=
371e2a2e 994Common RejectNegative Joined Var(str_align_loops) Optimization
941a4893 995
ecdb6d1a 996fargument-alias
3b0273a1 997Common Ignore
e190b18a 998Does nothing. Preserved for backward compatibility.
ecdb6d1a 999
1000fargument-noalias
3b0273a1 1001Common Ignore
e190b18a 1002Does nothing. Preserved for backward compatibility.
ecdb6d1a 1003
1004fargument-noalias-global
3b0273a1 1005Common Ignore
e190b18a 1006Does nothing. Preserved for backward compatibility.
ecdb6d1a 1007
5ff22aea 1008fargument-noalias-anything
3b0273a1 1009Common Ignore
e190b18a 1010Does nothing. Preserved for backward compatibility.
5ff22aea 1011
9e46467d 1012fsanitize=
1013Common Driver Report Joined
8fb42bbc 1014Select what to sanitize.
b077695d 1015
ccec7674 1016fsanitize-coverage=
1017Common Report Joined
dc4ed9fd 1018Select type of coverage sanitization.
ccec7674 1019
cf357977 1020fasan-shadow-offset=
1021Common Joined RejectNegative Var(common_deferred_options) Defer
1022-fasan-shadow-offset=<number> Use custom shadow memory offset.
1023
4d3c996b 1024fsanitize-sections=
1025Common Joined RejectNegative Var(common_deferred_options) Defer
1026-fsanitize-sections=<sec1,sec2,...> Sanitize global variables
1027in user-defined sections.
1028
c2598081 1029fsanitize-recover=
1030Common Report Joined
8fb42bbc 1031After diagnosing undefined behavior attempt to continue execution.
7311d7c1 1032
c2598081 1033fsanitize-recover
1034Common Report
8fb42bbc 1035This switch is deprecated; use -fsanitize-recover= instead.
c2598081 1036
629b6abc 1037fsanitize-address-use-after-scope
1038Common Driver Report Var(flag_sanitize_address_use_after_scope) Init(0)
1039
7311d7c1 1040fsanitize-undefined-trap-on-error
d21bbc3f 1041Common Driver Report Var(flag_sanitize_undefined_trap_on_error) Init(0)
8fb42bbc 1042Use trap instead of a library function for undefined behavior sanitization.
7311d7c1 1043
ecdb6d1a 1044fasynchronous-unwind-tables
87c75316 1045Common Report Var(flag_asynchronous_unwind_tables) Optimization
8fb42bbc 1046Generate unwind tables that are exact at each instruction boundary.
ecdb6d1a 1047
3072d30e 1048fauto-inc-dec
bfedbed1 1049Common Report Var(flag_auto_inc_dec) Init(1) Optimization
8fb42bbc 1050Generate auto-inc/dec instructions.
3072d30e 1051
94bed7c3 1052fauto-profile
bfedbed1 1053Common Report Var(flag_auto_profile)
94bed7c3 1054Use sample profile information for call graph node weights. The default
1055profile file is fbdata.afdo in 'pwd'.
1056
1057fauto-profile=
1058Common Joined RejectNegative Var(auto_profile_file)
1059Use sample profile information for call graph node weights. The profile
1060file is specified in the argument.
1061
82a16202 1062; -fcheck-bounds causes gcc to generate array bounds checks.
1063; For C, C++ and ObjC: defaults off.
1064; For Java: defaults to on.
1065; For Fortran: defaults to off.
ecdb6d1a 1066fbounds-check
2e9da478 1067Common Report Var(flag_bounds_check)
8fb42bbc 1068Generate code to check bounds before indexing arrays.
ecdb6d1a 1069
1070fbranch-count-reg
1941e89d 1071Common Report Var(flag_branch_on_count_reg) Optimization
8fb42bbc 1072Replace add, compare, branch with branch on count register.
ecdb6d1a 1073
1074fbranch-probabilities
87c75316 1075Common Report Var(flag_branch_probabilities) Optimization
8fb42bbc 1076Use profiling information for branch probabilities.
ecdb6d1a 1077
1e06725a 1078fbranch-target-load-optimize
87c75316 1079Common Report Var(flag_branch_target_load_optimize) Optimization
8fb42bbc 1080Perform branch target load optimization before prologue / epilogue threading.
1e06725a 1081
1082fbranch-target-load-optimize2
87c75316 1083Common Report Var(flag_branch_target_load_optimize2) Optimization
8fb42bbc 1084Perform branch target load optimization after prologue / epilogue threading.
1e06725a 1085
08d163a9 1086fbtr-bb-exclusive
87c75316 1087Common Report Var(flag_btr_bb_exclusive) Optimization
8fb42bbc 1088Restrict target load migration not to re-use registers in any basic block.
08d163a9 1089
941a4893 1090fcall-saved-
f0da0668 1091Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 1092-fcall-saved-<register> Mark <register> as being preserved across functions.
941a4893 1093
1094fcall-used-
f0da0668 1095Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 1096-fcall-used-<register> Mark <register> as being corrupted by function calls.
941a4893 1097
82a16202 1098; Nonzero for -fcaller-saves: allocate values in regs that need to
1099; be saved across function calls, if that produces overall better code.
1100; Optional now, so people can test it.
1e06725a 1101fcaller-saves
87c75316 1102Common Report Var(flag_caller_saves) Optimization
8fb42bbc 1103Save registers around function calls.
1e06725a 1104
355572cc 1105fcheck-data-deps
0c46a085 1106Common Ignore
0d8001a7 1107This switch is deprecated; do not use.
355572cc 1108
0b7282f1 1109fcheck-new
1110Common Var(flag_check_new)
8fb42bbc 1111Check the return value of new in C++.
0b7282f1 1112
92deda7a 1113fchecking
9ccb8d8d 1114Common Var(flag_checking) Init(CHECKING_P ? ENABLE_EXTRA_CHECKING ? 2 : 1 : 0)
92deda7a 1115Perform internal consistency checkings.
1116
c05979a1 1117fchecking=
1118Common Joined RejectNegative UInteger Var(flag_checking)
1119Perform internal consistency checkings.
1120
ad010d47 1121fcode-hoisting
1122Common Report Var(flag_code_hoisting) Optimization
1123Enable code hoisting.
1124
bbb0a662 1125fcombine-stack-adjustments
1126Common Report Var(flag_combine_stack_adjustments) Optimization
1127Looks for opportunities to reduce stack adjustments and stack references.
1128
ecdb6d1a 1129fcommon
bfedbed1 1130Common Report Var(flag_no_common,0)
8fb42bbc 1131Do not put uninitialized globals in the common section.
ecdb6d1a 1132
e28aa114 1133fcompare-debug
1134Driver
1135; Converted by the driver to -fcompare-debug= options.
1136
71278019 1137fcompare-debug=
e28aa114 1138Common Driver JoinedOrMissing RejectNegative Var(flag_compare_debug_opt)
8fb42bbc 1139-fcompare-debug[=<opts>] Compile with and without e.g. -gtoggle, and compare the final-insns dump.
71278019 1140
1141fcompare-debug-second
ab3728ee 1142Common Driver RejectNegative Var(flag_compare_debug)
8fb42bbc 1143Run only the second compilation of -fcompare-debug.
71278019 1144
a50372fe 1145fcompare-elim
1146Common Report Var(flag_compare_elim_after_reload) Optimization
8fb42bbc 1147Perform comparison elimination after register allocation has finished.
a50372fe 1148
9845d120 1149fconserve-stack
1150Common Var(flag_conserve_stack) Optimization
8fb42bbc 1151Do not perform optimizations increasing noticeably stack usage.
9845d120 1152
ecdb6d1a 1153fcprop-registers
87c75316 1154Common Report Var(flag_cprop_registers) Optimization
8fb42bbc 1155Perform a register copy-propagation optimization pass.
ecdb6d1a 1156
1e06725a 1157fcrossjumping
87c75316 1158Common Report Var(flag_crossjumping) Optimization
8fb42bbc 1159Perform cross-jumping optimization.
1e06725a 1160
1161fcse-follow-jumps
87c75316 1162Common Report Var(flag_cse_follow_jumps) Optimization
8fb42bbc 1163When running CSE, follow jumps to their targets.
1e06725a 1164
1165fcse-skip-blocks
3b0273a1 1166Common Ignore
d743aba2 1167Does nothing. Preserved for backward compatibility.
1e06725a 1168
45b9d334 1169fcx-limited-range
ecee1b29 1170Common Report Var(flag_cx_limited_range) Optimization SetByCombined
8fb42bbc 1171Omit range reduction step when performing complex division.
45b9d334 1172
608256a0 1173fcx-fortran-rules
1174Common Report Var(flag_cx_fortran_rules) Optimization
8fb42bbc 1175Complex multiplication and division follow Fortran rules.
608256a0 1176
ecdb6d1a 1177fdata-sections
bfedbed1 1178Common Report Var(flag_data_sections)
8fb42bbc 1179Place data items into their own section.
ecdb6d1a 1180
d2153a46 1181fdbg-cnt-list
9faf44d6 1182Common Report Var(common_deferred_options) Defer
d2153a46 1183List all available debugging counters with their limits and counts.
1184
3072d30e 1185fdbg-cnt=
9faf44d6 1186Common RejectNegative Joined Var(common_deferred_options) Defer
795785e1 1187-fdbg-cnt=<counter>[:<lower_limit>]:<upper_limit>[,<counter>:...] Set the debug counter limit.
3072d30e 1188
5f1f2de5 1189fdebug-prefix-map=
9faf44d6 1190Common Joined RejectNegative Var(common_deferred_options) Defer
859b51f8 1191-fdebug-prefix-map=<old>=<new> Map one directory name to another in debug information.
1192
1193ffile-prefix-map=
1194Common Joined RejectNegative Var(common_deferred_options) Defer
1195-ffile-prefix-map=<old>=<new> Map one directory name to another in compilation result.
5f1f2de5 1196
240a87ff 1197fdebug-types-section
052166fd 1198Common Report Var(flag_debug_types_section) Init(0)
240a87ff 1199Output .debug_types section when using DWARF v4 debuginfo.
1200
82a16202 1201; Nonzero for -fdefer-pop: don't pop args after each function call
1202; instead save them up to pop many calls' args with one insns.
1e06725a 1203fdefer-pop
87c75316 1204Common Report Var(flag_defer_pop) Optimization
8fb42bbc 1205Defer popping functions args from stack until later.
1e06725a 1206
1207fdelayed-branch
87c75316 1208Common Report Var(flag_delayed_branch) Optimization
8fb42bbc 1209Attempt to fill delay slots of branch instructions.
1e06725a 1210
bc0dfc8d 1211fdelete-dead-exceptions
bfedbed1 1212Common Report Var(flag_delete_dead_exceptions) Init(0) Optimization
8fb42bbc 1213Delete dead instructions that may throw exceptions.
bc0dfc8d 1214
1e06725a 1215fdelete-null-pointer-checks
2d66501e 1216Common Report Var(flag_delete_null_pointer_checks) Init(-1) Optimization
8fb42bbc 1217Delete useless null pointer checks.
1e06725a 1218
a8aa8251 1219fdevirtualize-at-ltrans
1220Common Report Var(flag_ltrans_devirtualize)
8fb42bbc 1221Stream extra data to support more aggressive devirtualization in LTO local transformation mode.
a8aa8251 1222
84f6cc40 1223fdevirtualize-speculatively
1224Common Report Var(flag_devirtualize_speculatively) Optimization
8fb42bbc 1225Perform speculative devirtualization.
84f6cc40 1226
0276be0c 1227fdevirtualize
1228Common Report Var(flag_devirtualize) Optimization
1229Try to convert virtual calls to direct ones.
1230
1e06725a 1231fdiagnostics-show-location=
d62a5950 1232Common Joined RejectNegative Enum(diagnostic_prefixing_rule)
8fb42bbc 1233-fdiagnostics-show-location=[once|every-line] How often to emit source location at the beginning of line-wrapped diagnostics.
1e06725a 1234
d62a5950 1235; Required for these enum values.
1236SourceInclude
1237pretty-print.h
1238
1239Enum
1240Name(diagnostic_prefixing_rule) Type(int)
1241
1242EnumValue
1243Enum(diagnostic_prefixing_rule) String(once) Value(DIAGNOSTICS_SHOW_PREFIX_ONCE)
1244
1245EnumValue
1246Enum(diagnostic_prefixing_rule) String(every-line) Value(DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE)
1247
5a983084 1248fdiagnostics-show-caret
1249Common Var(flag_diagnostics_show_caret) Init(1)
8fb42bbc 1250Show the source line with a caret indicating the column.
5a983084 1251
b7bb5264 1252fdiagnostics-show-labels
1253Common Var(flag_diagnostics_show_labels) Init(1)
f673492c 1254Show labels annotating ranges of source code when showing source.
b7bb5264 1255
ff7410b8 1256fdiagnostics-show-line-numbers
1257Common Var(flag_diagnostics_show_line_numbers) Init(1)
f673492c 1258Show line numbers in the left margin when showing source.
ff7410b8 1259
41609f8b 1260fdiagnostics-color
1261Common Alias(fdiagnostics-color=,always,never)
1262;
1263
1264fdiagnostics-color=
9b11544d 1265Driver Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO)
8fb42bbc 1266-fdiagnostics-color=[never|always|auto] Colorize diagnostics.
41609f8b 1267
1268; Required for these enum values.
1269SourceInclude
1270diagnostic-color.h
1271
1272Enum
1273Name(diagnostic_color_rule) Type(int)
1274
1275EnumValue
1276Enum(diagnostic_color_rule) String(never) Value(DIAGNOSTICS_COLOR_NO)
1277
1278EnumValue
1279Enum(diagnostic_color_rule) String(always) Value(DIAGNOSTICS_COLOR_YES)
1280
1281EnumValue
1282Enum(diagnostic_color_rule) String(auto) Value(DIAGNOSTICS_COLOR_AUTO)
1283
1bcc5c64 1284fdiagnostics-format=
1285Common Joined RejectNegative Enum(diagnostics_output_format)
f673492c 1286-fdiagnostics-format=[text|json] Select output format.
1bcc5c64 1287
1288; Required for these enum values.
1289SourceInclude
1290diagnostic.h
1291
1292Enum
1293Name(diagnostics_output_format) Type(int)
1294
1295EnumValue
1296Enum(diagnostics_output_format) String(text) Value(DIAGNOSTICS_OUTPUT_FORMAT_TEXT)
1297
1298EnumValue
1299Enum(diagnostics_output_format) String(json) Value(DIAGNOSTICS_OUTPUT_FORMAT_JSON)
1300
6628b04d 1301fdiagnostics-parseable-fixits
1302Common Var(flag_diagnostics_parseable_fixits)
d00ce6b9 1303Print fix-it hints in machine-readable form.
6628b04d 1304
40a431fa 1305fdiagnostics-generate-patch
1306Common Var(flag_diagnostics_generate_patch)
1307Print fix-it hints to stderr in unified diff format.
1308
efb9d9ee 1309fdiagnostics-show-option
3fee9a69 1310Common Var(flag_diagnostics_show_option) Init(1)
8fb42bbc 1311Amend appropriate diagnostic messages with the command line option that controls them.
efb9d9ee 1312
31087b7e 1313fdiagnostics-minimum-margin-width=
1314Common Joined UInteger Var(diagnostics_minimum_margin_width) Init(6)
f673492c 1315Set minimum width of left margin of source code when showing source.
31087b7e 1316
c3087ce0 1317fdisable-
1318Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 1319-fdisable-[tree|rtl|ipa]-<pass>=range1+range2 disables an optimization pass.
c3087ce0 1320
1321fenable-
1322Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 1323-fenable-[tree|rtl|ipa]-<pass>=range1+range2 enables an optimization pass.
c3087ce0 1324
4ee9c684 1325fdump-
f0da0668 1326Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 1327-fdump-<type> Dump various compiler internals to a file.
4ee9c684 1328
0b1d266f 1329fdump-final-insns
1330Driver RejectNegative
1331
71278019 1332fdump-final-insns=
1333Common RejectNegative Joined Var(flag_dump_final_insns)
8fb42bbc 1334-fdump-final-insns=filename Dump to filename the insns at the end of translation.
71278019 1335
929d2a90 1336fdump-go-spec=
1337Common RejectNegative Joined Var(flag_dump_go_spec)
8fb42bbc 1338-fdump-go-spec=filename Write all declarations to file as Go code.
929d2a90 1339
969239ad 1340fdump-noaddr
1341Common Report Var(flag_dump_noaddr)
8fb42bbc 1342Suppress output of addresses in debugging dumps.
969239ad 1343
a31e9496 1344freport-bug
1345Common Driver Var(flag_report_bug)
1346Collect and dump debug information into temporary file if ICE in C/C++
d0abd9e0 1347compiler occurred.
a31e9496 1348
28f17529 1349fdump-internal-locations
1350Common Var(flag_dump_locations) Init(0)
8fb42bbc 1351Dump detailed information on GCC's internal representation of source code locations.
28f17529 1352
ec4791a8 1353fdump-passes
1354Common Var(flag_dump_passes) Init(0)
8fb42bbc 1355Dump optimization passes.
ec4791a8 1356
ecdb6d1a 1357fdump-unnumbered
0f8defe5 1358Common Report Var(flag_dump_unnumbered)
8fb42bbc 1359Suppress output of instruction numbers, line number notes and addresses in debugging dumps.
ecdb6d1a 1360
0a59e439 1361fdump-unnumbered-links
0f8defe5 1362Common Report Var(flag_dump_unnumbered_links)
8fb42bbc 1363Suppress output of previous and next insn numbers in debugging dumps.
0a59e439 1364
9845d120 1365fdwarf2-cfi-asm
1366Common Report Var(flag_dwarf2_cfi_asm) Init(HAVE_GAS_CFI_DIRECTIVE)
1367Enable CFI tables via GAS assembler directives.
1368
f1aa280c 1369fearly-inlining
87c75316 1370Common Report Var(flag_early_inlining) Init(1) Optimization
8fb42bbc 1371Perform early inlining.
f1aa280c 1372
1e06725a 1373feliminate-dwarf2-dups
1734e8a0 1374Common Ignore
1375Does nothing. Preserved for backward compatibility.
1e06725a 1376
2f29eac3 1377fipa-sra
1378Common Report Var(flag_ipa_sra) Init(0) Optimization
8fb42bbc 1379Perform interprocedural reduction of aggregates.
2f29eac3 1380
262444a6 1381feliminate-unused-debug-symbols
2e9da478 1382Common Report Var(flag_debug_only_used_symbols)
8fb42bbc 1383Perform unused symbol elimination in debug info.
262444a6 1384
1e06725a 1385feliminate-unused-debug-types
2e9da478 1386Common Report Var(flag_eliminate_unused_debug_types) Init(1)
8fb42bbc 1387Perform unused type elimination in debug info.
1e06725a 1388
0c573f98 1389femit-class-debug-always
fd5e1dfe 1390Common Report Var(flag_emit_class_debug_always) Init(0)
0c573f98 1391Do not suppress C++ class debug information.
1392
ecdb6d1a 1393fexceptions
87c75316 1394Common Report Var(flag_exceptions) Optimization
8fb42bbc 1395Enable exception handling.
ecdb6d1a 1396
1e06725a 1397fexpensive-optimizations
87c75316 1398Common Report Var(flag_expensive_optimizations) Optimization
8fb42bbc 1399Perform a number of minor, expensive optimizations.
1e06725a 1400
c6418a4e 1401fexcess-precision=
9660cb79 1402Common Joined RejectNegative Enum(excess_precision) Var(flag_excess_precision_cmdline) Init(EXCESS_PRECISION_DEFAULT) SetByCombined
8fb42bbc 1403-fexcess-precision=[fast|standard] Specify handling of excess floating-point precision.
c6418a4e 1404
d62a5950 1405Enum
1406Name(excess_precision) Type(enum excess_precision) UnknownError(unknown excess precision style %qs)
1407
1408EnumValue
1409Enum(excess_precision) String(fast) Value(EXCESS_PRECISION_FAST)
1410
1411EnumValue
1412Enum(excess_precision) String(standard) Value(EXCESS_PRECISION_STANDARD)
1413
a998ac00 1414; Whether we permit the extended set of values for FLT_EVAL_METHOD
1415; introduced in ISO/IEC TS 18661-3, or limit ourselves to those in C99/C11.
1416fpermitted-flt-eval-methods=
1417Common Joined RejectNegative Enum(permitted_flt_eval_methods) Var(flag_permitted_flt_eval_methods) Init(PERMITTED_FLT_EVAL_METHODS_DEFAULT)
1418-fpermitted-flt-eval-methods=[c11|ts-18661] Specify which values of FLT_EVAL_METHOD are permitted.
1419
1420Enum
1421Name(permitted_flt_eval_methods) Type(enum permitted_flt_eval_methods) UnknownError(unknown specification for the set of FLT_EVAL_METHOD values to permit %qs)
1422
1423EnumValue
1424Enum(permitted_flt_eval_methods) String(c11) Value(PERMITTED_FLT_EVAL_METHODS_C11)
1425
1426EnumValue
1427Enum(permitted_flt_eval_methods) String(ts-18661-3) Value(PERMITTED_FLT_EVAL_METHODS_TS_18661)
1428
941a4893 1429ffast-math
b032c4dd 1430Common Optimization
941a4893 1431
b33542ab 1432ffat-lto-objects
76eca1df 1433Common Var(flag_fat_lto_objects)
b33542ab 1434Output lto objects containing both the intermediate language and binary output.
1435
ecdb6d1a 1436ffinite-math-only
ecee1b29 1437Common Report Var(flag_finite_math_only) Optimization SetByCombined
8fb42bbc 1438Assume no NaNs or infinities are generated.
ecdb6d1a 1439
941a4893 1440ffixed-
f0da0668 1441Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 1442-ffixed-<register> Mark <register> as being unavailable to the compiler.
941a4893 1443
1e06725a 1444ffloat-store
87c75316 1445Common Report Var(flag_float_store) Optimization
8fb42bbc 1446Don't allocate floats and doubles in extended-precision registers.
1e06725a 1447
1448fforce-addr
3b0273a1 1449Common Ignore
4d25f9eb 1450Does nothing. Preserved for backward compatibility.
1e06725a 1451
55d51835 1452fforward-propagate
1453Common Report Var(flag_forward_propagate) Optimization
8fb42bbc 1454Perform a forward propagation pass on RTL.
42a3a38b 1455
b9be572e 1456ffp-contract=
b92389a6 1457Common Joined RejectNegative Enum(fp_contract_mode) Var(flag_fp_contract_mode) Init(FP_CONTRACT_FAST) Optimization
6ac368bb 1458-ffp-contract=[off|on|fast] Perform floating-point expression contraction.
b9be572e 1459
d62a5950 1460Enum
1461Name(fp_contract_mode) Type(enum fp_contract_mode) UnknownError(unknown floating point contraction style %qs)
1462
1463EnumValue
1464Enum(fp_contract_mode) String(off) Value(FP_CONTRACT_OFF)
1465
1466; Not implemented, fall back to conservative FP_CONTRACT_OFF.
1467EnumValue
1468Enum(fp_contract_mode) String(on) Value(FP_CONTRACT_OFF)
1469
1470EnumValue
1471Enum(fp_contract_mode) String(fast) Value(FP_CONTRACT_FAST)
1472
20702ea3 1473ffp-int-builtin-inexact
1474Common Report Var(flag_fp_int_builtin_inexact) Init(1) Optimization
1475Allow built-in functions ceil, floor, round, trunc to raise \"inexact\" exceptions.
1476
82a16202 1477; Nonzero means don't put addresses of constant functions in registers.
1478; Used for compiling the Unix kernel, where strange substitutions are
1479; done on the assembly output.
1e06725a 1480ffunction-cse
bfedbed1 1481Common Report Var(flag_no_function_cse,0) Optimization
8fb42bbc 1482Allow function addresses to be held in registers.
1e06725a 1483
ecdb6d1a 1484ffunction-sections
2e9da478 1485Common Report Var(flag_function_sections)
8fb42bbc 1486Place each function into its own section.
ecdb6d1a 1487
1e06725a 1488fgcse
87c75316 1489Common Report Var(flag_gcse) Optimization
8fb42bbc 1490Perform global common subexpression elimination.
1e06725a 1491
1492fgcse-lm
87c75316 1493Common Report Var(flag_gcse_lm) Init(1) Optimization
8fb42bbc 1494Perform enhanced load motion during global common subexpression elimination.
1e06725a 1495
1496fgcse-sm
87c75316 1497Common Report Var(flag_gcse_sm) Init(0) Optimization
8fb42bbc 1498Perform store motion after global common subexpression elimination.
1e06725a 1499
5c47e414 1500fgcse-las
87c75316 1501Common Report Var(flag_gcse_las) Init(0) Optimization
839f8415 1502Perform redundant load after store elimination in global common subexpression
8fb42bbc 1503elimination.
839f8415 1504
1505fgcse-after-reload
87c75316 1506Common Report Var(flag_gcse_after_reload) Optimization
8fb42bbc 1507Perform global common subexpression elimination after register allocation has
1508finished.
5c47e414 1509
f78f10d6 1510Enum
1511Name(dwarf_gnat_encodings) Type(int)
1512
1513EnumValue
1514Enum(dwarf_gnat_encodings) String(all) Value(DWARF_GNAT_ENCODINGS_ALL)
1515
1516EnumValue
1517Enum(dwarf_gnat_encodings) String(gdb) Value(DWARF_GNAT_ENCODINGS_GDB)
1518
1519EnumValue
1520Enum(dwarf_gnat_encodings) String(minimal) Value(DWARF_GNAT_ENCODINGS_MINIMAL)
1521
1522fgnat-encodings=
1523Common Enum(dwarf_gnat_encodings) Joined RejectNegative Report Undocumented Var(gnat_encodings)
f673492c 1524-fgnat-encodings=[all|gdb|minimal] Select the balance between GNAT encodings and standard DWARF emitted in the debug information.
f78f10d6 1525
d3399492 1526; This option is not documented yet as its semantics will change.
255b6be7 1527fgraphite
f36e946d 1528Common Report Var(flag_graphite) Optimization
8fb42bbc 1529Enable in and out of Graphite representation.
255b6be7 1530
26c166eb 1531fgraphite-identity
1532Common Report Var(flag_graphite_identity) Optimization
8fb42bbc 1533Enable Graphite Identity transformation.
26c166eb 1534
239e9670 1535fhoist-adjacent-loads
1536Common Report Var(flag_hoist_adjacent_loads) Optimization
1537Enable hoisting adjacent loads to encourage generating conditional move
8fb42bbc 1538instructions.
239e9670 1539
5068be18 1540fkeep-gc-roots-live
1541Common Undocumented Report Var(flag_keep_gc_roots_live) Optimization
1542; Always keep a pointer to a live memory block
1543
16848556 1544floop-parallelize-all
1545Common Report Var(flag_loop_parallelize_all) Optimization
8fb42bbc 1546Mark all loops as parallel.
26c166eb 1547
255b6be7 1548floop-strip-mine
4cc0f4e2 1549Common Alias(floop-nest-optimize)
8fb42bbc 1550Enable loop nest transforms. Same as -floop-nest-optimize.
255b6be7 1551
1552floop-interchange
5051abaf 1553Common Report Var(flag_loop_interchange) Optimization
1554Enable loop interchange on trees.
255b6be7 1555
1556floop-block
4cc0f4e2 1557Common Alias(floop-nest-optimize)
8fb42bbc 1558Enable loop nest transforms. Same as -floop-nest-optimize.
255b6be7 1559
120092dd 1560floop-unroll-and-jam
83d3a417 1561Common Report Var(flag_unroll_jam) Optimization
1562Perform unroll-and-jam on loops.
8fb42bbc 1563
4c0315d0 1564fgnu-tm
1565Common Report Var(flag_tm)
8fb42bbc 1566Enable support for GNU transactional memory.
4c0315d0 1567
6d5d95d6 1568fgnu-unique
1569Common Report Var(flag_gnu_unique) Init(1)
8fb42bbc 1570Use STB_GNU_UNIQUE if supported by the assembler.
6d5d95d6 1571
d60a90cc 1572floop-flatten
d094f1d6 1573Common Ignore
1574Does nothing. Preserved for backward compatibility.
d60a90cc 1575
89049f25 1576floop-nest-optimize
b3de8ca0 1577Common Report Var(flag_loop_nest_optimize) Optimization
71130ef8 1578Enable the loop nest optimizer.
89049f25 1579
a420d927 1580fstrict-volatile-bitfields
bfedbed1 1581Common Report Var(flag_strict_volatile_bitfields) Init(-1) Optimization
8fb42bbc 1582Force bitfield accesses to match their type width.
a420d927 1583
3d3e04ac 1584fstore-merging
1585Common Report Var(flag_store_merging) Optimization
1586Merge adjacent stores.
1587
ecdb6d1a 1588fguess-branch-probability
87c75316 1589Common Report Var(flag_guess_branch_prob) Optimization
8fb42bbc 1590Enable guessing of branch probabilities.
ecdb6d1a 1591
82a16202 1592; Nonzero means ignore `#ident' directives. 0 means handle them.
1593; Generate position-independent code for executables if possible
1594; On SVR4 targets, it also controls whether or not to emit a
1595; string identifying the compiler.
ecdb6d1a 1596fident
2e9da478 1597Common Report Var(flag_no_ident,0)
8fb42bbc 1598Process #ident directives.
ecdb6d1a 1599
1e06725a 1600fif-conversion
87c75316 1601Common Report Var(flag_if_conversion) Optimization
8fb42bbc 1602Perform conversion of conditional jumps to branchless equivalents.
1e06725a 1603
1604fif-conversion2
87c75316 1605Common Report Var(flag_if_conversion2) Optimization
8fb42bbc 1606Perform conversion of conditional jumps to conditional execution.
1e06725a 1607
5680e508 1608fstack-reuse=
e137219a 1609Common Joined RejectNegative Enum(stack_reuse_level) Var(flag_stack_reuse) Init(SR_ALL) Optimization
6ac368bb 1610-fstack-reuse=[all|named_vars|none] Set stack reuse level for local variables.
5680e508 1611
1612Enum
1613Name(stack_reuse_level) Type(enum stack_reuse_level) UnknownError(unknown Stack Reuse Level %qs)
1614
1615EnumValue
1616Enum(stack_reuse_level) String(all) Value(SR_ALL)
1617
1618EnumValue
1619Enum(stack_reuse_level) String(named_vars) Value(SR_NAMED_VARS)
1620
1621EnumValue
1622Enum(stack_reuse_level) String(none) Value(SR_NONE)
1623
0cb1935d 1624ftree-loop-if-convert
1625Common Report Var(flag_tree_loop_if_convert) Init(-1) Optimization
8fb42bbc 1626Convert conditional jumps in innermost loops to branchless equivalents.
0cb1935d 1627
3b91ccd9 1628ftree-loop-if-convert-stores
b6f4c9b5 1629Common Ignore
1630Does nothing. Preserved for backward compatibility.
3b91ccd9 1631
82a16202 1632; -finhibit-size-directive inhibits output of .size for ELF.
1633; This is used only for compiling crtstuff.c,
1634; and it may be extended to other effects
1635; needed for crtstuff.c on other systems.
ecdb6d1a 1636finhibit-size-directive
2e9da478 1637Common Report Var(flag_inhibit_size_directive)
8fb42bbc 1638Do not generate .size directives.
ecdb6d1a 1639
f8daee9b 1640findirect-inlining
d1f68cd8 1641Common Report Var(flag_indirect_inlining) Optimization
8fb42bbc 1642Perform indirect inlining.
f8daee9b 1643
b75cad1f 1644; General flag to enable inlining. Specifying -fno-inline will disable
1645; all inlining apart from always-inline functions.
1e06725a 1646finline
e5166d71 1647Common Report Var(flag_no_inline,0) Init(0) Optimization
8fb42bbc 1648Enable inlining of function declared \"inline\", disabling disables all inlining.
1e06725a 1649
b97510b2 1650finline-small-functions
1651Common Report Var(flag_inline_small_functions) Optimization
8fb42bbc 1652Integrate functions into their callers when code size is known not to grow.
b97510b2 1653
1e06725a 1654finline-functions
87c75316 1655Common Report Var(flag_inline_functions) Optimization
8fb42bbc 1656Integrate functions not declared \"inline\" into their callers when profitable.
1e06725a 1657
f1aa280c 1658finline-functions-called-once
055af069 1659Common Report Var(flag_inline_functions_called_once) Optimization
8fb42bbc 1660Integrate functions only required by their single caller.
9e0baf4d 1661
39470ac3 1662finline-limit-
67089c6b 1663Common RejectNegative Joined Alias(finline-limit=)
39470ac3 1664
1665finline-limit=
1666Common RejectNegative Joined UInteger
8fb42bbc 1667-finline-limit=<number> Limit the size of inlined functions to <number>.
39470ac3 1668
1cd6e20d 1669finline-atomics
1670Common Report Var(flag_inline_atomics) Init(1) Optimization
1671Inline __atomic operations when a lock free instruction sequence is available.
1672
3c0f15b4 1673fcf-protection
1674Common RejectNegative Alias(fcf-protection=,full)
1675
1676fcf-protection=
1677Common Report Joined RejectNegative Enum(cf_protection_level) Var(flag_cf_protection) Init(CF_NONE)
1678-fcf-protection=[full|branch|return|none] Instrument functions with checks to verify jump/call/return control-flow transfer
1679instructions have valid targets.
1680
1681Enum
dc4ed9fd 1682Name(cf_protection_level) Type(enum cf_protection_level) UnknownError(unknown Control-Flow Protection Level %qs)
3c0f15b4 1683
1684EnumValue
1685Enum(cf_protection_level) String(full) Value(CF_FULL)
1686
1687EnumValue
1688Enum(cf_protection_level) String(branch) Value(CF_BRANCH)
1689
1690EnumValue
1691Enum(cf_protection_level) String(return) Value(CF_RETURN)
1692
1693EnumValue
1694Enum(cf_protection_level) String(none) Value(CF_NONE)
1695
ecdb6d1a 1696finstrument-functions
2e9da478 1697Common Report Var(flag_instrument_function_entry_exit)
8fb42bbc 1698Instrument function entry and exit with profiling calls.
ecdb6d1a 1699
a95c0776 1700finstrument-functions-exclude-function-list=
1701Common RejectNegative Joined
8fb42bbc 1702-finstrument-functions-exclude-function-list=name,... Do not instrument listed functions.
a95c0776 1703
1704finstrument-functions-exclude-file-list=
1705Common RejectNegative Joined
8fb42bbc 1706-finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files.
a95c0776 1707
a17a73c7 1708fipa-cp
87c75316 1709Common Report Var(flag_ipa_cp) Optimization
8fb42bbc 1710Perform interprocedural constant propagation.
a17a73c7 1711
2a15795f 1712fipa-cp-clone
1713Common Report Var(flag_ipa_cp_clone) Optimization
8fb42bbc 1714Perform cloning to make Interprocedural constant propagation stronger.
2a15795f 1715
7715e0c8 1716fipa-cp-alignment
afdf4bf2 1717Common Ignore
1718Does nothing. Preserved for backward compatibility.
7715e0c8 1719
a54071b2 1720fipa-bit-cp
1721Common Report Var(flag_ipa_bit_cp) Optimization
1722Perform interprocedural bitwise constant propagation.
1723
4e2db0ad 1724fipa-profile
1725Common Report Var(flag_ipa_profile) Init(0) Optimization
8fb42bbc 1726Perform interprocedural profile propagation.
f7d118a9 1727
bdf4f142 1728fipa-pta
87c75316 1729Common Report Var(flag_ipa_pta) Init(0) Optimization
8fb42bbc 1730Perform interprocedural points-to analysis.
bdf4f142 1731
4e2db0ad 1732fipa-pure-const
1733Common Report Var(flag_ipa_pure_const) Init(0) Optimization
8fb42bbc 1734Discover pure and const functions.
4e2db0ad 1735
52200d03 1736fipa-icf
1737Common Report Var(flag_ipa_icf) Optimization
8fb42bbc 1738Perform Identical Code Folding for functions and read-only variables.
52200d03 1739
1740fipa-icf-functions
1741Common Report Var(flag_ipa_icf_functions) Optimization
8fb42bbc 1742Perform Identical Code Folding for functions.
52200d03 1743
1744fipa-icf-variables
131ad74b 1745Common Report Var(flag_ipa_icf_variables) Optimization
8fb42bbc 1746Perform Identical Code Folding for variables.
52200d03 1747
f7d118a9 1748fipa-reference
87c75316 1749Common Report Var(flag_ipa_reference) Init(0) Optimization
8c8b8b86 1750Discover read-only and non addressable static variables.
1751
1752fipa-reference-addressable
1753Common Report Var(flag_ipa_reference_addressable) Init(0) Optimization
1754Discover read-only, write-only and non-addressable static variables.
f7d118a9 1755
51bdb99d 1756fipa-stack-alignment
1757Common Report Var(flag_ipa_stack_alignment) Init(1) Optimization
1758Reduce stack alignment on call sites if possible.
1759
604cde73 1760fipa-matrix-reorg
fa62b5da 1761Common Ignore
1762Does nothing. Preserved for backward compatibility.
604cde73 1763
f27ac341 1764fipa-struct-reorg
210a8eb6 1765Common Ignore
1766Does nothing. Preserved for backward compatibility.
f27ac341 1767
25a8e007 1768fipa-vrp
1769Common Report Var(flag_ipa_vrp) Optimization
1770Perform IPA Value Range Propagation.
1771
47dd2e78 1772fira-algorithm=
bfedbed1 1773Common Joined RejectNegative Enum(ira_algorithm) Var(flag_ira_algorithm) Init(IRA_ALGORITHM_CB) Optimization
6ac368bb 1774-fira-algorithm=[CB|priority] Set the used IRA algorithm.
14792f4e 1775
d62a5950 1776Enum
1777Name(ira_algorithm) Type(enum ira_algorithm) UnknownError(unknown IRA algorithm %qs)
1778
1779EnumValue
1780Enum(ira_algorithm) String(CB) Value(IRA_ALGORITHM_CB)
1781
1782EnumValue
1783Enum(ira_algorithm) String(priority) Value(IRA_ALGORITHM_PRIORITY)
1784
14792f4e 1785fira-region=
bfedbed1 1786Common Joined RejectNegative Enum(ira_region) Var(flag_ira_region) Init(IRA_REGION_AUTODETECT) Optimization
6ac368bb 1787-fira-region=[one|all|mixed] Set regions for IRA.
47dd2e78 1788
d62a5950 1789Enum
1790Name(ira_region) Type(enum ira_region) UnknownError(unknown IRA region %qs)
1791
1792EnumValue
1793Enum(ira_region) String(one) Value(IRA_REGION_ONE)
1794
1795EnumValue
1796Enum(ira_region) String(all) Value(IRA_REGION_ALL)
1797
1798EnumValue
1799Enum(ira_region) String(mixed) Value(IRA_REGION_MIXED)
1800
1ec78e16 1801fira-hoist-pressure
1802Common Report Var(flag_ira_hoist_pressure) Init(1) Optimization
1803Use IRA based register pressure calculation
1804in RTL hoist optimizations.
1805
e8eed2f8 1806fira-loop-pressure
155354e5 1807Common Report Var(flag_ira_loop_pressure) Optimization
e8eed2f8 1808Use IRA based register pressure calculation
1809in RTL loop optimizations.
1810
47dd2e78 1811fira-share-save-slots
bfedbed1 1812Common Report Var(flag_ira_share_save_slots) Init(1) Optimization
47dd2e78 1813Share slots for saving different hard registers.
1814
1815fira-share-spill-slots
bfedbed1 1816Common Report Var(flag_ira_share_spill_slots) Init(1) Optimization
47dd2e78 1817Share stack slots for spilled pseudo-registers.
1818
1819fira-verbose=
4aafe913 1820Common RejectNegative Joined UInteger Var(flag_ira_verbose) Init(5)
cf210371 1821-fira-verbose=<number> Control IRA's level of diagnostic messages.
47dd2e78 1822
dec41e98 1823fivopts
87c75316 1824Common Report Var(flag_ivopts) Init(1) Optimization
8fb42bbc 1825Optimize induction variables on trees.
dec41e98 1826
51d8e657 1827fjump-tables
87c75316 1828Common Var(flag_jump_tables) Init(1) Optimization
8fb42bbc 1829Use jump tables for sufficiently large switch statements.
51d8e657 1830
1e06725a 1831fkeep-inline-functions
2e9da478 1832Common Report Var(flag_keep_inline_functions)
8fb42bbc 1833Generate code for functions even if they are fully inlined.
1e06725a 1834
c071eedc 1835fkeep-static-functions
1836Common Report Var(flag_keep_static_functions)
8fb42bbc 1837Generate code for static functions even if they are never called.
c071eedc 1838
1e06725a 1839fkeep-static-consts
2e9da478 1840Common Report Var(flag_keep_static_consts) Init(1)
8fb42bbc 1841Emit static const variables even if they are not used.
1e06725a 1842
ecdb6d1a 1843fleading-underscore
2e9da478 1844Common Report Var(flag_leading_underscore) Init(-1)
8fb42bbc 1845Give external symbols a leading underscore.
ecdb6d1a 1846
4f87b914 1847floop-optimize
3b0273a1 1848Common Ignore
334ec2d8 1849Does nothing. Preserved for backward compatibility.
4f87b914 1850
497ba60f 1851flra-remat
1852Common Report Var(flag_lra_remat) Optimization
8fb42bbc 1853Do CFG-sensitive rematerialization in LRA.
497ba60f 1854
7bfefa9d 1855flto
cbcf2791 1856Common
7bfefa9d 1857Enable link-time optimization.
1858
cbcf2791 1859flto=
1860Common RejectNegative Joined Var(flag_lto)
1861Link-time optimization with number of parallel jobs or jobserver.
1862
4a137074 1863Enum
1864Name(lto_partition_model) Type(enum lto_partition_model) UnknownError(unknown LTO partitioning model %qs)
48e3ea52 1865
4a137074 1866EnumValue
1867Enum(lto_partition_model) String(none) Value(LTO_PARTITION_NONE)
48e3ea52 1868
4a137074 1869EnumValue
1870Enum(lto_partition_model) String(one) Value(LTO_PARTITION_ONE)
1871
1872EnumValue
1873Enum(lto_partition_model) String(balanced) Value(LTO_PARTITION_BALANCED)
1874
1875EnumValue
1876Enum(lto_partition_model) String(1to1) Value(LTO_PARTITION_1TO1)
1877
1878EnumValue
1879Enum(lto_partition_model) String(max) Value(LTO_PARTITION_MAX)
0851d795 1880
4a137074 1881flto-partition=
1882Common Joined RejectNegative Enum(lto_partition_model) Var(flag_lto_partition) Init(LTO_PARTITION_BALANCED)
8fb42bbc 1883Specify the algorithm to partition symbols and vars at linktime.
cbcf2791 1884
7bfefa9d 1885; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
1886flto-compression-level=
52368c34 1887Common Joined RejectNegative UInteger Var(flag_lto_compression_level) Init(-1) IntegerRange(0, 9)
8fb42bbc 1888-flto-compression-level=<number> Use zlib compression level <number> for IL.
7bfefa9d 1889
d585ba22 1890flto-odr-type-merging
1891Common Report Var(flag_lto_odr_type_mering) Init(1)
8fb42bbc 1892Merge C++ types using One Definition Rule.
d585ba22 1893
7bfefa9d 1894flto-report
596c40fb 1895Common Report Var(flag_lto_report) Init(0)
8fb42bbc 1896Report various link-time optimization statistics.
7bfefa9d 1897
b63a7a3e 1898flto-report-wpa
1899Common Report Var(flag_lto_report_wpa) Init(0)
8fb42bbc 1900Report various link-time optimization statistics for WPA only.
b63a7a3e 1901
ecdb6d1a 1902fmath-errno
ecee1b29 1903Common Report Var(flag_errno_math) Init(1) Optimization SetByCombined
8fb42bbc 1904Set errno after built-in math functions.
ecdb6d1a 1905
566d7c74 1906fmax-errors=
1907Common Joined RejectNegative UInteger Var(flag_max_errors)
8fb42bbc 1908-fmax-errors=<number> Maximum number of errors to report.
566d7c74 1909
ecdb6d1a 1910fmem-report
2e9da478 1911Common Report Var(mem_report)
8fb42bbc 1912Report on permanent memory allocation.
ecdb6d1a 1913
93e5f148 1914fmem-report-wpa
1915Common Report Var(mem_report_wpa)
8fb42bbc 1916Report on permanent memory allocation in WPA only.
93e5f148 1917
82a16202 1918; This will attempt to merge constant section constants, if 1 only
1919; string constants and constants from constant pool, if 2 also constant
1920; variables.
ecdb6d1a 1921fmerge-all-constants
ce7711df 1922Common Report Var(flag_merge_constants,2) Init(1)
8fb42bbc 1923Attempt to merge identical constants and constant variables.
ecdb6d1a 1924
1925fmerge-constants
ce7711df 1926Common Report Var(flag_merge_constants,1)
8fb42bbc 1927Attempt to merge identical constants across compilation units.
ecdb6d1a 1928
7765591b 1929fmerge-debug-strings
1930Common Report Var(flag_merge_debug_strings) Init(1)
8fb42bbc 1931Attempt to merge identical debug strings across compilation units.
7765591b 1932
1e06725a 1933fmessage-length=
1934Common RejectNegative Joined UInteger
8fb42bbc 1935-fmessage-length=<number> Limit diagnostics to <number> characters per line. 0 suppresses line-wrapping.
1e06725a 1936
406a73e7 1937fmodulo-sched
87c75316 1938Common Report Var(flag_modulo_sched) Optimization
8fb42bbc 1939Perform SMS based modulo scheduling before the first scheduling pass.
406a73e7 1940
3a943084 1941fmodulo-sched-allow-regmoves
bfedbed1 1942Common Report Var(flag_modulo_sched_allow_regmoves) Optimization
8fb42bbc 1943Perform SMS based modulo scheduling with register moves allowed.
3a943084 1944
3a0ecac2 1945fmove-loop-invariants
1941e89d 1946Common Report Var(flag_move_loop_invariants) Optimization
8fb42bbc 1947Move loop invariant computations out of loops.
3a0ecac2 1948
3072d30e 1949fdce
76c71f34 1950Common Var(flag_dce) Init(1) Optimization
8fb42bbc 1951Use the RTL dead code elimination pass.
3072d30e 1952
1953fdse
76c71f34 1954Common Var(flag_dse) Init(1) Optimization
8fb42bbc 1955Use the RTL dead store elimination pass.
3072d30e 1956
f045d41d 1957freschedule-modulo-scheduled-loops
87c75316 1958Common Report Var(flag_resched_modulo_sched) Optimization
8fb42bbc 1959Enable/Disable the traditional scheduling in loops that already passed modulo scheduling.
f045d41d 1960
ecdb6d1a 1961fnon-call-exceptions
87c75316 1962Common Report Var(flag_non_call_exceptions) Optimization
8fb42bbc 1963Support synchronous non-call exceptions.
ecdb6d1a 1964
38e21583 1965foffload=
1966Common Driver Joined MissingArgError(options or targets missing after %qs)
8fb42bbc 1967-foffload=<targets>=<options> Specify offloading targets and options for them.
38e21583 1968
1969foffload-abi=
1970Common Joined RejectNegative Enum(offload_abi) Var(flag_offload_abi) Init(OFFLOAD_ABI_UNSET)
8fb42bbc 1971-foffload-abi=[lp64|ilp32] Set the ABI to use in an offload compiler.
38e21583 1972
1973Enum
1974Name(offload_abi) Type(enum offload_abi) UnknownError(unknown offload ABI %qs)
1975
1976EnumValue
1977Enum(offload_abi) String(ilp32) Value(OFFLOAD_ABI_ILP32)
1978
1979EnumValue
1980Enum(offload_abi) String(lp64) Value(OFFLOAD_ABI_LP64)
1981
1e06725a 1982fomit-frame-pointer
87c75316 1983Common Report Var(flag_omit_frame_pointer) Optimization
8fb42bbc 1984When possible do not generate stack frames.
1e06725a 1985
7bd765d4 1986fopt-info
1987Common Report Var(flag_opt_info) Optimization
8fb42bbc 1988Enable all optimization info dumps on stderr.
7bd765d4 1989
1990fopt-info-
1991Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 1992-fopt-info[-<type>=filename] Dump compiler optimization details.
7bd765d4 1993
9dcf2a11 1994fsave-optimization-record
1995Common Report Var(flag_save_optimization_record) Optimization
1996Write a SRCFILE.opt-record.json file detailing what optimizations were performed.
1997
ecdb6d1a 1998foptimize-register-move
284f0696 1999Common Ignore
2000Does nothing. Preserved for backward compatibility.
ecdb6d1a 2001
1e06725a 2002foptimize-sibling-calls
87c75316 2003Common Report Var(flag_optimize_sibling_calls) Optimization
8fb42bbc 2004Optimize sibling and tail recursive calls.
1e06725a 2005
2862cf88 2006fpartial-inlining
bfedbed1 2007Common Report Var(flag_partial_inlining) Optimization
8fb42bbc 2008Perform partial inlining.
2862cf88 2009
51949610 2010fpre-ipa-mem-report
2011Common Report Var(pre_ipa_mem_report)
8fb42bbc 2012Report on memory allocation before interprocedural optimization.
51949610 2013
2014fpost-ipa-mem-report
2015Common Report Var(post_ipa_mem_report)
8fb42bbc 2016Report on memory allocation before interprocedural optimization.
51949610 2017
ecdb6d1a 2018fpack-struct
87c75316 2019Common Report Var(flag_pack_struct) Optimization
8fb42bbc 2020Pack structure members together without holes.
ecdb6d1a 2021
6b5553e5 2022fpack-struct=
87c75316 2023Common RejectNegative Joined UInteger Optimization
8fb42bbc 2024-fpack-struct=<number> Set initial maximum structure member alignment.
6b5553e5 2025
1e06725a 2026fpcc-struct-return
4aafe913 2027Common Report Var(flag_pcc_struct_return,1) Init(DEFAULT_PCC_STRUCT_RETURN)
8fb42bbc 2028Return small aggregates in memory, not registers.
1e06725a 2029
2030fpeel-loops
87c75316 2031Common Report Var(flag_peel_loops) Optimization
8fb42bbc 2032Perform loop peeling.
1e06725a 2033
2034fpeephole
87c75316 2035Common Report Var(flag_no_peephole,0) Optimization
8fb42bbc 2036Enable machine specific peephole optimizations.
1e06725a 2037
ecdb6d1a 2038fpeephole2
87c75316 2039Common Report Var(flag_peephole2) Optimization
8fb42bbc 2040Enable an RTL peephole pass before sched2.
ecdb6d1a 2041
82a16202 2042fPIC
5ec4a949 2043Common Report Var(flag_pic,2) Negative(fPIE) Init(-1)
8fb42bbc 2044Generate position-independent code if possible (large mode).
82a16202 2045
2046fPIE
e9abca4f 2047Common Report Var(flag_pie,2) Negative(fpic) Init(-1)
8fb42bbc 2048Generate position-independent code for executables if possible (large mode).
82a16202 2049
ecdb6d1a 2050fpic
5ec4a949 2051Common Report Var(flag_pic,1) Negative(fpie) Init(-1)
8fb42bbc 2052Generate position-independent code if possible (small mode).
ecdb6d1a 2053
2054fpie
e9abca4f 2055Common Report Var(flag_pie,1) Negative(fPIC) Init(-1)
8fb42bbc 2056Generate position-independent code for executables if possible (small mode).
ecdb6d1a 2057
562ef5cc 2058fplt
2059Common Report Var(flag_plt) Init(1) Optimization
8fb42bbc 2060Use PLT for PIC calls (-fno-plt: load the address from GOT at call site).
562ef5cc 2061
9227b6fc 2062fplugin=
f0da0668 2063Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 2064Specify a plugin to load.
9227b6fc 2065
2066fplugin-arg-
f0da0668 2067Common Joined RejectNegative Var(common_deferred_options) Defer
8fb42bbc 2068-fplugin-arg-<name>-<key>[=<value>] Specify argument <key>=<value> for plugin <name>.
9227b6fc 2069
ad4a85ad 2070fpredictive-commoning
76c71f34 2071Common Report Var(flag_predictive_commoning) Optimization
ad4a85ad 2072Run predictive commoning optimization.
2073
1e06725a 2074fprefetch-loop-arrays
cd459e62 2075Common Report Var(flag_prefetch_loop_arrays) Init(-1) Optimization
8fb42bbc 2076Generate prefetch instructions, if available, for arrays in loops.
1e06725a 2077
ecdb6d1a 2078fprofile
2e9da478 2079Common Report Var(profile_flag)
8fb42bbc 2080Enable basic program profiling code.
ecdb6d1a 2081
9bdf2425 2082fprofile-abs-path
2083Common Report Var(profile_abs_path_flag)
2084Generate absolute source path names for gcov.
2085
ecdb6d1a 2086fprofile-arcs
2e9da478 2087Common Report Var(profile_arc_flag)
8fb42bbc 2088Insert arc-based program profiling code.
ecdb6d1a 2089
3e3a0e9c 2090fprofile-dir=
cc4fa57a 2091Common Joined RejectNegative Var(profile_data_prefix)
3e3a0e9c 2092Set the top-level directory for storing the profile data.
2093The default is 'pwd'.
2094
e0dc6f2b 2095fprofile-correction
2096Common Report Var(flag_profile_correction)
8fb42bbc 2097Enable correction of flow inconsistent profile data input.
e0dc6f2b 2098
7132b755 2099fprofile-update=
2100Common Joined RejectNegative Enum(profile_update) Var(flag_profile_update) Init(PROFILE_UPDATE_SINGLE)
3af33bcf 2101-fprofile-update=[single|atomic|prefer-atomic] Set the profile update method.
7132b755 2102
aed74248 2103fprofile-filter-files=
2104Common Joined RejectNegative Var(flag_profile_filter_files)
2105Instrument only functions from files where names match any regular expression (separated by a semi-colon).
2106
2107fprofile-exclude-files=
2108Common Joined RejectNegative Var(flag_profile_exclude_files)
2109Instrument only functions from files where names do not match all the regular expressions (separated by a semi-colon).
2110
7132b755 2111Enum
2112Name(profile_update) Type(enum profile_update) UnknownError(unknown profile update method %qs)
2113
2114EnumValue
2115Enum(profile_update) String(single) Value(PROFILE_UPDATE_SINGLE)
2116
2117EnumValue
2118Enum(profile_update) String(atomic) Value(PROFILE_UPDATE_ATOMIC)
2119
3af33bcf 2120EnumValue
2121Enum(profile_update) String(prefer-atomic) Value(PROFILE_UPDATE_PREFER_ATOMIC)
2122
7dea76ba 2123fprofile-generate
2124Common
8fb42bbc 2125Enable common options for generating profile info for profile feedback directed optimizations.
7dea76ba 2126
3e3a0e9c 2127fprofile-generate=
2128Common Joined RejectNegative
8fb42bbc 2129Enable common options for generating profile info for profile feedback directed optimizations, and set -fprofile-dir=.
3e3a0e9c 2130
7dea76ba 2131fprofile-use
3e3a0e9c 2132Common Var(flag_profile_use)
8fb42bbc 2133Enable common options for performing profile feedback directed optimizations.
7dea76ba 2134
3e3a0e9c 2135fprofile-use=
2136Common Joined RejectNegative
8fb42bbc 2137Enable common options for performing profile feedback directed optimizations, and set -fprofile-dir=.
3e3a0e9c 2138
1c6a7b8c 2139fprofile-values
2e9da478 2140Common Report Var(flag_profile_values)
8fb42bbc 2141Insert code to profile values of expressions.
1c6a7b8c 2142
5168ef25 2143fprofile-report
2144Common Report Var(profile_report)
8fb42bbc 2145Report on consistency of profile.
5168ef25 2146
af48f0b1 2147fprofile-reorder-functions
2148Common Report Var(flag_profile_reorder_functions)
8fb42bbc 2149Enable function reordering that improves code placement.
af48f0b1 2150
e6c4532a 2151fpatchable-function-entry=
2152Common Joined Optimization
2153Insert NOP instructions at each function entry.
2154
1e06725a 2155frandom-seed
9faf44d6 2156Common Var(common_deferred_options) Defer
1e06725a 2157
2158frandom-seed=
9faf44d6 2159Common Joined RejectNegative Var(common_deferred_options) Defer
4589a801 2160-frandom-seed=<string> Make compile reproducible using <string>.
1e06725a 2161
7c6733e8 2162; This switch causes the command line that was used to create an
2163; object file to be recorded into the object file. The exact format
2164; of this recording is target and binary file format dependent.
2165; It is related to the -fverbose-asm switch, but that switch only
2166; records information in the assembler output file as comments, so
2167; they never reach the object file.
2168frecord-gcc-switches
2169Common Report Var(flag_record_gcc_switches)
2170Record gcc command line switches in the object file.
2171
1e06725a 2172freg-struct-return
5461e683 2173Common Report Var(flag_pcc_struct_return,0) Optimization
8fb42bbc 2174Return small aggregates in registers.
1e06725a 2175
ecdb6d1a 2176fregmove
284f0696 2177Common Ignore
2178Does nothing. Preserved for backward compatibility.
ecdb6d1a 2179
e65bc032 2180flifetime-dse
5065f8a0 2181Common Report Var(flag_lifetime_dse,2) Init(2) Optimization
e65bc032 2182Tell DSE that the storage for a C++ object is dead when the constructor
2183starts and when the destructor finishes.
2184
5065f8a0 2185flifetime-dse=
52368c34 2186Common Joined RejectNegative UInteger Var(flag_lifetime_dse) Optimization IntegerRange(0, 2)
5065f8a0 2187
126dab7c 2188flive-patching
2189Common RejectNegative Alias(flive-patching=,inline-clone) Optimization
2190
2191flive-patching=
2192Common Report Joined RejectNegative Enum(live_patching_level) Var(flag_live_patching) Init(LIVE_PATCHING_NONE) Optimization
2193-flive-patching=[inline-only-static|inline-clone] Control IPA
2194optimizations to provide a safe compilation for live-patching. At the same
2195time, provides multiple-level control on the enabled IPA optimizations.
2196
2197Enum
2198Name(live_patching_level) Type(enum live_patching_level) UnknownError(unknown Live-Patching Level %qs)
2199
2200EnumValue
2201Enum(live_patching_level) String(inline-only-static) Value(LIVE_PATCHING_INLINE_ONLY_STATIC)
2202
2203EnumValue
2204Enum(live_patching_level) String(inline-clone) Value(LIVE_PATCHING_INLINE_CLONE)
2205
57a8bf1b 2206flive-range-shrinkage
2207Common Report Var(flag_live_range_shrinkage) Init(0) Optimization
8fb42bbc 2208Relief of register pressure through live range shrinkage.
57a8bf1b 2209
ecdb6d1a 2210frename-registers
87c75316 2211Common Report Var(flag_rename_registers) Init(2) Optimization
8fb42bbc 2212Perform a register renaming optimization pass.
ecdb6d1a 2213
012ad66c 2214fschedule-fusion
2215Common Report Var(flag_schedule_fusion) Init(2) Optimization
8fb42bbc 2216Perform a target dependent instruction fusion optimization pass.
012ad66c 2217
ecdb6d1a 2218freorder-blocks
87c75316 2219Common Report Var(flag_reorder_blocks) Optimization
8fb42bbc 2220Reorder basic blocks to improve code placement.
ecdb6d1a 2221
e57ef194 2222freorder-blocks-algorithm=
2223Common Joined RejectNegative Enum(reorder_blocks_algorithm) Var(flag_reorder_blocks_algorithm) Init(REORDER_BLOCKS_ALGORITHM_SIMPLE) Optimization
6ac368bb 2224-freorder-blocks-algorithm=[simple|stc] Set the used basic block reordering algorithm.
e57ef194 2225
2226Enum
2227Name(reorder_blocks_algorithm) Type(enum reorder_blocks_algorithm) UnknownError(unknown basic block reordering algorithm %qs)
2228
2229EnumValue
2230Enum(reorder_blocks_algorithm) String(simple) Value(REORDER_BLOCKS_ALGORITHM_SIMPLE)
2231
2232EnumValue
2233Enum(reorder_blocks_algorithm) String(stc) Value(REORDER_BLOCKS_ALGORITHM_STC)
2234
4f18499c 2235freorder-blocks-and-partition
87c75316 2236Common Report Var(flag_reorder_blocks_and_partition) Optimization
8fb42bbc 2237Reorder basic blocks and partition into hot and cold sections.
4f18499c 2238
ecdb6d1a 2239freorder-functions
87c75316 2240Common Report Var(flag_reorder_functions) Optimization
8fb42bbc 2241Reorder functions to improve code placement.
ecdb6d1a 2242
1e06725a 2243frerun-cse-after-loop
c17f64cc 2244Common Report Var(flag_rerun_cse_after_loop) Optimization
8fb42bbc 2245Add a common subexpression elimination pass after loop optimizations.
1e06725a 2246
4f87b914 2247frerun-loop-opt
3b0273a1 2248Common Ignore
334ec2d8 2249Does nothing. Preserved for backward compatibility.
4f87b914 2250
5466f589 2251frounding-math
ecee1b29 2252Common Report Var(flag_rounding_math) Optimization SetByCombined
8fb42bbc 2253Disable optimizations that assume default FP rounding behavior.
5466f589 2254
ecdb6d1a 2255fsched-interblock
87c75316 2256Common Report Var(flag_schedule_interblock) Init(1) Optimization
8fb42bbc 2257Enable scheduling across basic blocks.
ecdb6d1a 2258
a7dcf969 2259fsched-pressure
2260Common Report Var(flag_sched_pressure) Init(0) Optimization
8fb42bbc 2261Enable register pressure sensitive insn scheduling.
a7dcf969 2262
ecdb6d1a 2263fsched-spec
87c75316 2264Common Report Var(flag_schedule_speculative) Init(1) Optimization
8fb42bbc 2265Allow speculative motion of non-loads.
ecdb6d1a 2266
2267fsched-spec-load
87c75316 2268Common Report Var(flag_schedule_speculative_load) Optimization
8fb42bbc 2269Allow speculative motion of some loads.
ecdb6d1a 2270
2271fsched-spec-load-dangerous
87c75316 2272Common Report Var(flag_schedule_speculative_load_dangerous) Optimization
8fb42bbc 2273Allow speculative motion of more loads.
ecdb6d1a 2274
1e06725a 2275fsched-verbose=
043bc144 2276Common RejectNegative Joined UInteger Var(sched_verbose_param) Init(1)
8fb42bbc 2277-fsched-verbose=<number> Set the verbosity level of the scheduler.
1e06725a 2278
ecdb6d1a 2279fsched2-use-superblocks
87c75316 2280Common Report Var(flag_sched2_use_superblocks) Optimization
8fb42bbc 2281If scheduling post reload, do superblock scheduling.
ecdb6d1a 2282
2283fsched2-use-traces
3b0273a1 2284Common Ignore
fda153ea 2285Does nothing. Preserved for backward compatibility.
ecdb6d1a 2286
1e06725a 2287fschedule-insns
87c75316 2288Common Report Var(flag_schedule_insns) Optimization
8fb42bbc 2289Reschedule instructions before register allocation.
1e06725a 2290
2291fschedule-insns2
87c75316 2292Common Report Var(flag_schedule_insns_after_reload) Optimization
8fb42bbc 2293Reschedule instructions after register allocation.
1e06725a 2294
e1ab7874 2295; This flag should be on when a target implements non-trivial
2296; scheduling hooks, maybe saving some information for its own sake.
8fb42bbc 2297; On IA64, for example, this is used for correct bundling.
e1ab7874 2298fselective-scheduling
2299Common Report Var(flag_selective_scheduling) Optimization
8fb42bbc 2300Schedule instructions using selective scheduling algorithm.
e1ab7874 2301
2302fselective-scheduling2
8fb42bbc 2303Common Report Var(flag_selective_scheduling2) Optimization
2304Run selective scheduling after reload.
e1ab7874 2305
c081d2fc 2306fself-test=
2307Common Undocumented Joined Var(flag_self_test)
2308Run self-tests, using the given path to locate test files.
99b4f3a2 2309
e1ab7874 2310fsel-sched-pipelining
2311Common Report Var(flag_sel_sched_pipelining) Init(0) Optimization
8fb42bbc 2312Perform software pipelining of inner loops during selective scheduling.
e1ab7874 2313
2314fsel-sched-pipelining-outer-loops
2315Common Report Var(flag_sel_sched_pipelining_outer_loops) Init(0) Optimization
8fb42bbc 2316Perform software pipelining of outer loops during selective scheduling.
e1ab7874 2317
2318fsel-sched-reschedule-pipelined
2319Common Report Var(flag_sel_sched_reschedule_pipelined) Init(0) Optimization
8fb42bbc 2320Reschedule pipelined regions without pipelining.
e1ab7874 2321
92bfaaee 2322fsemantic-interposition
2323Common Report Var(flag_semantic_interposition) Init(1)
8fb42bbc 2324Allow interposing function (or variables) by ones with different semantics (or initializer) respectively by dynamic linker.
92bfaaee 2325
82a16202 2326; sched_stalled_insns means that insns can be moved prematurely from the queue
2327; of stalled insns into the ready list.
52c4b43f 2328fsched-stalled-insns
46f8e3b0 2329Common Report Var(flag_sched_stalled_insns) Optimization UInteger
8fb42bbc 2330Allow premature scheduling of queued insns.
52c4b43f 2331
2332fsched-stalled-insns=
bfedbed1 2333Common RejectNegative Joined UInteger Optimization
8fb42bbc 2334-fsched-stalled-insns=<number> Set number of queued insns that can be prematurely scheduled.
52c4b43f 2335
82a16202 2336; sched_stalled_insns_dep controls how many recently scheduled cycles will
2337; be examined for a dependency on a stalled insn that is candidate for
2338; premature removal from the queue of stalled insns into the ready list (has
2339; an effect only if the flag 'sched_stalled_insns' is set).
52c4b43f 2340fsched-stalled-insns-dep
46f8e3b0 2341Common Report Var(flag_sched_stalled_insns_dep,1) Init(1) Optimization UInteger
8fb42bbc 2342Set dependence distance checking in premature scheduling of queued insns.
52c4b43f 2343
2344fsched-stalled-insns-dep=
bfedbed1 2345Common RejectNegative Joined UInteger Optimization
8fb42bbc 2346-fsched-stalled-insns-dep=<number> Set dependence distance checking in premature scheduling of queued insns.
52c4b43f 2347
4d569386 2348fsched-group-heuristic
2349Common Report Var(flag_sched_group_heuristic) Init(1) Optimization
8fb42bbc 2350Enable the group heuristic in the scheduler.
4d569386 2351
2352fsched-critical-path-heuristic
2353Common Report Var(flag_sched_critical_path_heuristic) Init(1) Optimization
8fb42bbc 2354Enable the critical path heuristic in the scheduler.
4d569386 2355
2356fsched-spec-insn-heuristic
2357Common Report Var(flag_sched_spec_insn_heuristic) Init(1) Optimization
8fb42bbc 2358Enable the speculative instruction heuristic in the scheduler.
4d569386 2359
4d569386 2360fsched-rank-heuristic
2361Common Report Var(flag_sched_rank_heuristic) Init(1) Optimization
8fb42bbc 2362Enable the rank heuristic in the scheduler.
4d569386 2363
2364fsched-last-insn-heuristic
2365Common Report Var(flag_sched_last_insn_heuristic) Init(1) Optimization
8fb42bbc 2366Enable the last instruction heuristic in the scheduler.
4d569386 2367
2368fsched-dep-count-heuristic
2369Common Report Var(flag_sched_dep_count_heuristic) Init(1) Optimization
8fb42bbc 2370Enable the dependent count heuristic in the scheduler.
4d569386 2371
f2d0e9f1 2372fsection-anchors
87c75316 2373Common Report Var(flag_section_anchors) Optimization
8fb42bbc 2374Access data in the same section from shared anchor points.
f2d0e9f1 2375
2b74c150 2376fsee
3b0273a1 2377Common Ignore
1bc99153 2378Does nothing. Preserved for backward compatibility.
2b74c150 2379
a5b022e7 2380fzee
1d4227c3 2381Common Ignore
2382Does nothing. Preserved for backward compatibility.
2383
2384free
2385Common Report Var(flag_ree) Init(0)
2386Turn on Redundant Extensions Elimination pass.
a5b022e7 2387
5fd4bf3b 2388fshow-column
abf6a617 2389Common Report Var(flag_show_column) Init(1)
8fb42bbc 2390Show column numbers in diagnostics, when available. Default on.
5fd4bf3b 2391
1f021f97 2392fshrink-wrap
2393Common Report Var(flag_shrink_wrap) Optimization
2394Emit function prologues only before parts of the function that need it,
2395rather than at the top of the function.
2396
9be10499 2397fshrink-wrap-separate
2398Common Report Var(flag_shrink_wrap_separate) Init(1) Optimization
2399Shrink-wrap parts of the prologue and epilogue separately.
2400
ecdb6d1a 2401fsignaling-nans
ecee1b29 2402Common Report Var(flag_signaling_nans) Optimization SetByCombined
8fb42bbc 2403Disable optimizations observable by IEEE signaling NaNs.
ecdb6d1a 2404
893038cd 2405fsigned-zeros
ecee1b29 2406Common Report Var(flag_signed_zeros) Init(1) Optimization SetByCombined
8fb42bbc 2407Disable floating point optimizations that ignore the IEEE signedness of zero.
893038cd 2408
ecdb6d1a 2409fsingle-precision-constant
87c75316 2410Common Report Var(flag_single_precision_constant) Optimization
8fb42bbc 2411Convert floating point constants to single precision constants.
ecdb6d1a 2412
a9989fb4 2413fsplit-ivs-in-unroller
87c75316 2414Common Report Var(flag_split_ivs_in_unroller) Init(1) Optimization
8fb42bbc 2415Split lifetimes of induction variables when loops are unrolled.
a9989fb4 2416
48b14f50 2417fsplit-stack
2418Common Report Var(flag_split_stack) Init(-1)
8fb42bbc 2419Generate discontiguous stack frames.
48b14f50 2420
1a6a0f2a 2421fsplit-wide-types
e8831472 2422Common Report Var(flag_split_wide_types) Optimization
8fb42bbc 2423Split wide types into independent registers.
1a6a0f2a 2424
7fc2f613 2425fssa-backprop
2426Common Report Var(flag_ssa_backprop) Init(1) Optimization
2427Enable backward propagation of use properties at the SSA level.
2428
3dac50cc 2429fssa-phiopt
2430Common Report Var(flag_ssa_phiopt) Optimization
8fb42bbc 2431Optimize conditional patterns using SSA PHI nodes.
3dac50cc 2432
7c09c5f7 2433fstdarg-opt
2434Common Report Var(flag_stdarg_opt) Init(1) Optimization
8fb42bbc 2435Optimize amount of stdarg registers saved to stack at start of function.
7c09c5f7 2436
375bb675 2437fvariable-expansion-in-unroller
87c75316 2438Common Report Var(flag_variable_expansion_in_unroller) Optimization
8fb42bbc 2439Apply variable expansion when loops are unrolled.
375bb675 2440
4852b829 2441fstack-check=
74af142d 2442Common Report RejectNegative Joined Optimization
8fb42bbc 2443-fstack-check=[no|generic|specific] Insert stack checking code into the program.
4852b829 2444
ecdb6d1a 2445fstack-check
67089c6b 2446Common Alias(fstack-check=, specific, no)
8fb42bbc 2447Insert stack checking code into the program. Same as -fstack-check=specific.
ecdb6d1a 2448
74af142d 2449fstack-clash-protection
2450Common Report Var(flag_stack_clash_protection) Optimization
2451Insert code to probe each page of stack space as it is allocated to protect
2452from stack-clash style attacks.
2453
1e06725a 2454fstack-limit
f0da0668 2455Common Var(common_deferred_options) Defer
1e06725a 2456
941a4893 2457fstack-limit-register=
f0da0668 2458Common RejectNegative Joined Var(common_deferred_options) Defer
8fb42bbc 2459-fstack-limit-register=<register> Trap if the stack goes past <register>.
941a4893 2460
2461fstack-limit-symbol=
f0da0668 2462Common RejectNegative Joined Var(common_deferred_options) Defer
8fb42bbc 2463-fstack-limit-symbol=<name> Trap if the stack goes past symbol <name>.
941a4893 2464
f1a0edff 2465fstack-protector
9ed0eb00 2466Common Report Var(flag_stack_protect, 1) Init(-1) Optimization
8fb42bbc 2467Use propolice as a stack protection method.
f1a0edff 2468
2469fstack-protector-all
9ed0eb00 2470Common Report RejectNegative Var(flag_stack_protect, 2) Init(-1) Optimization
8fb42bbc 2471Use a stack protection method for every function.
f1a0edff 2472
b156ec37 2473fstack-protector-strong
9ed0eb00 2474Common Report RejectNegative Var(flag_stack_protect, 3) Init(-1) Optimization
8fb42bbc 2475Use a smart stack protection method for certain functions.
b156ec37 2476
947aa916 2477fstack-protector-explicit
9ed0eb00 2478Common Report RejectNegative Var(flag_stack_protect, 4) Optimization
8fb42bbc 2479Use stack protection method only for functions with the stack_protect attribute.
947aa916 2480
990495a7 2481fstack-usage
2482Common RejectNegative Var(flag_stack_usage)
8fb42bbc 2483Output stack usage information on a per-function basis.
990495a7 2484
1e06725a 2485fstrength-reduce
3b0273a1 2486Common Ignore
334ec2d8 2487Does nothing. Preserved for backward compatibility.
1e06725a 2488
82a16202 2489; Nonzero if we should do (language-dependent) alias analysis.
2490; Typically, this analysis will assume that expressions of certain
2491; types do not alias expressions of certain other types. Only used
2492; if alias analysis (in general) is enabled.
ecdb6d1a 2493fstrict-aliasing
87c75316 2494Common Report Var(flag_strict_aliasing) Optimization
8fb42bbc 2495Assume strict aliasing rules apply.
ecdb6d1a 2496
981eb798 2497fstrict-overflow
977361a1 2498Common Report
2499Treat signed overflow as undefined. Negated as -fwrapv -fwrapv-pointer.
981eb798 2500
d8219307 2501fsync-libcalls
2502Common Report Var(flag_sync_libcalls) Init(1)
8fb42bbc 2503Implement __atomic operations via libcalls to legacy __sync functions.
d8219307 2504
1e06725a 2505fsyntax-only
2e9da478 2506Common Report Var(flag_syntax_only)
8fb42bbc 2507Check for syntax errors, then stop.
1e06725a 2508
ecdb6d1a 2509ftest-coverage
2e9da478 2510Common Report Var(flag_test_coverage)
8fb42bbc 2511Create data files needed by \"gcov\".
ecdb6d1a 2512
1e06725a 2513fthread-jumps
87c75316 2514Common Report Var(flag_thread_jumps) Optimization
8fb42bbc 2515Perform jump threading optimizations.
1e06725a 2516
ecdb6d1a 2517ftime-report
2e9da478 2518Common Report Var(time_report)
8fb42bbc 2519Report the time taken by each compiler pass.
ecdb6d1a 2520
f649091c 2521ftime-report-details
2522Common Report Var(time_report_details)
2523Record times taken by sub-phases separately.
2524
941a4893 2525ftls-model=
d62a5950 2526Common Joined RejectNegative Enum(tls_model) Var(flag_tls_default) Init(TLS_MODEL_GLOBAL_DYNAMIC)
8fb42bbc 2527-ftls-model=[global-dynamic|local-dynamic|initial-exec|local-exec] Set the default thread-local storage code generation model.
941a4893 2528
d62a5950 2529Enum
2530Name(tls_model) Type(enum tls_model) UnknownError(unknown TLS model %qs)
2531
2532EnumValue
2533Enum(tls_model) String(global-dynamic) Value(TLS_MODEL_GLOBAL_DYNAMIC)
2534
2535EnumValue
2536Enum(tls_model) String(local-dynamic) Value(TLS_MODEL_LOCAL_DYNAMIC)
2537
2538EnumValue
2539Enum(tls_model) String(initial-exec) Value(TLS_MODEL_INITIAL_EXEC)
2540
2541EnumValue
2542Enum(tls_model) String(local-exec) Value(TLS_MODEL_LOCAL_EXEC)
2543
56af936e 2544ftoplevel-reorder
bfedbed1 2545Common Report Var(flag_toplevel_reorder) Init(2)
8fb42bbc 2546Reorder top level functions, variables, and asms.
56af936e 2547
1e06725a 2548ftracer
bfedbed1 2549Common Report Var(flag_tracer) Optimization
8fb42bbc 2550Perform superblock formation via tail duplication.
1e06725a 2551
a27e3913 2552ftrampolines
2553Common Report Var(flag_trampolines) Init(0)
2554For targets that normally need trampolines for nested functions, always
2555generate them instead of using descriptors.
2556
82a16202 2557; Zero means that floating-point math operations cannot generate a
2558; (user-visible) trap. This is the case, for example, in nonstop
2559; IEEE 754 arithmetic.
ecdb6d1a 2560ftrapping-math
ecee1b29 2561Common Report Var(flag_trapping_math) Init(1) Optimization SetByCombined
8fb42bbc 2562Assume floating-point operations can trap.
ecdb6d1a 2563
2564ftrapv
87c75316 2565Common Report Var(flag_trapv) Optimization
8fb42bbc 2566Trap for signed overflow in addition, subtraction and multiplication.
ecdb6d1a 2567
4ee9c684 2568ftree-ccp
87c75316 2569Common Report Var(flag_tree_ccp) Optimization
8fb42bbc 2570Enable SSA-CCP optimization on trees.
4ee9c684 2571
b7e55469 2572ftree-bit-ccp
2573Common Report Var(flag_tree_bit_ccp) Optimization
8fb42bbc 2574Enable SSA-BIT-CCP optimization on trees.
b7e55469 2575
88dbf20f 2576ftree-store-ccp
3b0273a1 2577Common Ignore
61207d43 2578Does nothing. Preserved for backward compatibility.
88dbf20f 2579
4ee9c684 2580ftree-ch
87c75316 2581Common Report Var(flag_tree_ch) Optimization
8fb42bbc 2582Enable loop header copying on trees.
4ee9c684 2583
4015e18c 2584ftree-coalesce-inlined-vars
94f92c36 2585Common Ignore RejectNegative
2586Does nothing. Preserved for backward compatibility.
4015e18c 2587
2588ftree-coalesce-vars
94f92c36 2589Common Report Var(flag_tree_coalesce_vars) Optimization
8fb42bbc 2590Enable SSA coalescing of user variables.
4015e18c 2591
4ee9c684 2592ftree-copyrename
94f92c36 2593Common Ignore
2594Does nothing. Preserved for backward compatibility.
4ee9c684 2595
88dbf20f 2596ftree-copy-prop
87c75316 2597Common Report Var(flag_tree_copy_prop) Optimization
8fb42bbc 2598Enable copy propagation on trees.
88dbf20f 2599
2600ftree-store-copy-prop
3b0273a1 2601Common Ignore
578ef723 2602Does nothing. Preserved for backward compatibility.
88dbf20f 2603
e6d0e152 2604ftree-cselim
2605Common Report Var(flag_tree_cselim) Init(2) Optimization
8fb42bbc 2606Transform condition stores into unconditional ones.
e6d0e152 2607
a347af29 2608ftree-switch-conversion
2609Common Report Var(flag_tree_switch_conversion) Optimization
2610Perform conversions of switch initializations.
2611
4ee9c684 2612ftree-dce
87c75316 2613Common Report Var(flag_tree_dce) Optimization
8fb42bbc 2614Enable SSA dead code elimination optimization on trees.
4ee9c684 2615
2616ftree-dominator-opts
87c75316 2617Common Report Var(flag_tree_dom) Optimization
8fb42bbc 2618Enable dominator optimizations.
4ee9c684 2619
51385f30 2620ftree-tail-merge
2621Common Report Var(flag_tree_tail_merge) Optimization
8fb42bbc 2622Enable tail merging on trees.
51385f30 2623
4ee9c684 2624ftree-dse
87c75316 2625Common Report Var(flag_tree_dse) Optimization
8fb42bbc 2626Enable dead store elimination.
4ee9c684 2627
408c3c77 2628ftree-forwprop
2629Common Report Var(flag_tree_forwprop) Init(1) Optimization
8fb42bbc 2630Enable forward propagation on trees.
408c3c77 2631
591c2a30 2632ftree-fre
87c75316 2633Common Report Var(flag_tree_fre) Optimization
8fb42bbc 2634Enable Full Redundancy Elimination (FRE) on trees.
591c2a30 2635
9efe50a4 2636foptimize-strlen
2637Common Report Var(flag_optimize_strlen) Optimization
8fb42bbc 2638Enable string length optimizations on trees.
9efe50a4 2639
30b10261 2640fisolate-erroneous-paths-dereference
2641Common Report Var(flag_isolate_erroneous_paths_dereference) Optimization
3c770735 2642Detect paths that trigger erroneous or undefined behavior due to
2643dereferencing a null pointer. Isolate those paths from the main control
2644flow and turn the statement with erroneous or undefined behavior into a trap.
30b10261 2645
2646fisolate-erroneous-paths-attribute
2647Common Report Var(flag_isolate_erroneous_paths_attribute) Optimization
af987227 2648Detect paths that trigger erroneous or undefined behavior due to a null value
3c770735 2649being used in a way forbidden by a returns_nonnull or nonnull
30b10261 2650attribute. Isolate those paths from the main control flow and turn the
8fb42bbc 2651statement with erroneous or undefined behavior into a trap.
db242b6d 2652
801c5610 2653ftree-loop-distribution
2b945500 2654Common Report Var(flag_tree_loop_distribution) Optimization
8fb42bbc 2655Enable loop distribution on trees.
801c5610 2656
0acf3477 2657ftree-loop-distribute-patterns
2658Common Report Var(flag_tree_loop_distribute_patterns) Optimization
8fb42bbc 2659Enable loop distribution for patterns transformed into a library call.
0acf3477 2660
41b5cc78 2661ftree-loop-im
87c75316 2662Common Report Var(flag_tree_loop_im) Init(1) Optimization
8fb42bbc 2663Enable loop invariant motion on trees.
7d23383d 2664
60cfcb79 2665ftree-loop-linear
4cc0f4e2 2666Common Alias(floop-nest-optimize)
8fb42bbc 2667Enable loop nest transforms. Same as -floop-nest-optimize.
60cfcb79 2668
41b5cc78 2669ftree-loop-ivcanon
87c75316 2670Common Report Var(flag_tree_loop_ivcanon) Init(1) Optimization
8fb42bbc 2671Create canonical induction variables in loops.
41b5cc78 2672
dcb9eccb 2673ftree-loop-optimize
87c75316 2674Common Report Var(flag_tree_loop_optimize) Init(1) Optimization
8fb42bbc 2675Enable loop optimizations on tree level.
dcb9eccb 2676
28c92cbb 2677ftree-parallelize-loops=
bfedbed1 2678Common Report Joined RejectNegative UInteger Var(flag_tree_parallelize_loops) Init(1) Optimization
78adba87 2679-ftree-parallelize-loops=<number> Enable automatic parallelization of loops.
28c92cbb 2680
408c3c77 2681ftree-phiprop
2682Common Report Var(flag_tree_phiprop) Init(1) Optimization
2683Enable hoisting loads from conditional pointers.
2684
4ee9c684 2685ftree-pre
87c75316 2686Common Report Var(flag_tree_pre) Optimization
8fb42bbc 2687Enable SSA-PRE optimization on trees.
4ee9c684 2688
0f9b384d 2689ftree-partial-pre
2690Common Report Var(flag_tree_partial_pre) Optimization
8fb42bbc 2691In SSA-PRE optimization on trees, enable partial-partial redundancy elimination.
0f9b384d 2692
408c3c77 2693ftree-pta
1941e89d 2694Common Report Var(flag_tree_pta) Optimization
408c3c77 2695Perform function-local points-to analysis on trees.
2696
621a93b1 2697ftree-reassoc
2698Common Report Var(flag_tree_reassoc) Init(1) Optimization
8fb42bbc 2699Enable reassociation on tree level.
621a93b1 2700
2be14d8b 2701ftree-salias
3b0273a1 2702Common Ignore
70393469 2703Does nothing. Preserved for backward compatibility.
2be14d8b 2704
5e733b02 2705ftree-sink
87c75316 2706Common Report Var(flag_tree_sink) Optimization
8fb42bbc 2707Enable SSA code sinking on trees.
5e733b02 2708
6de100ef 2709ftree-slsr
2710Common Report Var(flag_tree_slsr) Optimization
8fb42bbc 2711Perform straight-line strength reduction.
6de100ef 2712
4ee9c684 2713ftree-sra
87c75316 2714Common Report Var(flag_tree_sra) Optimization
8fb42bbc 2715Perform scalar replacement of aggregates.
4ee9c684 2716
2717ftree-ter
c17f64cc 2718Common Report Var(flag_tree_ter) Optimization
8fb42bbc 2719Replace temporary expressions in the SSA->normal pass.
4ee9c684 2720
87c75316 2721ftree-lrs
2722Common Report Var(flag_tree_live_range_split) Optimization
8fb42bbc 2723Perform live range splitting during the SSA->normal pass.
87c75316 2724
88dbf20f 2725ftree-vrp
87c75316 2726Common Report Var(flag_tree_vrp) Init(0) Optimization
8fb42bbc 2727Perform Value Range Propagation on trees.
88dbf20f 2728
b0e3fe96 2729fsplit-paths
2730Common Report Var(flag_split_paths) Init(0) Optimization
2731Split paths leading to loop backedges.
2732
5ab2987f 2733funconstrained-commons
2734Common Var(flag_unconstrained_commons) Optimization
2735Assume common declarations may be overridden with ones with a larger
2736trailing array.
2737
1e06725a 2738funit-at-a-time
bfedbed1 2739Common Report Var(flag_unit_at_a_time) Init(1)
8fb42bbc 2740Compile whole compilation unit at a time.
1e06725a 2741
2742funroll-loops
87c75316 2743Common Report Var(flag_unroll_loops) Optimization
8fb42bbc 2744Perform loop unrolling when iteration count is known.
1e06725a 2745
2746funroll-all-loops
87c75316 2747Common Report Var(flag_unroll_all_loops) Optimization
8fb42bbc 2748Perform loop unrolling for all loops.
1e06725a 2749
7e3cc681 2750; Nonzero means that loop optimizer may assume that the induction variables
2751; that control loops do not overflow and that the loops with nontrivial
2752; exit condition are not infinite
2753funsafe-loop-optimizations
9e609cf3 2754Common Ignore
2755Does nothing. Preserved for backward compatibility.
7e3cc681 2756
49d060d7 2757fassociative-math
bfedbed1 2758Common Report Var(flag_associative_math) SetByCombined Optimization
49d060d7 2759Allow optimization for floating-point arithmetic which may change the
2760result of the operation due to rounding.
2761
2762freciprocal-math
bfedbed1 2763Common Report Var(flag_reciprocal_math) SetByCombined Optimization
49d060d7 2764Same as -fassociative-math for expressions which include division.
2765
82a16202 2766; Nonzero means that unsafe floating-point math optimizations are allowed
2767; for the sake of speed. IEEE compliance is not guaranteed, and operations
2768; are allowed to assume that their arguments and results are "normal"
2769; (e.g., nonnegative for SQRT).
ecdb6d1a 2770funsafe-math-optimizations
ecee1b29 2771Common Report Var(flag_unsafe_math_optimizations) Optimization SetByCombined
8fb42bbc 2772Allow math optimizations that may violate IEEE or ISO standards.
ecdb6d1a 2773
1e06725a 2774funswitch-loops
87c75316 2775Common Report Var(flag_unswitch_loops) Optimization
8fb42bbc 2776Perform loop unswitching.
1e06725a 2777
92a2a716 2778fsplit-loops
2779Common Report Var(flag_split_loops) Optimization
2780Perform loop splitting.
2781
9435b515 2782fversion-loops-for-strides
2783Common Report Var(flag_version_loops_for_strides) Optimization
2784Version loops based on whether indices have a stride of one.
2785
ecdb6d1a 2786funwind-tables
87c75316 2787Common Report Var(flag_unwind_tables) Optimization
8fb42bbc 2788Just generate unwind tables for exception handling.
ecdb6d1a 2789
99d5fe2d 2790fuse-ld=bfd
c75e4990 2791Common Driver Negative(fuse-ld=gold)
8fb42bbc 2792Use the bfd linker instead of the default linker.
99d5fe2d 2793
2794fuse-ld=gold
c75e4990 2795Common Driver Negative(fuse-ld=bfd)
8fb42bbc 2796Use the gold linker instead of the default linker.
99d5fe2d 2797
4eea76db 2798fuse-ld=lld
2799Common Driver Negative(fuse-ld=lld)
2800Use the lld LLVM linker instead of the default linker.
2801
386fbe6a 2802fuse-linker-plugin
cef15d47 2803Common Undocumented Var(flag_use_linker_plugin)
386fbe6a 2804
0f8defe5 2805; Positive if we should track variables, negative if we should run
2806; the var-tracking pass only to discard debug annotations, zero if
2807; we're not to run it. When flag_var_tracking == 2 (AUTODETECT_VALUE) it
2808; will be set according to optimize, debug_info_level and debug_hooks
2809; in process_options ().
5923a5e7 2810fvar-tracking
05d8c5f8 2811Common Report Var(flag_var_tracking) Init(2) PerFunction
8fb42bbc 2812Perform variable tracking.
5923a5e7 2813
0f8defe5 2814; Positive if we should track variables at assignments, negative if
2815; we should run the var-tracking pass only to discard debug
2816; annotations. When flag_var_tracking_assignments ==
2817; AUTODETECT_VALUE it will be set according to flag_var_tracking.
9845d120 2818fvar-tracking-assignments
05d8c5f8 2819Common Report Var(flag_var_tracking_assignments) Init(2) PerFunction
8fb42bbc 2820Perform variable tracking by annotating assignments.
9845d120 2821
0f8defe5 2822; Nonzero if we should toggle flag_var_tracking_assignments after
2823; processing options and computing its default. */
9845d120 2824fvar-tracking-assignments-toggle
05d8c5f8 2825Common Report Var(flag_var_tracking_assignments_toggle) PerFunction
8fb42bbc 2826Toggle -fvar-tracking-assignments.
9845d120 2827
3e1cce93 2828; Positive if we should track uninitialized variables, negative if
2829; we should run the var-tracking pass only to discard debug
2830; annotations. When flag_var_tracking_uninit == AUTODETECT_VALUE it
2831; will be set according to flag_var_tracking.
d53bb226 2832fvar-tracking-uninit
05d8c5f8 2833Common Report Var(flag_var_tracking_uninit) PerFunction
8fb42bbc 2834Perform variable tracking and also tag variables that are uninitialized.
d53bb226 2835
52e94bf8 2836; Alias to enable both -ftree-loop-vectorize and -ftree-slp-vectorize.
c91e8223 2837ftree-vectorize
52e94bf8 2838Common Report Optimization
8fb42bbc 2839Enable vectorization on trees.
c91e8223 2840
7bd765d4 2841ftree-vectorizer-verbose=
e64c6e9c 2842Common Joined RejectNegative Ignore
2843Does nothing. Preserved for backward compatibility.
7bd765d4 2844
043115ec 2845ftree-loop-vectorize
52e94bf8 2846Common Report Var(flag_tree_loop_vectorize) Optimization EnabledBy(ftree-vectorize)
8fb42bbc 2847Enable loop vectorization on trees.
043115ec 2848
37545e54 2849ftree-slp-vectorize
52e94bf8 2850Common Report Var(flag_tree_slp_vectorize) Optimization EnabledBy(ftree-vectorize)
8fb42bbc 2851Enable basic block vectorization (SLP) on trees.
37545e54 2852
1dbf9bd1 2853fvect-cost-model=
bfedbed1 2854Common Joined RejectNegative Enum(vect_cost_model) Var(flag_vect_cost_model) Init(VECT_COST_MODEL_DEFAULT) Optimization
6ac368bb 2855-fvect-cost-model=[unlimited|dynamic|cheap] Specifies the cost model for vectorization.
8fb42bbc 2856
3e398f5b 2857fsimd-cost-model=
bfedbed1 2858Common Joined RejectNegative Enum(vect_cost_model) Var(flag_simd_cost_model) Init(VECT_COST_MODEL_UNLIMITED) Optimization
6ac368bb 2859-fsimd-cost-model=[unlimited|dynamic|cheap] Specifies the vectorization cost model for code marked with a simd directive.
3e398f5b 2860
1dbf9bd1 2861Enum
2862Name(vect_cost_model) Type(enum vect_cost_model) UnknownError(unknown vectorizer cost model %qs)
2863
2864EnumValue
2865Enum(vect_cost_model) String(unlimited) Value(VECT_COST_MODEL_UNLIMITED)
2866
2867EnumValue
2868Enum(vect_cost_model) String(dynamic) Value(VECT_COST_MODEL_DYNAMIC)
2869
2870EnumValue
2871Enum(vect_cost_model) String(cheap) Value(VECT_COST_MODEL_CHEAP)
2872
867c03eb 2873fvect-cost-model
e1a93520 2874Common Alias(fvect-cost-model=,dynamic,unlimited)
1dbf9bd1 2875Enables the dynamic vectorizer cost model. Preserved for backward compatibility.
2876
25e3c2e8 2877ftree-vect-loop-version
1dbf9bd1 2878Common Ignore
2879Does nothing. Preserved for backward compatibility.
25e3c2e8 2880
2a6e95ba 2881ftree-scev-cprop
e8831472 2882Common Report Var(flag_tree_scev_cprop) Init(1) Optimization
2a6e95ba 2883Enable copy propagation of scalar-evolution information.
2884
82a16202 2885; -fverbose-asm causes extra commentary information to be produced in
2886; the generated assembly code (to make it more readable). This option
2887; is generally only of use to those who actually need to read the
2888; generated assembly code (perhaps while debugging the compiler itself).
2889; -fno-verbose-asm, the default, causes the extra information
2890; to not be added and is useful when comparing two assembler files.
ecdb6d1a 2891fverbose-asm
2e9da478 2892Common Report Var(flag_verbose_asm)
8fb42bbc 2893Add extra commentary to assembler output.
ecdb6d1a 2894
b212f378 2895fvisibility=
d62a5950 2896Common Joined RejectNegative Enum(symbol_visibility) Var(default_visibility) Init(VISIBILITY_DEFAULT)
8fb42bbc 2897-fvisibility=[default|internal|hidden|protected] Set the default symbol visibility.
b212f378 2898
d62a5950 2899Enum
2900Name(symbol_visibility) Type(enum symbol_visibility) UnknownError(unrecognized visibility value %qs)
2901
2902EnumValue
2903Enum(symbol_visibility) String(default) Value(VISIBILITY_DEFAULT)
2904
2905EnumValue
2906Enum(symbol_visibility) String(internal) Value(VISIBILITY_INTERNAL)
2907
2908EnumValue
2909Enum(symbol_visibility) String(hidden) Value(VISIBILITY_HIDDEN)
2910
2911EnumValue
2912Enum(symbol_visibility) String(protected) Value(VISIBILITY_PROTECTED)
b212f378 2913
b710ec85 2914fvtable-verify=
2915Common Joined RejectNegative Enum(vtv_priority) Var(flag_vtable_verify) Init(VTV_NO_PRIORITY)
2916Validate vtable pointers before using them.
2917
2918Enum
2919Name(vtv_priority) Type(enum vtv_priority) UnknownError(unknown vtable verify initialization priority %qs)
2920
2921EnumValue
2922Enum(vtv_priority) String(none) Value(VTV_NO_PRIORITY)
2923
2924EnumValue
2925Enum(vtv_priority) String(std) Value(VTV_STANDARD_PRIORITY)
2926
2927EnumValue
2928Enum(vtv_priority) String(preinit) Value(VTV_PREINIT_PRIORITY)
2929
2930fvtv-counts
2931Common Var(flag_vtv_counts)
2932Output vtable verification counters.
2933
2934fvtv-debug
2935Common Var(flag_vtv_debug)
2936Output vtable verification pointer sets information.
2937
1c6a7b8c 2938fvpt
87c75316 2939Common Report Var(flag_value_profile_transformations) Optimization
8fb42bbc 2940Use expression value profiles in optimizations.
1c6a7b8c 2941
eeb4a70e 2942fweb
87c75316 2943Common Report Var(flag_web) Init(2) Optimization
8fb42bbc 2944Construct webs and split unrelated uses of single variable.
eeb4a70e 2945
e6a23add 2946ftree-builtin-call-dce
2947Common Report Var(flag_tree_builtin_call_dce) Init(0) Optimization
8fb42bbc 2948Enable conditional dead code elimination for builtin calls.
e6a23add 2949
62eec3b4 2950fwhole-program
bfedbed1 2951Common Report Var(flag_whole_program) Init(0)
8fb42bbc 2952Perform whole program optimizations.
62eec3b4 2953
977361a1 2954fwrapv-pointer
2955Common Report Var(flag_wrapv_pointer) Optimization
2956Assume pointer overflow wraps around.
2957
ecdb6d1a 2958fwrapv
87c75316 2959Common Report Var(flag_wrapv) Optimization
8fb42bbc 2960Assume signed arithmetic overflow wraps around.
ecdb6d1a 2961
ecdb6d1a 2962fzero-initialized-in-bss
2e9da478 2963Common Report Var(flag_zero_initialized_in_bss) Init(1)
8fb42bbc 2964Put zero initialized data in the bss section.
ecdb6d1a 2965
6f2f567f 2966g
a1408eb3 2967Common Driver RejectNegative JoinedOrMissing
8fb42bbc 2968Generate debug information in default format.
b0e56fb1 2969
d85a7677 2970gas-loc-support
2971Common Driver Var(dwarf2out_as_loc_support) Init(2)
f673492c 2972Assume assembler support for (DWARF2+) .loc directives.
d85a7677 2973
2974gas-locview-support
2975Common Driver Var(dwarf2out_as_locview_support) Init(2)
f673492c 2976Assume assembler support for view in (DWARF2+) .loc directives.
d85a7677 2977
f4140c4a 2978gcoff
0c46a085 2979Common Driver Deprecated
f4140c4a 2980Does nothing. Preserved for backward compatibility.
2981
2982gcoff1
0c46a085 2983Common Driver Deprecated
f4140c4a 2984Does nothing. Preserved for backward compatibility.
2985
2986gcoff2
0c46a085 2987Common Driver Deprecated
f4140c4a 2988Does nothing. Preserved for backward compatibility.
2989
2990gcoff3
0c46a085 2991Common Driver Deprecated
f4140c4a 2992Does nothing. Preserved for backward compatibility.
2993
8afa52da 2994gcolumn-info
c61ffa85 2995Common Driver Var(debug_column_info,1) Init(1)
8afa52da 2996Record DW_AT_decl_column and DW_AT_call_column in DWARF.
2997
8786b72c 2998gdwarf
14234f77 2999Common Driver JoinedOrMissing Negative(gdwarf-)
8fb42bbc 3000Generate debug information in default version of DWARF format.
8786b72c 3001
3d3b9d5b 3002gdwarf-
14234f77 3003Common Driver Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs)
8fb42bbc 3004Generate debug information in DWARF v2 (or later) format.
b0e56fb1 3005
3006ggdb
14234f77 3007Common Driver JoinedOrMissing
8fb42bbc 3008Generate debug information in default extended format.
b0e56fb1 3009
d85a7677 3010ginline-points
3011Common Driver Var(debug_inline_points) Init(2)
f673492c 3012Generate extended entry point information for inlined functions.
d85a7677 3013
3014ginternal-reset-location-views
3015Common Driver Var(debug_internal_reset_location_views) Init(2)
f673492c 3016Compute locview reset points based on insn length estimates.
d85a7677 3017
a1408eb3 3018gno-
3019RejectNegative Joined Undocumented
3020; Catch the gno- prefix, so it doesn't backtrack to g<level>.
3021
7a99ccab 3022gno-pubnames
14234f77 3023Common Driver Negative(gpubnames) Var(debug_generate_pub_sections, 0) Init(-1)
7a99ccab 3024Don't generate DWARF pubnames and pubtypes sections.
3025
3026gpubnames
14234f77 3027Common Driver Negative(ggnu-pubnames) Var(debug_generate_pub_sections, 1)
7a99ccab 3028Generate DWARF pubnames and pubtypes sections.
3029
ea096d3d 3030ggnu-pubnames
14234f77 3031Common Driver Negative(gno-pubnames) Var(debug_generate_pub_sections, 2)
ea096d3d 3032Generate DWARF pubnames and pubtypes sections with GNU extensions.
3033
f45370f8 3034grecord-gcc-switches
a1408eb3 3035Common Driver Var(dwarf_record_gcc_switches) Init(1)
f45370f8 3036Record gcc command line switches in DWARF DW_AT_producer.
3037
b35329c7 3038gsplit-dwarf
a1408eb3 3039Common Driver Var(dwarf_split_debug_info) Init(0)
8fb42bbc 3040Generate debug information in separate .dwo files.
b35329c7 3041
b0e56fb1 3042gstabs
14234f77 3043Common Driver JoinedOrMissing Negative(gstabs+)
8fb42bbc 3044Generate debug information in STABS format.
b0e56fb1 3045
3046gstabs+
14234f77 3047Common Driver JoinedOrMissing Negative(gvms)
8fb42bbc 3048Generate debug information in extended STABS format.
b0e56fb1 3049
aa2fd885 3050gstatement-frontiers
3051Common Driver Var(debug_nonbind_markers_p) Init(2)
3052Emit progressive recommended breakpoint locations.
3053
c16b6d19 3054gstrict-dwarf
a1408eb3 3055Common Driver Report Var(dwarf_strict) Init(0)
8fb42bbc 3056Don't emit DWARF additions beyond selected version.
c16b6d19 3057
f1e7f337 3058gdescribe-dies
3059Common Driver Report Var(flag_describe_dies) Init(0)
3060Add description attributes to some DWARF DIEs that have no name attribute.
3061
71278019 3062gtoggle
14234f77 3063Common Driver Report Var(flag_gtoggle)
8fb42bbc 3064Toggle debug information generation.
71278019 3065
7b0db09c 3066gvariable-location-views
3067Common Driver Var(debug_variable_location_views, 1) Init(2)
3068Augment variable location lists with progressive views.
3069
3070gvariable-location-views=incompat5
3071Common Driver RejectNegative Var(debug_variable_location_views, -1) Init(2)
3072
b0e56fb1 3073gvms
14234f77 3074Common Driver JoinedOrMissing Negative(gxcoff)
8fb42bbc 3075Generate debug information in VMS format.
b0e56fb1 3076
3077gxcoff
14234f77 3078Common Driver JoinedOrMissing Negative(gxcoff+)
8fb42bbc 3079Generate debug information in XCOFF format.
b0e56fb1 3080
3081gxcoff+
4c52ff7a 3082Common Driver JoinedOrMissing Negative(gdwarf)
8fb42bbc 3083Generate debug information in extended XCOFF format.
6f2f567f 3084
4185c905 3085Enum
3086Name(compressed_debug_sections) Type(int)
3087
3088; Since -gz= is completely handled in specs, the values aren't used and we
3089; assign arbitrary constants.
3090EnumValue
3091Enum(compressed_debug_sections) String(none) Value(0)
3092
3093EnumValue
3094Enum(compressed_debug_sections) String(zlib) Value(1)
3095
3096EnumValue
3097Enum(compressed_debug_sections) String(zlib-gnu) Value(2)
3098
3099gz
3100Common Driver
8fb42bbc 3101Generate compressed debug sections.
4185c905 3102
3103gz=
a1408eb3 3104Common Driver RejectNegative Joined Enum(compressed_debug_sections)
8fb42bbc 3105-gz=<format> Generate compressed debug sections in format <format>.
4185c905 3106
f37ef985 3107h
3108Driver Joined Separate
3109
19bc000d 3110iplugindir=
3111Common Joined Var(plugindir_string) Init(0)
8fb42bbc 3112-iplugindir=<dir> Set <dir> to be the default plugin directory.
19bc000d 3113
77adc39e 3114imultiarch
3115Common Joined Separate RejectDriver Var(imultiarch) Init(0)
8fb42bbc 3116-imultiarch <dir> Set <dir> to be the multiarch include subdirectory.
77adc39e 3117
e28aa114 3118l
3119Driver Joined Separate
3120
3bfde2af 3121n
3122Driver
3123
e28aa114 3124no-canonical-prefixes
3125Driver
3126
cb22f930 3127nodefaultlibs
3128Driver
3129
286f96fe 3130nostartfiles
3131Driver
3132
0e4340b2 3133nolibc
3134Driver
3135
cb22f930 3136nostdlib
3137Driver
3138
e690b385 3139o
6bd9d862 3140Common Driver Joined Separate Var(asm_file_name) MissingArgError(missing filename after %qs)
8fb42bbc 3141-o <file> Place output into <file>.
e690b385 3142
3143p
2e9da478 3144Common Var(profile_flag)
8fb42bbc 3145Enable function profiling.
e690b385 3146
e28aa114 3147pass-exit-codes
3148Driver Var(pass_exit_codes)
3149
e690b385 3150pedantic
29438999 3151Common Alias(Wpedantic)
e690b385 3152
3153pedantic-errors
6bd9d862 3154Common Var(flag_pedantic_errors)
8fb42bbc 3155Like -pedantic but issue them as errors.
e690b385 3156
cb22f930 3157pg
3158Driver
3159
e28aa114 3160pipe
3161Driver Var(use_pipes)
3162
3163print-file-name=
3164Driver JoinedOrMissing Var(print_file_name)
3165
3166print-libgcc-file-name
3167Driver
3168
3169print-multi-directory
3170Driver Var(print_multi_directory)
3171
3172print-multi-lib
3173Driver Var(print_multi_lib)
3174
3175print-multi-os-directory
3176Driver Var(print_multi_os_directory)
8fb42bbc 3177
77adc39e 3178print-multiarch
3179Driver Var(print_multiarch)
e28aa114 3180
3181print-prog-name=
3182Driver JoinedOrMissing Var(print_prog_name)
3183
3184print-search-dirs
3185Driver Var(print_search_dirs)
3186
3187print-sysroot
3188Driver Var(print_sysroot)
3189
3190print-sysroot-headers-suffix
3191Driver Var(print_sysroot_headers_suffix)
3192
3272db82 3193quiet
e28aa114 3194Common Var(quiet_flag) RejectDriver
8fb42bbc 3195Do not display functions compiled or elapsed time.
3272db82 3196
3bfde2af 3197r
3198Driver
3199
3200s
3201Driver
3202
e28aa114 3203save-temps
3204Driver
3205
3206save-temps=
3207Driver Joined
3208
3bfde2af 3209t
3210Driver
3211
e28aa114 3212time
3213Driver Var(report_times)
3214
3215time=
3216Driver JoinedOrMissing
3217
5789e05b 3218u
3219Driver Joined Separate
3220
4b2a05b6 3221undef
3222Driver
3223; C option, but driver must not handle as "-u ndef".
3224
e28aa114 3225v
6bd9d862 3226Common Driver Var(verbose_flag)
8fb42bbc 3227Enable verbose output.
e28aa114 3228
e690b385 3229version
e28aa114 3230Common Var(version_flag) RejectDriver
8fb42bbc 3231Display the compiler's version.
e690b385 3232
3233w
2e9da478 3234Common Var(inhibit_warnings)
8fb42bbc 3235Suppress warnings.
e690b385 3236
e28aa114 3237wrapper
3238Driver Separate Var(wrapper_string)
3239
3240x
3241Driver Joined Separate
3242
794febf8 3243shared
6d1ab23d 3244Driver RejectNegative Negative(static-pie)
8fb42bbc 3245Create a shared library.
794febf8 3246
e28aa114 3247shared-libgcc
3248Driver
3249
3250specs
67089c6b 3251Driver Separate Alias(specs=)
e28aa114 3252
3253specs=
3254Driver Joined
3255
cb22f930 3256static
3257Driver
3258
e28aa114 3259static-libgcc
3260Driver
3261
3262static-libgfortran
3263Driver
3264; Documented for Fortran, but always accepted by driver.
3265
3266static-libstdc++
3267Driver
3268
e440a328 3269static-libgo
3270Driver
3271; Documented for Go, but always accepted by driver.
3272
6db5160a 3273static-libasan
3274Driver
3275
b077695d 3276static-libtsan
3277Driver
3278
f8ff4a27 3279static-liblsan
3280Driver
3281
9e46467d 3282static-libubsan
3283Driver
3284
5789e05b 3285symbolic
3286Driver
3287
e9abca4f 3288no-pie
1412b935 3289Driver RejectNegative Negative(shared)
6d1ab23d 3290Don't create a dynamically linked position independent executable.
e9abca4f 3291
3292pie
3293Driver RejectNegative Negative(no-pie)
6d1ab23d 3294Create a dynamically linked position independent executable.
3295
3296static-pie
3297Driver RejectNegative Negative(pie)
3298Create a static position independent executable.
794febf8 3299
f37ef985 3300z
3301Driver Joined Separate
3302
fcf56aaf 3303fipa-ra
3304Common Report Var(flag_ipa_ra) Optimization
8fb42bbc 3305Use caller save register across calls if possible.
2cc49064 3306
3272db82 3307; This comment is to ensure we retain the blank line above.