]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common.opt
docs: Fix expected diagnostics URL [PR107599]
[thirdparty/gcc.git] / gcc / common.opt
CommitLineData
d7b42618 1; Options for the language- and target-independent parts of the compiler.
50431bc4 2
7adcbafe 3; Copyright (C) 2003-2022 Free Software Foundation, Inc.
d7b42618
NB
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
9dcd6f09 9; Software Foundation; either version 3, or (at your option) any later
d7b42618 10; version.
c22cacf3 11;
d7b42618
NB
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.
c22cacf3 16;
d7b42618 17; You should have received a copy of the GNU General Public License
9dcd6f09
NC
18; along with GCC; see the file COPYING3. If not see
19; <http://www.gnu.org/licenses/>.
d7b42618 20
71733172 21; See the GCC internals manual (options.texi) for a description of this file's format.
d7b42618
NB
22
23; Please try to keep this file in ASCII collating order.
24
e90afde6
JM
25Variable
26int target_flags
27
46625112
JM
28Variable
29int optimize
30
31Variable
32int optimize_size
33
bf7a7185
RG
34Variable
35int optimize_debug
36
0a8134ca
JM
37; Not used directly to control optimizations, only to save -Ofast
38; setting for "optimize" attributes.
39Variable
40int optimize_fast
41
a7d0d30f
JM
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
1ff9ed6f 49; This variable is set to non-0 only by LTO front-end. 1 indicates that
46a27415 50; the output produced will be used for incremental linking (thus weak symbols
5b42d196
JH
51; can still be bound) and 2 indicates that the IL is going to be linked and
52; and output to LTO object file.
1ff9ed6f 53Variable
5b42d196 54enum incremental_link flag_incremental_link = INCREMENTAL_LINK_NONE
1ff9ed6f 55
a75bfaa6
JM
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
a64697d7
ML
62Variable
63int flag_default_complex_method = 1
64
a75bfaa6
JM
65; Language specific warning pass for unused results.
66Variable
67bool flag_warn_unused_result = false
68
d5478783
JM
69; Nonzero if we should write GIMPLE bytecode for link-time optimization.
70Variable
71int flag_generate_lto
72
f0d78df9
IV
73; Nonzero if we should write GIMPLE bytecode for offload compilation.
74Variable
75int flag_generate_offload = 0
76
d5478783
JM
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
a1ad0d84 86; These three are really VEC(char_p,heap) *.
6a1f6c9c
JM
87
88Variable
89void *flag_instrument_functions_exclude_functions
90
91Variable
92void *flag_instrument_functions_exclude_files
93
a1ad0d84
MP
94Variable
95void *flag_ignored_attributes
96
69ccdddb
JM
97; Generic structs (e.g. templates not explicitly specialized)
98; may not have a compilation unit associated with them, and so
99; may need to be treated differently from ordinary structs.
100;
101; Structs only handled by reference (indirectly), will also usually
102; not need as much debugging information.
103
104Variable
105enum debug_struct_file debug_struct_ordinary[DINFO_USAGE_NUM_ENUMS] = { DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY }
106
107Variable
108enum debug_struct_file debug_struct_generic[DINFO_USAGE_NUM_ENUMS] = { DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY }
109
0576d21f
JM
110; True if we should exit after parsing options.
111Variable
112bool exit_after_options
113
114; Type(s) of debugging information we are producing (if any). See
115; flag-types.h for the definitions of the different possible types of
116; debugging information.
117Variable
459d84e9 118uint32_t write_symbols = NO_DEBUG
0576d21f
JM
119
120; Level of debugging information we are producing. See flag-types.h
121; for the definitions of the different possible levels.
122Variable
123enum debug_info_levels debug_info_level = DINFO_LEVEL_NONE
124
b7e215a8
IB
125; Level of CTF debugging information we are producing. See flag-types.h
126; for the definitions of the different possible levels.
127Variable
128enum ctf_debug_info_levels ctf_debug_info_level = CTFINFO_LEVEL_NONE
129
299404a1
JM
130; Original value of maximum field alignment in bytes, specified via
131; -fpack-struct=<value>.
132Variable
133unsigned int initial_max_fld_align = TARGET_DEFAULT_PACK_STRUCT
134
5e471ea6
JM
135; Type of stack check.
136Variable
137enum stack_check_type flag_stack_check = NO_STACK_CHECK
138
a11e0df4
EB
139; True if stack usage information needs to be computed.
140Variable
141bool flag_stack_usage_info = false
142
299404a1
JM
143; -dA causes debug commentary information to be produced in
144; the generated assembly code (to make it more readable). This option
145; is generally only of use to those who actually need to read the
146; generated assembly code (perhaps while debugging the compiler itself).
e53b6e56 147; Currently, this switch is only used by dwarf2out.cc; however, it is intended
299404a1
JM
148; to be a catchall for printing debug information in the assembler file.
149Variable
150int flag_debug_asm
151
6592d14b
PMR
152; Balance between GNAT encodings and standard DWARF to emit.
153Variable
154enum dwarf_gnat_encodings gnat_encodings = DWARF_GNAT_ENCODINGS_DEFAULT
155
299404a1
JM
156; -dP causes the rtl to be emitted as a comment in assembly.
157Variable
158int flag_dump_rtl_in_asm
159
160; Whether -da was passed (used only in handle_common_deferred_options).
161Variable
162bool flag_dump_all_passed
163
164; Other flags saying which kinds of debugging dump have been requested.
165
166Variable
167int rtl_dump_and_exit
168
169Variable
170int flag_print_asm_name
171
a803773f
JM
172; Name of top-level original source file (what was input to cpp).
173; This comes from the #-command at the beginning of the actual input.
174; If there isn't any there, then this is the cc1 input file name.
175Variable
176const char *main_input_filename
177
178; Pointer to base name in main_input_filename, with directories and a
179; single final extension removed, and the length of this base
180; name.
181
182Variable
183const char *main_input_basename
184
185Variable
186int main_input_baselength
187
1dedc12d
AO
188; The base name used for auxiliary output files.
189; dump_base_name minus dump_base_ext.
190
191Variable
192const char *aux_base_name
193
299404a1
JM
194; Which options have been printed by --help.
195Variable
196char *help_printed
197
e6d4b984
JM
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
299404a1
JM
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
de5a5fa1
MP
212; What the sanitizer should instrument
213Variable
214unsigned int flag_sanitize
215
d95a2703
JJ
216; What sanitizers should recover from errors
217Variable
3bd87832 218unsigned int flag_sanitize_recover = (SANITIZE_UNDEFINED | SANITIZE_UNDEFINED_NONDEFAULT | SANITIZE_KERNEL_ADDRESS | SANITIZE_KERNEL_HWADDRESS) & ~(SANITIZE_UNREACHABLE | SANITIZE_RETURN)
d95a2703 219
2c7cfc7b
JJ
220; What sanitizers should use __builtin_trap () instead of runtime diagnostics
221Variable
222unsigned int flag_sanitize_trap
223
91035653
JJ
224; Flag whether a prefix has been added to dump_base_name
225Variable
226bool dump_base_name_prefixed = false
227
d10f3e90 228; What subset of registers should be zeroed on function return
229Variable
230unsigned int flag_zero_call_used_regs
231
603349bf
JM
232###
233Driver
234
e200444e
JM
235-assemble
236Driver Alias(S)
237
238-compile
239Driver Alias(c)
240
d86c7648
ML
241-completion=
242Common Driver Joined Undocumented
243Provide bash completion for options starting with provided string.
244
e200444e
JM
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
1dedc12d
AO
258Driver Common Separate Alias(dumpbase)
259
260-dumpbase-ext
261Driver Common Separate Alias(dumpbase-ext)
e200444e
JM
262
263-dumpdir
1dedc12d 264Driver Common Separate Alias(dumpdir)
e200444e
JM
265
266-entry
267Driver Separate Alias(e)
268
269-entry=
270Driver Joined Alias(e)
271
272-extra-warnings
273Common Warning Alias(Wextra)
274
275-for-assembler
276Driver Separate Alias(Xassembler)
277
278-for-assembler=
279Driver JoinedOrMissing Alias(Xassembler)
280
281-for-linker
282Driver Separate Alias(Xlinker)
283
284-for-linker=
285Driver JoinedOrMissing Alias(Xlinker)
286
287-force-link
288Driver Separate Alias(u)
289
290-force-link=
291Driver Joined Alias(u)
292
d185d268 293-help
e200444e 294Common Driver Var(help_flag)
a7b2e184 295Display this information.
d185d268 296
c662432e 297-help=
eece52b5 298Common Driver Joined
a7b2e184 299--help=<class> Display descriptions of a specific class of options. <class> is one or more of optimizers, target, warnings, undocumented, params.
903caebf 300
e200444e
JM
301-language
302Driver Separate Alias(x)
303
304-language=
305Driver Joined Alias(x)
306
307-library-directory
308Driver Separate Alias(L)
309
310-library-directory=
311Driver Joined Alias(L)
312
313-no-canonical-prefixes
314Driver Alias(no-canonical-prefixes)
315
316-no-standard-libraries
317Driver Alias(nostdlib)
318
28b4fc51
JM
319-no-sysroot-suffix
320Driver Var(no_sysroot_suffix)
321
e200444e
JM
322-no-warnings
323Common Alias(w)
324
325-optimize
326Common Alias(O)
327
328-output
329Common Driver Separate Alias(o) MissingArgError(missing filename after %qs)
330
331-output=
332Common Driver Joined Alias(o) MissingArgError(missing filename after %qs)
333
334-pass-exit-codes
335Driver Alias(pass-exit-codes)
336
337-pedantic
c1771a20 338Common Alias(Wpedantic)
e200444e
JM
339
340-pedantic-errors
341Common Alias(pedantic-errors)
342
343-pie
5460e1fc 344Driver Alias(pie)
e200444e 345
b4fed890
L
346-static-pie
347Driver Alias(static-pie)
348
e200444e
JM
349-pipe
350Driver Alias(pipe)
351
352-prefix
353Driver Separate Alias(B)
354
355-prefix=
356Driver JoinedOrMissing Alias(B)
357
358-preprocess
359Driver Alias(E)
360
361-print-file-name
362Driver Separate Alias(print-file-name=)
363
364-print-file-name=
365Driver JoinedOrMissing Alias(print-file-name=)
366
367-print-libgcc-file-name
368Driver Alias(print-libgcc-file-name)
369
370-print-multi-directory
371Driver Alias(print-multi-directory)
372
373-print-multi-lib
374Driver Alias(print-multi-lib)
375
376-print-multi-os-directory
377Driver Alias(print-multi-os-directory)
378
e0cdc09f
MK
379-print-multiarch
380Driver Alias(print-multiarch)
381
e200444e
JM
382-print-prog-name
383Driver Separate Alias(print-prog-name=)
384
385-print-prog-name=
386Driver JoinedOrMissing Alias(print-prog-name=)
387
388-print-search-dirs
389Driver Alias(print-search-dirs)
390
391-print-sysroot
392Driver Alias(print-sysroot)
393
394-print-sysroot-headers-suffix
395Driver Alias(print-sysroot-headers-suffix)
396
397-profile
398Common Alias(p)
399
400-save-temps
401Driver Alias(save-temps)
402
403-shared
5460e1fc 404Driver Alias(shared)
e200444e
JM
405
406-specs
407Driver Separate Alias(specs=)
408
409-specs=
410Driver Joined Alias(specs=)
411
412-static
413Driver Alias(static)
414
415-symbolic
416Driver Alias(symbolic)
417
d185d268 418-target-help
603349bf 419Common Driver
717b2d41 420Display target specific command line options (including assembler and linker options).
c662432e 421
e200444e
JM
422-time
423Driver Alias(time)
424
425-verbose
426Driver Alias(v)
427
428;; The driver used to convert options such as --help into forms such
429;; as -fhelp; the following four entries are for compatibility with
430;; any direct uses of those (undocumented) -f forms
c662432e 431fhelp
e200444e 432Common Driver Alias(-help)
c662432e
NC
433
434fhelp=
e200444e 435Common Driver Joined Alias(-help=)
c662432e
NC
436
437ftarget-help
e200444e 438Common Driver Alias(-target-help)
c662432e 439
41fd0f9b 440fversion
e200444e 441Common Driver Alias(-version)
41fd0f9b 442
e200444e
JM
443-sysroot
444Driver Separate Alias(-sysroot=)
445
603349bf
JM
446-sysroot=
447Driver JoinedOrMissing
448
d185d268 449-version
603349bf
JM
450Common Driver
451
452B
453Driver Joined Separate
454
455E
456Driver
d185d268 457
d9d16a19
JM
458L
459Driver Joined Separate
460
dd9f93dc
JM
461N
462Driver
463
903caebf 464O
ab442df7 465Common JoinedOrMissing Optimization
a7b2e184 466-O<number> Set optimization level to <number>.
903caebf
NB
467
468Os
ab442df7 469Common Optimization
a7b2e184 470Optimize for space rather than speed.
903caebf 471
be6d3f0e
RG
472Ofast
473Common Optimization
a7b2e184 474Optimize for speed disregarding exact standards compliance.
be6d3f0e 475
bf7a7185
RG
476Og
477Common Optimization
a7b2e184 478Optimize for debugging experience rather than speed or size.
bf7a7185 479
e742722f
RS
480Oz
481Common Optimization
482Optimize for space aggressively rather than speed.
483
dd9f93dc
JM
484Q
485Driver
486
487Qn
488Driver Negative(Qy)
489
490Qy
491Driver Negative(Qn)
492
6d721f67
JM
493R
494Driver Joined Separate
495
603349bf
JM
496S
497Driver
498
6d721f67
JM
499T
500Driver Joined Separate
501
502Tbss
503Driver Separate
504
e69d7376
JM
505Tbss=
506Driver Joined
507
6d721f67
JM
508Tdata
509Driver Separate
510
e69d7376
JM
511Tdata=
512Driver Joined
513
6d721f67
JM
514Ttext
515Driver Separate
516
e69d7376
JM
517Ttext=
518Driver Joined
519
903caebf 520W
5de8299c 521Common RejectNegative Warning Alias(Wextra)
a7b2e184 522This switch is deprecated; use -Wextra instead.
903caebf 523
603349bf 524Wa,
9ed32e27 525Driver JoinedOrMissing RejectNegative
603349bf
JM
526
527Wl,
9ed32e27 528Driver JoinedOrMissing RejectNegative
603349bf
JM
529
530Wp,
9ed32e27 531Driver JoinedOrMissing RejectNegative
603349bf 532
e01cc6dc 533Waggregate-return
c662432e 534Common Var(warn_aggregate_return) Warning
a7b2e184 535Warn about returning structures, unions or arrays.
e01cc6dc 536
fbd28bc3
JJ
537Waggressive-loop-optimizations
538Common Var(warn_aggressive_loop_optimizations) Init(1) Warning
a7b2e184 539Warn if a loop with constant number of iterations triggers undefined behavior.
fbd28bc3 540
590b1f2d 541Warray-bounds
21af5cdf 542Common Var(warn_array_bounds) Warning
a7b2e184 543Warn if an array is accessed out of bounds.
590b1f2d 544
de1b5c17 545Warray-bounds=
63010089 546Common Joined RejectNegative UInteger Var(warn_array_bounds) Warning IntegerRange(0, 2)
a7b2e184 547Warn if an array is accessed out of bounds.
de1b5c17 548
671a2836
MS
549Wuse-after-free
550Common Var(warn_use_after_free) Warning
dc898b2b 551Warn for uses of pointers to deallocated storage.
671a2836
MS
552
553Wuse-after-free=
554Common Joined RejectNegative UInteger Var(warn_use_after_free) Warning IntegerRange(0, 3)
dc898b2b 555Warn for uses of pointers to deallocated storage.
671a2836 556
5c498b10 557Wattributes
c662432e 558Common Var(warn_attributes) Init(1) Warning
a7b2e184 559Warn about inappropriate attribute usage.
5c498b10 560
a1ad0d84
MP
561Wattributes=
562Common Joined
563Do not warn about specified attributes.
564
5ebfd62b
BE
565Wattribute-alias
566Common Alias(Wattribute_alias=, 1, 0) Warning
d3a02ae5 567Warn about type safety and similar errors and mismatches in declarations with alias attributes.
5ebfd62b 568
79a2c428
MS
569Wattribute-alias=
570Common Joined RejectNegative UInteger Var(warn_attribute_alias) Init(1) Warning IntegerRange(0, 2)
d3a02ae5 571Warn about type safety and similar errors and mismatches in declarations with alias attributes.
79a2c428 572
6902799c
IL
573Wcannot-profile
574Common Var(warn_cannot_profile) Init(1) Warning
575Warn when profiling instrumentation was requested, but could not be applied to
576a certain function.
577
e01cc6dc 578Wcast-align
c662432e 579Common Var(warn_cast_align) Warning
a7b2e184 580Warn about pointer casts which increase alignment.
e01cc6dc 581
1d933576
BE
582Wcast-align=strict
583Common Var(warn_cast_align,2) Warning
584Warn about pointer casts which increase alignment.
585
87cf0651
SB
586Wcpp
587Common Var(warn_cpp) Init(1) Warning
a7b2e184 588Warn when a #warning directive is encountered.
87cf0651 589
e217792b
NM
590Wattribute-warning
591Common Var(warn_attribute_warning) Init(1) Warning
592Warn about uses of __attribute__((warning)) declarations.
593
99063eee
RS
594Wdeprecated
595Common Var(warn_deprecated) Init(1) Warning
596Warn if a deprecated compiler feature, class, method, or field is used.
597
e01cc6dc 598Wdeprecated-declarations
c662432e 599Common Var(warn_deprecated_decl) Init(1) Warning
a7b2e184 600Warn about uses of __attribute__((deprecated)) declarations.
e01cc6dc
NB
601
602Wdisabled-optimization
c662432e 603Common Var(warn_disabled_optimization) Warning
a7b2e184 604Warn when an optimization pass is disabled.
e01cc6dc
NB
605
606Werror
50431bc4 607Common Var(warnings_are_errors)
a7b2e184 608Treat all warnings as errors.
e01cc6dc 609
79cf5994
DD
610Werror=
611Common Joined
a7b2e184 612Treat specified warning as error.
79cf5994 613
903caebf 614Wextra
62a67c94 615Common Var(extra_warnings) Warning
a7b2e184 616Print extra (possibly unwanted) warnings.
903caebf 617
c65a01af 618Wfatal-errors
50431bc4 619Common Var(flag_fatal_errors)
a7b2e184 620Exit on the first error occurred.
c65a01af 621
a214518f 622Wframe-larger-than=
00abf86c
MS
623Common RejectNegative Joined Host_Wide_Int ByteSize Warning Var(warn_frame_larger_than_size) Init(HOST_WIDE_INT_MAX)
624-Wframe-larger-than=<byte-size> Warn if a function's stack frame requires in excess of <byte-size>.
a214518f 625
ae962e57
MS
626Wno-frame-larger-than
627Common Alias(Wframe-larger-than=,18446744073709551615EiB,none) Warning
628Disable -Wframe-larger-than= warning. Equivalent to -Wframe-larger-than=<SIZE_MAX> or larger.
629
a3a704a4
MH
630Wfree-nonheap-object
631Common Var(warn_free_nonheap_object) Init(1) Warning
a7b2e184 632Warn when attempting to free a non-heap object.
a3a704a4 633
b2b40051 634Whsa
c56684fd
MJ
635Common Ignore Warning
636Does nothing. Preserved for backward compatibility.
b2b40051 637
81fea426 638Wimplicit-fallthrough
70f6d5e1
JJ
639Common Alias(Wimplicit-fallthrough=,3,0) Warning
640
641Wimplicit-fallthrough=
63010089 642Common Var(warn_implicit_fallthrough) RejectNegative Joined UInteger Warning IntegerRange(0, 5)
81fea426
MP
643Warn when a switch case falls through.
644
30ba058f
MS
645Winfinite-recursion
646Var(warn_infinite_recursion) Warning
647Warn for infinitely recursive calls.
648
e01cc6dc 649Winline
a924bffb 650Common Var(warn_inline) Warning Optimization
a7b2e184 651Warn when an inlined function cannot be inlined.
e01cc6dc 652
86951993
AM
653Winvalid-memory-model
654Common Var(warn_invalid_memory_model) Init(1) Warning
655Warn when an atomic memory model parameter is known to be outside the valid range.
656
e01cc6dc 657Wlarger-than-
5de8299c 658Common RejectNegative Joined Warning Undocumented Alias(Wlarger-than=)
e8fc888d
MLI
659
660Wlarger-than=
00abf86c
MS
661Common RejectNegative Joined Host_Wide_Int ByteSize Warning Var(warn_larger_than_size) Init(HOST_WIDE_INT_MAX)
662-Wlarger-than=<byte-size> Warn if an object's size exceeds <byte-size>.
e01cc6dc 663
ae962e57
MS
664Wno-larger-than
665Common Alias(Wlarger-than=,18446744073709551615EiB,none) Warning
666Disable -Wlarger-than= warning. Equivalent to -Wlarger-than=<SIZE_MAX> or larger.
667
bf14eba2
JJ
668Wnonnull-compare
669Var(warn_nonnull_compare) Warning
670Warn if comparing pointer parameter with nonnull attribute with NULL.
671
76787f70 672Wnull-dereference
c2d89095 673Common Var(warn_null_dereference) Warning
a7b2e184 674Warn if dereferencing a NULL pointer may lead to erroneous or undefined behavior.
76787f70 675
f9cc1a70 676Wunsafe-loop-optimizations
ee79110c
JJ
677Common Ignore Warning
678Does nothing. Preserved for backward compatibility.
f9cc1a70 679
e01cc6dc 680Wmissing-noreturn
54d62f51 681Common Warning Alias(Wsuggest-attribute=noreturn)
e01cc6dc 682
c59f7203 683Wodr
a0fd3373 684Common Var(warn_odr_violations) Init(1) Warning
a7b2e184 685Warn about some C++ One Definition Rule violations during link time optimization.
c59f7203 686
71834ad3 687Woverflow
c662432e 688Common Var(warn_overflow) Init(1) Warning
a7b2e184 689Warn about overflow in arithmetic expressions.
71834ad3 690
259d29e3
JH
691Wlto-type-mismatch
692Common Var(warn_lto_type_mismatch) Init(1) Warning
a7b2e184 693During link time optimization warn about mismatched types of global declarations.
259d29e3 694
e01cc6dc 695Wpacked
c662432e 696Common Var(warn_packed) Warning
a7b2e184 697Warn when the packed attribute has no effect on struct layout.
e01cc6dc
NB
698
699Wpadded
c662432e 700Common Var(warn_padded) Warning
a7b2e184 701Warn when padding is required to align structure members.
e01cc6dc 702
c1771a20 703Wpedantic
2b71f4a4 704Common Var(pedantic) Init(0) Warning
a7b2e184 705Issue warnings needed for strict compliance to the standard.
c1771a20 706
b4dfdc11
MG
707Wreturn-local-addr
708Common Var(warn_return_local_addr) Init(1) Warning
709Warn about returning a pointer/reference to a local or temporary variable.
710
e01cc6dc 711Wshadow
c662432e 712Common Var(warn_shadow) Warning
84ff4775
LCW
713Warn when one variable shadows another. Same as -Wshadow=global.
714
715Wshadow=global
716Common Warning Alias(Wshadow)
717Warn when one variable shadows another (globally).
718
719Wshadow=local
720Common Var(warn_shadow_local) Warning EnabledBy(Wshadow)
721Warn when one local variable shadows another local variable or parameter.
722
723Wshadow-local
724Common Warning Undocumented Alias(Wshadow=local)
725
726Wshadow=compatible-local
727Common Var(warn_shadow_compatible_local) Warning EnabledBy(Wshadow=local)
728Warn when one local variable shadows another local variable or parameter of compatible type.
729
730Wshadow-compatible-local
731Common Warning Undocumented Alias(Wshadow=compatible-local)
e01cc6dc 732
7d69de61 733Wstack-protector
c662432e 734Common Var(warn_stack_protect) Warning
a7b2e184 735Warn when not issuing stack smashing protection for some reason.
7d69de61 736
a11e0df4 737Wstack-usage=
00abf86c
MS
738Common Joined RejectNegative Host_Wide_Int ByteSize Var(warn_stack_usage) Warning Init(HOST_WIDE_INT_MAX)
739-Wstack-usage=<byte-size> Warn if stack usage might exceed <byte-size>.
a11e0df4 740
ae962e57
MS
741Wno-stack-usage
742Common Alias(Wstack-usage=,18446744073709551615EiB,none) Warning
743Disable Wstack-usage= warning. Equivalent to Wstack-usage=<SIZE_MAX> or larger.
744
e01cc6dc 745Wstrict-aliasing
c662432e 746Common Warning
a7b2e184 747Warn about code which might break strict aliasing rules.
e01cc6dc 748
5399d643 749Wstrict-aliasing=
65d4f2cd 750Common Joined RejectNegative UInteger Var(warn_strict_aliasing) Warning
a7b2e184 751Warn about code which might break strict aliasing rules.
5399d643 752
6ac01510 753Wstrict-overflow
21af5cdf 754Common Warning
a7b2e184 755Warn about optimizations that assume that signed overflow is undefined.
6ac01510
ILT
756
757Wstrict-overflow=
65d4f2cd 758Common Joined RejectNegative UInteger Var(warn_strict_overflow) Warning
a7b2e184 759Warn about optimizations that assume that signed overflow is undefined.
6ac01510 760
12b9f3ac
JH
761Wsuggest-attribute=cold
762Common Var(warn_suggest_attribute_cold) Warning
763Warn about functions which might be candidates for __attribute__((cold)).
764
5dc16b19
MLI
765Wsuggest-attribute=const
766Common Var(warn_suggest_attribute_const) Warning
a7b2e184 767Warn about functions which might be candidates for __attribute__((const)).
5dc16b19
MLI
768
769Wsuggest-attribute=pure
770Common Var(warn_suggest_attribute_pure) Warning
a7b2e184 771Warn about functions which might be candidates for __attribute__((pure)).
5dc16b19 772
7ea6b6cf
JH
773Wsuggest-attribute=noreturn
774Common Var(warn_suggest_attribute_noreturn) Warning
a7b2e184 775Warn about functions which might be candidates for __attribute__((noreturn)).
7ea6b6cf 776
0fab169b
PK
777Wsuggest-attribute=malloc
778Common Var(warn_suggest_attribute_malloc) Warning
779Warn about functions which might be candidates for __attribute__((malloc)).
780
91bc34a9
JH
781Wsuggest-final-types
782Common Var(warn_suggest_final_types) Warning
a7b2e184 783Warn about C++ polymorphic types where adding final keyword would improve code quality.
91bc34a9
JH
784
785Wsuggest-final-methods
786Common Var(warn_suggest_final_methods) Warning
a7b2e184 787Warn about C++ virtual methods where adding final keyword would improve code quality.
91bc34a9 788
a7dc5980
MP
789Wswitch-unreachable
790Common Var(warn_switch_unreachable) Warning Init(1)
791Warn about statements between switch's controlling expression and the first
792case.
793
e01cc6dc 794Wsystem-headers
c662432e 795Common Var(warn_system_headers) Warning
a7b2e184 796Do not suppress warnings from system headers.
e01cc6dc 797
8ffadef9
MG
798Wtrampolines
799Common Var(warn_trampolines) Warning
a7b2e184 800Warn whenever a trampoline is generated.
8ffadef9 801
dbaabd06
QZ
802Wtrivial-auto-var-init
803Common Var(warn_trivial_auto_var_init) Warning Init(0)
804Warn about cases where -ftrivial-auto-var-init cannot initialize an auto variable.
805
faebccf9 806Wtype-limits
95744782 807Common Var(warn_type_limits) Warning EnabledBy(Wextra)
a7b2e184 808Warn if a comparison is always true or always false due to the limited range of the data type.
faebccf9 809
e01cc6dc 810Wuninitialized
7d5a5747 811Common Var(warn_uninitialized) Warning EnabledBy(Wextra)
a7b2e184 812Warn about uninitialized automatic variables.
e01cc6dc 813
2f964ad6 814Wmaybe-uninitialized
7d5a5747 815Common Var(warn_maybe_uninitialized) Warning EnabledBy(Wuninitialized)
a7b2e184 816Warn about maybe uninitialized automatic variables.
2f964ad6 817
e01cc6dc 818Wunreachable-code
f1a62b6f 819Common Ignore Warning
bc3c12a2 820Does nothing. Preserved for backward compatibility.
e01cc6dc 821
903caebf 822Wunused
e73f7547 823Common Var(warn_unused) Init(0) Warning
a7b2e184 824Enable all -Wunused- warnings.
903caebf 825
ebfbbdc5 826Wunused-but-set-parameter
d919140b 827Common Var(warn_unused_but_set_parameter) Warning EnabledBy(Wunused && Wextra)
a7b2e184 828Warn when a function parameter is only set, otherwise unused.
ebfbbdc5
JJ
829
830Wunused-but-set-variable
7d5a5747 831Common Var(warn_unused_but_set_variable) Warning EnabledBy(Wunused)
a7b2e184 832Warn when a variable is only set, otherwise unused.
ebfbbdc5 833
e01cc6dc 834Wunused-function
7d5a5747 835Common Var(warn_unused_function) Warning EnabledBy(Wunused)
a7b2e184 836Warn when a function is unused.
e01cc6dc
NB
837
838Wunused-label
7d5a5747 839Common Var(warn_unused_label) Warning EnabledBy(Wunused)
a7b2e184 840Warn when a label is unused.
e01cc6dc
NB
841
842Wunused-parameter
d919140b 843Common Var(warn_unused_parameter) Warning EnabledBy(Wunused && Wextra)
a7b2e184 844Warn when a function parameter is unused.
e01cc6dc
NB
845
846Wunused-value
7d5a5747 847Common Var(warn_unused_value) Warning EnabledBy(Wunused)
a7b2e184 848Warn when an expression value is unused.
e01cc6dc
NB
849
850Wunused-variable
7d5a5747 851Common Var(warn_unused_variable) Warning EnabledBy(Wunused)
a7b2e184 852Warn when a variable is unused.
e01cc6dc 853
16c1c158 854Wcoverage-mismatch
650cfcab 855Common Var(warn_coverage_mismatch) Init(1) Warning
a7b2e184 856Warn in case profiles in -fprofile-use do not match.
16c1c158 857
8bf728ae
ML
858Wcoverage-invalid-line-number
859Common Var(warn_coverage_invalid_linenum) Init(1) Warning
860Warn in case a function ends earlier than it begins due to an invalid linenum macros.
861
bc162b0e
IB
862Wmissing-profile
863Common Var(warn_missing_profile) Init(1) Warning
864Warn in case profiles in -fprofile-use do not exist.
865
cdbb5ba3
AS
866Wvector-operation-performance
867Common Var(warn_vector_operation_performance) Warning
a7b2e184 868Warn when a vector operation is compiled outside the SIMD.
cdbb5ba3 869
8833eab4
ML
870Wtsan
871Common Var(warn_tsan) Init(1) Warning
872Warn about unsupported features in ThreadSanitizer.
873
603349bf
JM
874Xassembler
875Driver Separate
876
877Xlinker
878Driver Separate
879
880Xpreprocessor
881Driver Separate
882
dd9f93dc
JM
883Z
884Driver
885
d185d268 886aux-info
d5478783 887Common Separate Var(aux_info_file_name)
a7b2e184 888-aux-info <file> Emit declaration information into <file>.
d185d268
NB
889
890aux-info=
5de8299c 891Common Joined Alias(aux-info)
d185d268 892
e200444e
JM
893coverage
894Driver
895
603349bf
JM
896c
897Driver
d185d268
NB
898
899d
900Common Joined
a7b2e184 901-d<letters> Enable dumps from specific passes of the compiler.
d185d268
NB
902
903dumpbase
1dedc12d 904Driver Common Separate Var(dump_base_name)
a7b2e184 905-dumpbase <file> Set the file basename to be used for dumps.
d185d268 906
1dedc12d
AO
907dumpbase-ext
908Driver Common Separate Var(dump_base_ext)
909-dumpbase-ext .<ext> Drop a trailing .<ext> from the dump basename to name auxiliary output files.
910
d7fb0a6d 911dumpdir
1dedc12d 912Driver Common Separate Var(dump_dir_name)
a7b2e184 913-dumpdir <dir> Set the directory name to be used for dumps.
d7fb0a6d 914
603349bf
JM
915dumpmachine
916Driver
917
918dumpspecs
919Driver
920
921dumpversion
922Driver
923
3c36aa6b
JJ
924dumpfullversion
925Driver
926
e200444e
JM
927e
928Driver Joined Separate
929
fa381cb2
JM
930; This option has historically been passed down to the linker by an
931; accident of a %{e*} spec, so ensure it continues to be passed down
932; as a single option. The supported option for this purpose is
933; -rdynamic. See PR 47390.
934export-dynamic
935Driver Undocumented
936
31b66477
KC
937; The version of the C++ ABI in use. The following values are allowed:
938;
939; 0: The version of the ABI believed most conformant with the C++ ABI
940; specification. This ABI may change as bugs are discovered and fixed.
941; Therefore, 0 will not necessarily indicate the same ABI in different
942; versions of G++.
943;
90d84934 944; 1: The version of the ABI first used in G++ 3.2. No longer selectable.
31b66477 945;
785f21af
JM
946; 2: The version of the ABI first used in G++ 3.4, and the default
947; until GCC 4.9.
abfe01ce
JM
948;
949; 3: The version of the ABI that fixes the missing underscore
950; in template non-type arguments of pointer type.
951;
952; 4: The version of the ABI that introduces unambiguous mangling of
55af847f 953; vector types. First selectable in G++ 4.5.
99a8d35b 954;
67e18edb 955; 5: The version of the ABI that ignores attribute const/noreturn
55af847f 956; in function pointer mangling, and corrects mangling of decltype and
67e18edb 957; function parameters used in other parameters and the return type.
55af847f 958; First selectable in G++ 4.6.
67e18edb 959;
4b6aaa99
JM
960; 6: The version of the ABI that doesn't promote scoped enums to int and
961; changes the mangling of template argument packs, const/static_cast,
962; prefix ++ and --, and a class scope function used as a template
963; argument.
967444bb
JM
964; First selectable in G++ 4.7.
965;
622aac0b
JM
966; 7: The version of the ABI that treats nullptr_t as a builtin type and
967; corrects the mangling of lambdas in default argument scope.
a3ddb738 968; First selectable in G++ 4.8.
0861bec8
JM
969;
970; 8: The version of the ABI that corrects the substitution behavior of
971; function types with function-cv-qualifiers.
603eaec4
JM
972; First selectable in G++ 4.9 and default in G++ 5.
973;
a03c9bf1
JM
974; 9: The version of the ABI that corrects the alignment of nullptr_t.
975; First selectable and default in G++ 5.2.
976;
977; 10: The version of the ABI that mangles attributes that affect type
978; identity, such as ia32 calling convention attributes (stdcall, etc.)
979; Default in G++ 6 (set in c_common_post_options).
0861bec8 980;
31f7f784
JM
981; 11: The version of the ABI that corrects mangling of sizeof... expressions
982; and introduces new inheriting constructor handling.
34bbc4c5
JM
983; Default in G++ 7.
984;
f3ec182d 985; 12: Corrects the calling convention for classes with only deleted copy/move
974aedcc 986; constructors and changes passing/returning of empty records.
34a7a230
JM
987; Default in G++ 8.1.
988;
989; 13: Fixes the accidental change in 12 to the calling convention for classes
990; with deleted copy constructor and trivial move constructor.
991; Default in G++ 8.2.
b1c9b3c3 992;
e0c866dd
KK
993; 14: Corrects the mangling of nullptr expression.
994; Default in G++ 10.
f3ec182d 995;
5f00df59
JM
996; 15: Corrects G++ 10 ABI tag regression [PR98481].
997; Available, but not default, in G++ 10.3.
998;
999; 16: Changes the mangling of __alignof__ to be distinct from that of alignof.
1000; Adds missing 'on' in mangling of operator names in some cases.
b1c9b3c3
PP
1001; Default in G++ 11.
1002;
a37e8ce3
JM
1003; 17: Fixes layout of classes that inherit from aggregate classes with default
1004; member initializers in C++14 and up.
1005; Default in G++ 12.
1006;
c7cb239f
NS
1007; 18: Corrects errors in mangling of lambdas with additional context.
1008; Default in G++ 13.
1009;
31b66477
KC
1010; Additional positive integers will be assigned as new versions of
1011; the ABI become the default version of the ABI.
57782ad8 1012fabi-version=
ca0e51a0 1013Common Joined RejectNegative UInteger Var(flag_abi_version) Init(0)
a7b2e184 1014The version of the C++ ABI in use.
57782ad8 1015
6e616110 1016faggressive-loop-optimizations
eece52b5 1017Common Var(flag_aggressive_loop_optimizations) Optimization Init(1)
a7b2e184 1018Aggressively optimize loops using language constraints.
6e616110 1019
6ff3a151 1020falign-functions
eece52b5 1021Common Var(flag_align_functions) Optimization
a7b2e184 1022Align the start of functions.
6ff3a151 1023
058de654 1024falign-functions=
c518c102 1025Common RejectNegative Joined Var(str_align_functions) Optimization
058de654 1026
8cac4d85 1027flimit-function-alignment
eece52b5 1028Common Var(flag_limit_function_alignment) Optimization Init(0)
8cac4d85 1029
6ff3a151 1030falign-jumps
eece52b5 1031Common Var(flag_align_jumps) Optimization
a7b2e184 1032Align labels which are only reached by jumping.
6ff3a151 1033
058de654 1034falign-jumps=
c518c102 1035Common RejectNegative Joined Var(str_align_jumps) Optimization
058de654 1036
6ff3a151 1037falign-labels
eece52b5 1038Common Var(flag_align_labels) Optimization
a7b2e184 1039Align all labels.
6ff3a151 1040
058de654 1041falign-labels=
c518c102 1042Common RejectNegative Joined Var(str_align_labels) Optimization
058de654 1043
6ff3a151 1044falign-loops
eece52b5 1045Common Var(flag_align_loops) Optimization
a7b2e184 1046Align the start of loops.
6ff3a151 1047
058de654 1048falign-loops=
8956e247 1049Common RejectNegative Joined Var(str_align_loops) Optimization
058de654 1050
e622a32d 1051fallow-store-data-races
eece52b5 1052Common Var(flag_store_data_races) Optimization
e622a32d
RB
1053Allow the compiler to introduce new data races on stores.
1054
757bf1df
DM
1055fanalyzer
1056Common Var(flag_analyzer)
1057Enable static analysis pass.
1058
6ff3a151 1059fargument-alias
2d2bd949 1060Common Ignore
0d3c82d6 1061Does nothing. Preserved for backward compatibility.
6ff3a151
NB
1062
1063fargument-noalias
2d2bd949 1064Common Ignore
0d3c82d6 1065Does nothing. Preserved for backward compatibility.
6ff3a151
NB
1066
1067fargument-noalias-global
2d2bd949 1068Common Ignore
0d3c82d6 1069Does nothing. Preserved for backward compatibility.
6ff3a151 1070
0698a1d2 1071fargument-noalias-anything
2d2bd949 1072Common Ignore
0d3c82d6 1073Does nothing. Preserved for backward compatibility.
0698a1d2 1074
de5a5fa1 1075fsanitize=
eece52b5 1076Common Driver Joined
a7b2e184 1077Select what to sanitize.
32b4b7f5 1078
f6e50a7d 1079fsanitize-coverage=
0ebb09f5 1080Common Joined Enum(sanitize_coverage) Var(flag_sanitize_coverage) EnumBitSet
cefc0906 1081Select type of coverage sanitization.
f6e50a7d 1082
c1681f22
ML
1083Enum
1084Name(sanitize_coverage) Type(int)
1085
1086EnumValue
0ebb09f5 1087Enum(sanitize_coverage) String(trace-pc) Value(SANITIZE_COV_TRACE_PC)
c1681f22
ML
1088
1089EnumValue
0ebb09f5 1090Enum(sanitize_coverage) String(trace-cmp) Value(SANITIZE_COV_TRACE_CMP)
c1681f22 1091
fd960af2
YG
1092fasan-shadow-offset=
1093Common Joined RejectNegative Var(common_deferred_options) Defer
1094-fasan-shadow-offset=<number> Use custom shadow memory offset.
1095
18af8d16
YG
1096fsanitize-sections=
1097Common Joined RejectNegative Var(common_deferred_options) Defer
1098-fsanitize-sections=<sec1,sec2,...> Sanitize global variables
1099in user-defined sections.
1100
d95a2703 1101fsanitize-recover=
eece52b5 1102Common Joined
a7b2e184 1103After diagnosing undefined behavior attempt to continue execution.
1c33c9b7 1104
d95a2703 1105fsanitize-recover
eece52b5 1106Common
a7b2e184 1107This switch is deprecated; use -fsanitize-recover= instead.
d95a2703 1108
2c7cfc7b
JJ
1109fsanitize-trap=
1110Common Driver Joined
1111Use traps instead of diagnostics of undefined behavior sanitizers.
1112
1113fsanitize-trap
1114Common Driver
1115
6dc4a604 1116fsanitize-address-use-after-scope
eece52b5 1117Common Driver Var(flag_sanitize_address_use_after_scope) Init(0)
6dc4a604 1118
1c33c9b7 1119fsanitize-undefined-trap-on-error
2c7cfc7b
JJ
1120Common Driver Alias(fsanitize-trap)
1121This switch is deprecated; use -fsanitize-trap= instead.
1c33c9b7 1122
6ff3a151 1123fasynchronous-unwind-tables
eece52b5 1124Common Var(flag_asynchronous_unwind_tables) Optimization
a7b2e184 1125Generate unwind tables that are exact at each instruction boundary.
6ff3a151 1126
6fb5fa3c 1127fauto-inc-dec
eece52b5 1128Common Var(flag_auto_inc_dec) Init(1) Optimization
a7b2e184 1129Generate auto-inc/dec instructions.
6fb5fa3c 1130
be3c16c4 1131fauto-profile
eece52b5 1132Common Var(flag_auto_profile)
be3c16c4
DC
1133Use sample profile information for call graph node weights. The default
1134profile file is fbdata.afdo in 'pwd'.
1135
1136fauto-profile=
1137Common Joined RejectNegative Var(auto_profile_file)
1138Use sample profile information for call graph node weights. The profile
1139file is specified in the argument.
1140
31b66477
KC
1141; -fcheck-bounds causes gcc to generate array bounds checks.
1142; For C, C++ and ObjC: defaults off.
1143; For Java: defaults to on.
1144; For Fortran: defaults to off.
6ff3a151 1145fbounds-check
eece52b5 1146Common Var(flag_bounds_check)
a7b2e184 1147Generate code to check bounds before indexing arrays.
6ff3a151
NB
1148
1149fbranch-count-reg
eece52b5 1150Common Var(flag_branch_on_count_reg) Optimization
a7b2e184 1151Replace add, compare, branch with branch on count register.
6ff3a151
NB
1152
1153fbranch-probabilities
eece52b5 1154Common Var(flag_branch_probabilities) Optimization
a7b2e184 1155Use profiling information for branch probabilities.
6ff3a151 1156
de32c0cb 1157fbranch-target-load-optimize
f78f73cb
RS
1158Common Ignore
1159Does nothing. Preserved for backward compatibility.
de32c0cb
NB
1160
1161fbranch-target-load-optimize2
f78f73cb
RS
1162Common Ignore
1163Does nothing. Preserved for backward compatibility.
de32c0cb 1164
1194fc79 1165fbtr-bb-exclusive
f78f73cb
RS
1166Common Ignore
1167Does nothing. Preserved for backward compatibility.
1194fc79 1168
3cf3da88 1169fcallgraph-info
eece52b5 1170Common RejectNegative Var(flag_callgraph_info) Init(NO_CALLGRAPH_INFO);
3cf3da88
EB
1171Output callgraph information on a per-file basis.
1172
1173fcallgraph-info=
eece52b5 1174Common RejectNegative Joined
3cf3da88
EB
1175Output callgraph information on a per-file basis with decorations.
1176
058de654 1177fcall-saved-
21bf1558 1178Common Joined RejectNegative Var(common_deferred_options) Defer
a7b2e184 1179-fcall-saved-<register> Mark <register> as being preserved across functions.
058de654
NB
1180
1181fcall-used-
21bf1558 1182Common Joined RejectNegative Var(common_deferred_options) Defer
a7b2e184 1183-fcall-used-<register> Mark <register> as being corrupted by function calls.
058de654 1184
31b66477
KC
1185; Nonzero for -fcaller-saves: allocate values in regs that need to
1186; be saved across function calls, if that produces overall better code.
1187; Optional now, so people can test it.
de32c0cb 1188fcaller-saves
eece52b5 1189Common Var(flag_caller_saves) Optimization
a7b2e184 1190Save registers around function calls.
de32c0cb 1191
3d8864c0 1192fcheck-data-deps
c0c12356 1193Common Ignore
49b8fe6c 1194This switch is deprecated; do not use.
3d8864c0 1195
2284b034
MG
1196fcheck-new
1197Common Var(flag_check_new)
a7b2e184 1198Check the return value of new in C++.
2284b034 1199
6d27d749 1200fchecking
b06f87c7 1201Common Var(flag_checking) Init(CHECKING_P ? ENABLE_EXTRA_CHECKING ? 2 : 1 : 0)
6d27d749
RB
1202Perform internal consistency checkings.
1203
7db11a5a
JJ
1204fchecking=
1205Common Joined RejectNegative UInteger Var(flag_checking)
1206Perform internal consistency checkings.
1207
37ccb0ba 1208fcode-hoisting
eece52b5 1209Common Var(flag_code_hoisting) Optimization
37ccb0ba
SB
1210Enable code hoisting.
1211
ccaeeafe 1212fcombine-stack-adjustments
eece52b5 1213Common Var(flag_combine_stack_adjustments) Optimization
ccaeeafe
NC
1214Looks for opportunities to reduce stack adjustments and stack references.
1215
6ff3a151 1216fcommon
eece52b5 1217Common Var(flag_no_common,0) Init(1)
df73e971 1218Put uninitialized globals in the common section.
6ff3a151 1219
603349bf
JM
1220fcompare-debug
1221Driver
1222; Converted by the driver to -fcompare-debug= options.
1223
2153915d 1224fcompare-debug=
603349bf 1225Common Driver JoinedOrMissing RejectNegative Var(flag_compare_debug_opt)
a7b2e184 1226-fcompare-debug[=<opts>] Compile with and without e.g. -gtoggle, and compare the final-insns dump.
2153915d
AO
1227
1228fcompare-debug-second
5e471ea6 1229Common Driver RejectNegative Var(flag_compare_debug)
a7b2e184 1230Run only the second compilation of -fcompare-debug.
2153915d 1231
e692f276 1232fcompare-elim
eece52b5 1233Common Var(flag_compare_elim_after_reload) Optimization
a7b2e184 1234Perform comparison elimination after register allocation has finished.
e692f276 1235
b5b8b0ac
AO
1236fconserve-stack
1237Common Var(flag_conserve_stack) Optimization
a7b2e184 1238Do not perform optimizations increasing noticeably stack usage.
b5b8b0ac 1239
6ff3a151 1240fcprop-registers
eece52b5 1241Common Var(flag_cprop_registers) Optimization
a7b2e184 1242Perform a register copy-propagation optimization pass.
6ff3a151 1243
de32c0cb 1244fcrossjumping
eece52b5 1245Common Var(flag_crossjumping) Optimization
a7b2e184 1246Perform cross-jumping optimization.
de32c0cb
NB
1247
1248fcse-follow-jumps
eece52b5 1249Common Var(flag_cse_follow_jumps) Optimization
a7b2e184 1250When running CSE, follow jumps to their targets.
de32c0cb
NB
1251
1252fcse-skip-blocks
2d2bd949 1253Common Ignore
5f39ad47 1254Does nothing. Preserved for backward compatibility.
de32c0cb 1255
c7463669 1256fcx-limited-range
eece52b5 1257Common Var(flag_cx_limited_range) Optimization SetByCombined
a7b2e184 1258Omit range reduction step when performing complex division.
c7463669 1259
35085f76 1260fcx-fortran-rules
eece52b5 1261Common Var(flag_cx_fortran_rules) Optimization
a7b2e184 1262Complex multiplication and division follow Fortran rules.
35085f76 1263
6ff3a151 1264fdata-sections
eece52b5 1265Common Var(flag_data_sections)
a7b2e184 1266Place data items into their own section.
6ff3a151 1267
0a090f42 1268fdbg-cnt-list
eece52b5 1269Common Var(flag_dbg_cnt_list)
0a090f42
SP
1270List all available debugging counters with their limits and counts.
1271
6fb5fa3c 1272fdbg-cnt=
299404a1 1273Common RejectNegative Joined Var(common_deferred_options) Defer
83a49336 1274-fdbg-cnt=<counter>[:<lower_limit1>-]<upper_limit1>[:<lower_limit2>-<upper_limit2>:...][,<counter>:...] Set the debug counter limit.
6fb5fa3c 1275
c8aea42c 1276fdebug-prefix-map=
299404a1 1277Common Joined RejectNegative Var(common_deferred_options) Defer
b408e010 1278-fdebug-prefix-map=<old>=<new> Map one directory name to another in debug information.
7365279f
BK
1279
1280ffile-prefix-map=
1281Common Joined RejectNegative Var(common_deferred_options) Defer
b408e010 1282-ffile-prefix-map=<old>=<new> Map one directory name to another in compilation result.
c8aea42c 1283
76f9db36 1284fdebug-types-section
eece52b5 1285Common Var(flag_debug_types_section) Init(0)
76f9db36
JJ
1286Output .debug_types section when using DWARF v4 debuginfo.
1287
31b66477
KC
1288; Nonzero for -fdefer-pop: don't pop args after each function call
1289; instead save them up to pop many calls' args with one insns.
de32c0cb 1290fdefer-pop
eece52b5 1291Common Var(flag_defer_pop) Optimization
a7b2e184 1292Defer popping functions args from stack until later.
de32c0cb
NB
1293
1294fdelayed-branch
eece52b5 1295Common Var(flag_delayed_branch) Optimization
a7b2e184 1296Attempt to fill delay slots of branch instructions.
de32c0cb 1297
2da02156 1298fdelete-dead-exceptions
eece52b5 1299Common Var(flag_delete_dead_exceptions) Init(0) Optimization
a7b2e184 1300Delete dead instructions that may throw exceptions.
2da02156 1301
de32c0cb 1302fdelete-null-pointer-checks
eece52b5 1303Common Var(flag_delete_null_pointer_checks) Init(-1) Optimization
a7b2e184 1304Delete useless null pointer checks.
de32c0cb 1305
1e29e4d3 1306fdevirtualize-at-ltrans
eece52b5 1307Common Var(flag_ltrans_devirtualize)
a7b2e184 1308Stream extra data to support more aggressive devirtualization in LTO local transformation mode.
1e29e4d3 1309
bbc9396b 1310fdevirtualize-speculatively
eece52b5 1311Common Var(flag_devirtualize_speculatively) Optimization
a7b2e184 1312Perform speculative devirtualization.
bbc9396b 1313
ca1eedf6 1314fdevirtualize
eece52b5 1315Common Var(flag_devirtualize) Optimization
ca1eedf6
JH
1316Try to convert virtual calls to direct ones.
1317
de32c0cb 1318fdiagnostics-show-location=
e6d4b984 1319Common Joined RejectNegative Enum(diagnostic_prefixing_rule)
a7b2e184 1320-fdiagnostics-show-location=[once|every-line] How often to emit source location at the beginning of line-wrapped diagnostics.
de32c0cb 1321
e6d4b984
JM
1322; Required for these enum values.
1323SourceInclude
1324pretty-print.h
1325
1326Enum
1327Name(diagnostic_prefixing_rule) Type(int)
1328
1329EnumValue
1330Enum(diagnostic_prefixing_rule) String(once) Value(DIAGNOSTICS_SHOW_PREFIX_ONCE)
1331
1332EnumValue
1333Enum(diagnostic_prefixing_rule) String(every-line) Value(DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE)
1334
9fec0042
MLI
1335fdiagnostics-show-caret
1336Common Var(flag_diagnostics_show_caret) Init(1)
a7b2e184 1337Show the source line with a caret indicating the column.
9fec0042 1338
96e6ae57
DM
1339fdiagnostics-show-labels
1340Common Var(flag_diagnostics_show_labels) Init(1)
04e5c73d 1341Show labels annotating ranges of source code when showing source.
96e6ae57 1342
56b61d7f
DM
1343fdiagnostics-show-line-numbers
1344Common Var(flag_diagnostics_show_line_numbers) Init(1)
04e5c73d 1345Show line numbers in the left margin when showing source.
56b61d7f 1346
4b84d650
JJ
1347fdiagnostics-color
1348Common Alias(fdiagnostics-color=,always,never)
1349;
1350
1351fdiagnostics-color=
97aa8bb6 1352Driver Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO)
a7b2e184 1353-fdiagnostics-color=[never|always|auto] Colorize diagnostics.
4b84d650
JJ
1354
1355; Required for these enum values.
1356SourceInclude
1357diagnostic-color.h
1358
1359Enum
1360Name(diagnostic_color_rule) Type(int)
1361
1362EnumValue
1363Enum(diagnostic_color_rule) String(never) Value(DIAGNOSTICS_COLOR_NO)
1364
1365EnumValue
1366Enum(diagnostic_color_rule) String(always) Value(DIAGNOSTICS_COLOR_YES)
1367
1368EnumValue
1369Enum(diagnostic_color_rule) String(auto) Value(DIAGNOSTICS_COLOR_AUTO)
1370
d2608235
DM
1371fdiagnostics-urls=
1372Driver Common Joined RejectNegative Var(flag_diagnostics_show_urls) Enum(diagnostic_url_rule) Init(DIAGNOSTICS_URL_AUTO)
1373-fdiagnostics-urls=[never|always|auto] Embed URLs in diagnostics.
1374
1375; Required for these enum values.
1376SourceInclude
1377diagnostic-url.h
1378
1379Enum
1380Name(diagnostic_url_rule) Type(int)
1381
1382EnumValue
1383Enum(diagnostic_url_rule) String(never) Value(DIAGNOSTICS_URL_NO)
1384
1385EnumValue
1386Enum(diagnostic_url_rule) String(always) Value(DIAGNOSTICS_URL_YES)
1387
1388EnumValue
1389Enum(diagnostic_url_rule) String(auto) Value(DIAGNOSTICS_URL_AUTO)
1390
004bb936
LH
1391fdiagnostics-column-unit=
1392Common Joined RejectNegative Enum(diagnostics_column_unit)
1393-fdiagnostics-column-unit=[display|byte] Select whether column numbers are output as display columns (default) or raw bytes.
1394
1395fdiagnostics-column-origin=
1396Common Joined RejectNegative UInteger
1397-fdiagnostics-column-origin=<number> Set the number of the first column. The default is 1-based as per GNU style, but some utilities may expect 0-based, for example.
1398
478dd60d
DM
1399fdiagnostics-format=
1400Common Joined RejectNegative Enum(diagnostics_output_format)
6cf276dd 1401-fdiagnostics-format=[text|sarif-stderr|sarif-file|json|json-stderr|json-file] Select output format.
478dd60d 1402
bd5e882c
DM
1403fdiagnostics-escape-format=
1404Common Joined RejectNegative Enum(diagnostics_escape_format)
1405-fdiagnostics-escape-format=[unicode|bytes] Select how to escape non-printable-ASCII bytes in the source for diagnostics that suggest it.
1406
478dd60d
DM
1407; Required for these enum values.
1408SourceInclude
1409diagnostic.h
1410
004bb936
LH
1411Enum
1412Name(diagnostics_column_unit) Type(int)
1413
1414EnumValue
1415Enum(diagnostics_column_unit) String(display) Value(DIAGNOSTICS_COLUMN_UNIT_DISPLAY)
1416
1417EnumValue
1418Enum(diagnostics_column_unit) String(byte) Value(DIAGNOSTICS_COLUMN_UNIT_BYTE)
1419
bd5e882c
DM
1420Enum
1421Name(diagnostics_escape_format) Type(int)
1422
1423EnumValue
1424Enum(diagnostics_escape_format) String(unicode) Value(DIAGNOSTICS_ESCAPE_FORMAT_UNICODE)
1425
1426EnumValue
1427Enum(diagnostics_escape_format) String(bytes) Value(DIAGNOSTICS_ESCAPE_FORMAT_BYTES)
1428
478dd60d
DM
1429Enum
1430Name(diagnostics_output_format) Type(int)
1431
1432EnumValue
1433Enum(diagnostics_output_format) String(text) Value(DIAGNOSTICS_OUTPUT_FORMAT_TEXT)
1434
1435EnumValue
5ab73173
DM
1436Enum(diagnostics_output_format) String(json) Value(DIAGNOSTICS_OUTPUT_FORMAT_JSON_STDERR)
1437
1438EnumValue
1439Enum(diagnostics_output_format) String(json-stderr) Value(DIAGNOSTICS_OUTPUT_FORMAT_JSON_STDERR)
1440
1441EnumValue
1442Enum(diagnostics_output_format) String(json-file) Value(DIAGNOSTICS_OUTPUT_FORMAT_JSON_FILE)
478dd60d 1443
6cf276dd
DM
1444EnumValue
1445Enum(diagnostics_output_format) String(sarif-stderr) Value(DIAGNOSTICS_OUTPUT_FORMAT_SARIF_STDERR)
1446
1447EnumValue
1448Enum(diagnostics_output_format) String(sarif-file) Value(DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE)
1449
a93eac6a
DM
1450fdiagnostics-parseable-fixits
1451Common Var(flag_diagnostics_parseable_fixits)
8135a004 1452Print fix-it hints in machine-readable form.
a93eac6a 1453
717ebe91
DM
1454fdiagnostics-generate-patch
1455Common Var(flag_diagnostics_generate_patch)
1456Print fix-it hints to stderr in unified diff format.
1457
ccf08a6e 1458fdiagnostics-show-option
c7d0de89 1459Common Var(flag_diagnostics_show_option) Init(1)
a7b2e184 1460Amend appropriate diagnostic messages with the command line option that controls them.
ccf08a6e 1461
6d4a35ca
DM
1462fdiagnostics-show-cwe
1463Common Var(flag_diagnostics_show_cwe) Init(1)
1464Print CWE identifiers for diagnostic messages, where available.
1465
0b14f590
DM
1466fdiagnostics-show-rules
1467Common Var(flag_diagnostics_show_rules) Init(1)
1468Print any rules associated with diagnostic messages.
1469
4bc1899b
DM
1470fdiagnostics-path-format=
1471Common Joined RejectNegative Var(flag_diagnostics_path_format) Enum(diagnostic_path_format) Init(DPF_INLINE_EVENTS)
1472Specify how to print any control-flow path associated with a diagnostic.
1473
129a1319
LH
1474fdiagnostics-plain-output
1475Driver Common RejectNegative
1476Turn off any diagnostics features that complicate the output, such as line numbers, color, and warning URLs.
1477
004bb936
LH
1478ftabstop=
1479Common Joined RejectNegative UInteger
1480-ftabstop=<number> Distance between tab stops for column reporting.
1481
4bc1899b
DM
1482Enum
1483Name(diagnostic_path_format) Type(int)
1484
1485EnumValue
1486Enum(diagnostic_path_format) String(none) Value(DPF_NONE)
1487
1488EnumValue
1489Enum(diagnostic_path_format) String(separate-events) Value(DPF_SEPARATE_EVENTS)
1490
1491EnumValue
1492Enum(diagnostic_path_format) String(inline-events) Value(DPF_INLINE_EVENTS)
1493
1494fdiagnostics-show-path-depths
1495Common Var(flag_diagnostics_show_path_depths) Init(0)
1496Show stack depths of events in paths.
1497
0141ab44
DM
1498fdiagnostics-minimum-margin-width=
1499Common Joined UInteger Var(diagnostics_minimum_margin_width) Init(6)
04e5c73d 1500Set minimum width of left margin of source code when showing source.
0141ab44 1501
226c52aa
XDL
1502fdisable-
1503Common Joined RejectNegative Var(common_deferred_options) Defer
b408e010 1504-fdisable-[tree|rtl|ipa]-<pass>=range1+range2 Disable an optimization pass.
226c52aa
XDL
1505
1506fenable-
1507Common Joined RejectNegative Var(common_deferred_options) Defer
b408e010 1508-fenable-[tree|rtl|ipa]-<pass>=range1+range2 Enable an optimization pass.
226c52aa 1509
6de9cd9a 1510fdump-
21bf1558 1511Common Joined RejectNegative Var(common_deferred_options) Defer
a7b2e184 1512-fdump-<type> Dump various compiler internals to a file.
6de9cd9a 1513
d1583032
JM
1514fdump-final-insns
1515Driver RejectNegative
1516
2153915d
AO
1517fdump-final-insns=
1518Common RejectNegative Joined Var(flag_dump_final_insns)
a7b2e184 1519-fdump-final-insns=filename Dump to filename the insns at the end of translation.
2153915d 1520
c6a13190
ILT
1521fdump-go-spec=
1522Common RejectNegative Joined Var(flag_dump_go_spec)
a7b2e184 1523-fdump-go-spec=filename Write all declarations to file as Go code.
c6a13190 1524
24a7799e 1525fdump-noaddr
eece52b5 1526Common Var(flag_dump_noaddr)
a7b2e184 1527Suppress output of addresses in debugging dumps.
24a7799e 1528
dc10fd96
JJ
1529freport-bug
1530Common Driver Var(flag_report_bug)
1531Collect and dump debug information into temporary file if ICE in C/C++
bd2c6270 1532compiler occurred.
dc10fd96 1533
ba4ad400
DM
1534fdump-internal-locations
1535Common Var(flag_dump_locations) Init(0)
a7b2e184 1536Dump detailed information on GCC's internal representation of source code locations.
ba4ad400 1537
deced1e2
XDL
1538fdump-passes
1539Common Var(flag_dump_passes) Init(0)
a7b2e184 1540Dump optimization passes.
deced1e2 1541
6ff3a151 1542fdump-unnumbered
eece52b5 1543Common Var(flag_dump_unnumbered)
a7b2e184 1544Suppress output of instruction numbers, line number notes and addresses in debugging dumps.
6ff3a151 1545
2aa7c49b 1546fdump-unnumbered-links
eece52b5 1547Common Var(flag_dump_unnumbered_links)
a7b2e184 1548Suppress output of previous and next insn numbers in debugging dumps.
2aa7c49b 1549
b5b8b0ac 1550fdwarf2-cfi-asm
eece52b5 1551Common Var(flag_dwarf2_cfi_asm) Init(HAVE_GAS_CFI_DIRECTIVE)
b5b8b0ac
AO
1552Enable CFI tables via GAS assembler directives.
1553
355866de 1554fearly-inlining
eece52b5 1555Common Var(flag_early_inlining) Init(1) Optimization
a7b2e184 1556Perform early inlining.
355866de 1557
de32c0cb 1558feliminate-dwarf2-dups
1823c4f6
RB
1559Common Ignore
1560Does nothing. Preserved for backward compatibility.
de32c0cb 1561
07ffa034 1562fipa-sra
eece52b5 1563Common Var(flag_ipa_sra) Init(0) Optimization
a7b2e184 1564Perform interprocedural reduction of aggregates.
07ffa034 1565
6a08f7b3 1566feliminate-unused-debug-symbols
eece52b5 1567Common Var(flag_debug_only_used_symbols) Init(1)
a7b2e184 1568Perform unused symbol elimination in debug info.
6a08f7b3 1569
de32c0cb 1570feliminate-unused-debug-types
eece52b5 1571Common Var(flag_eliminate_unused_debug_types) Init(1)
a7b2e184 1572Perform unused type elimination in debug info.
de32c0cb 1573
e713adf6 1574femit-class-debug-always
eece52b5 1575Common Var(flag_emit_class_debug_always) Init(0)
e713adf6
CD
1576Do not suppress C++ class debug information.
1577
6ff3a151 1578fexceptions
1313111f 1579Common Var(flag_exceptions) Optimization EnabledBy(fnon-call-exceptions)
a7b2e184 1580Enable exception handling.
6ff3a151 1581
de32c0cb 1582fexpensive-optimizations
eece52b5 1583Common Var(flag_expensive_optimizations) Optimization
a7b2e184 1584Perform a number of minor, expensive optimizations.
de32c0cb 1585
8ce94e44 1586fexcess-precision=
df375b03 1587Common Joined RejectNegative Enum(excess_precision) Var(flag_excess_precision) Init(EXCESS_PRECISION_DEFAULT) Optimization SetByCombined
f19a3270 1588-fexcess-precision=[fast|standard|16] Specify handling of excess floating-point precision.
8ce94e44 1589
e6d4b984
JM
1590Enum
1591Name(excess_precision) Type(enum excess_precision) UnknownError(unknown excess precision style %qs)
1592
1593EnumValue
1594Enum(excess_precision) String(fast) Value(EXCESS_PRECISION_FAST)
1595
1596EnumValue
1597Enum(excess_precision) String(standard) Value(EXCESS_PRECISION_STANDARD)
1598
f19a3270 1599EnumValue
1600Enum(excess_precision) String(16) Value(EXCESS_PRECISION_FLOAT16)
1601
04f0fcf7
JG
1602; Whether we permit the extended set of values for FLT_EVAL_METHOD
1603; introduced in ISO/IEC TS 18661-3, or limit ourselves to those in C99/C11.
1604fpermitted-flt-eval-methods=
1605Common Joined RejectNegative Enum(permitted_flt_eval_methods) Var(flag_permitted_flt_eval_methods) Init(PERMITTED_FLT_EVAL_METHODS_DEFAULT)
1606-fpermitted-flt-eval-methods=[c11|ts-18661] Specify which values of FLT_EVAL_METHOD are permitted.
1607
1608Enum
1609Name(permitted_flt_eval_methods) Type(enum permitted_flt_eval_methods) UnknownError(unknown specification for the set of FLT_EVAL_METHOD values to permit %qs)
1610
1611EnumValue
1612Enum(permitted_flt_eval_methods) String(c11) Value(PERMITTED_FLT_EVAL_METHODS_C11)
1613
1614EnumValue
1615Enum(permitted_flt_eval_methods) String(ts-18661-3) Value(PERMITTED_FLT_EVAL_METHODS_TS_18661)
1616
058de654 1617ffast-math
bfd67b47 1618Common Optimization
058de654 1619
cc8547a7 1620ffat-lto-objects
e9f67e62 1621Common Var(flag_fat_lto_objects)
cc8547a7
AK
1622Output lto objects containing both the intermediate language and binary output.
1623
6ff3a151 1624ffinite-math-only
eece52b5 1625Common Var(flag_finite_math_only) Optimization SetByCombined
a7b2e184 1626Assume no NaNs or infinities are generated.
6ff3a151 1627
c29c92c7 1628ffinite-loops
eece52b5 1629Common Var(flag_finite_loops) Optimization Init(0)
c29c92c7
FX
1630Assume that loops with an exit will terminate and not loop indefinitely.
1631
058de654 1632ffixed-
21bf1558 1633Common Joined RejectNegative Var(common_deferred_options) Defer
a7b2e184 1634-ffixed-<register> Mark <register> as being unavailable to the compiler.
058de654 1635
de32c0cb 1636ffloat-store
eece52b5 1637Common Var(flag_float_store) Optimization
a7b2e184 1638Don't allocate floats and doubles in extended-precision registers.
de32c0cb
NB
1639
1640fforce-addr
2d2bd949 1641Common Ignore
3de5e93a 1642Does nothing. Preserved for backward compatibility.
de32c0cb 1643
2ca2b607 1644fforward-propagate
eece52b5 1645Common Var(flag_forward_propagate) Optimization
a7b2e184 1646Perform a forward propagation pass on RTL.
a52b023a 1647
16949072 1648ffp-contract=
bea30e0d 1649Common Joined RejectNegative Enum(fp_contract_mode) Var(flag_fp_contract_mode) Init(FP_CONTRACT_FAST) Optimization
6a825afe 1650-ffp-contract=[off|on|fast] Perform floating-point expression contraction.
16949072 1651
e6d4b984
JM
1652Enum
1653Name(fp_contract_mode) Type(enum fp_contract_mode) UnknownError(unknown floating point contraction style %qs)
1654
1655EnumValue
1656Enum(fp_contract_mode) String(off) Value(FP_CONTRACT_OFF)
1657
1658; Not implemented, fall back to conservative FP_CONTRACT_OFF.
1659EnumValue
1660Enum(fp_contract_mode) String(on) Value(FP_CONTRACT_OFF)
1661
1662EnumValue
1663Enum(fp_contract_mode) String(fast) Value(FP_CONTRACT_FAST)
1664
0d2f700f 1665ffp-int-builtin-inexact
eece52b5 1666Common Var(flag_fp_int_builtin_inexact) Init(1) Optimization
0d2f700f
JM
1667Allow built-in functions ceil, floor, round, trunc to raise \"inexact\" exceptions.
1668
31b66477
KC
1669; Nonzero means don't put addresses of constant functions in registers.
1670; Used for compiling the Unix kernel, where strange substitutions are
1671; done on the assembly output.
de32c0cb 1672ffunction-cse
eece52b5 1673Common Var(flag_no_function_cse,0) Optimization
a7b2e184 1674Allow function addresses to be held in registers.
de32c0cb 1675
6ff3a151 1676ffunction-sections
eece52b5 1677Common Var(flag_function_sections)
a7b2e184 1678Place each function into its own section.
6ff3a151 1679
de32c0cb 1680fgcse
eece52b5 1681Common Var(flag_gcse) Optimization
a7b2e184 1682Perform global common subexpression elimination.
de32c0cb
NB
1683
1684fgcse-lm
eece52b5 1685Common Var(flag_gcse_lm) Init(1) Optimization
a7b2e184 1686Perform enhanced load motion during global common subexpression elimination.
de32c0cb
NB
1687
1688fgcse-sm
eece52b5 1689Common Var(flag_gcse_sm) Init(0) Optimization
a7b2e184 1690Perform store motion after global common subexpression elimination.
de32c0cb 1691
f5f2e3cd 1692fgcse-las
eece52b5 1693Common Var(flag_gcse_las) Init(0) Optimization
f9957958 1694Perform redundant load after store elimination in global common subexpression
a7b2e184 1695elimination.
f9957958
MH
1696
1697fgcse-after-reload
eece52b5 1698Common Var(flag_gcse_after_reload) Optimization
a7b2e184
MS
1699Perform global common subexpression elimination after register allocation has
1700finished.
f5f2e3cd 1701
6592d14b
PMR
1702Enum
1703Name(dwarf_gnat_encodings) Type(int)
1704
1705EnumValue
1706Enum(dwarf_gnat_encodings) String(all) Value(DWARF_GNAT_ENCODINGS_ALL)
1707
1708EnumValue
1709Enum(dwarf_gnat_encodings) String(gdb) Value(DWARF_GNAT_ENCODINGS_GDB)
1710
1711EnumValue
1712Enum(dwarf_gnat_encodings) String(minimal) Value(DWARF_GNAT_ENCODINGS_MINIMAL)
1713
1714fgnat-encodings=
eece52b5 1715Common Enum(dwarf_gnat_encodings) Joined RejectNegative Undocumented Var(gnat_encodings)
04e5c73d 1716-fgnat-encodings=[all|gdb|minimal] Select the balance between GNAT encodings and standard DWARF emitted in the debug information.
6592d14b 1717
d0a58904 1718; This option is not documented yet as its semantics will change.
f8bf9252 1719fgraphite
eece52b5 1720Common Var(flag_graphite) Optimization
a7b2e184 1721Enable in and out of Graphite representation.
f8bf9252 1722
204b560f 1723fgraphite-identity
eece52b5 1724Common Var(flag_graphite_identity) Optimization
a7b2e184 1725Enable Graphite Identity transformation.
204b560f 1726
372a6eb8 1727fhoist-adjacent-loads
eece52b5 1728Common Var(flag_hoist_adjacent_loads) Optimization
372a6eb8 1729Enable hoisting adjacent loads to encourage generating conditional move
a7b2e184 1730instructions.
372a6eb8 1731
1a218fc9 1732fkeep-gc-roots-live
eece52b5 1733Common Undocumented Var(flag_keep_gc_roots_live) Optimization
1a218fc9
ILT
1734; Always keep a pointer to a live memory block
1735
530b4409 1736flarge-source-files
eece52b5 1737Common Var(flag_large_source_files) Init(0)
530b4409 1738Improve GCC's ability to track column numbers in large source files,
1739at the expense of slower compilation.
1740
3cf0e270 1741floop-parallelize-all
eece52b5 1742Common Var(flag_loop_parallelize_all) Optimization
a7b2e184 1743Mark all loops as parallel.
204b560f 1744
f8bf9252 1745floop-strip-mine
d6bb5ccf 1746Common Alias(floop-nest-optimize)
a7b2e184 1747Enable loop nest transforms. Same as -floop-nest-optimize.
f8bf9252
SP
1748
1749floop-interchange
eece52b5 1750Common Var(flag_loop_interchange) Optimization
fbdec14e 1751Enable loop interchange on trees.
f8bf9252
SP
1752
1753floop-block
d6bb5ccf 1754Common Alias(floop-nest-optimize)
a7b2e184 1755Enable loop nest transforms. Same as -floop-nest-optimize.
f8bf9252 1756
20d3465b 1757floop-unroll-and-jam
eece52b5 1758Common Var(flag_unroll_jam) Optimization
dc236397 1759Perform unroll-and-jam on loops.
a7b2e184 1760
0a35513e 1761fgnu-tm
eece52b5 1762Common Var(flag_tm)
a7b2e184 1763Enable support for GNU transactional memory.
0a35513e 1764
da34ade5 1765fgnu-unique
eece52b5 1766Common Var(flag_gnu_unique) Init(1)
a7b2e184 1767Use STB_GNU_UNIQUE if supported by the assembler.
da34ade5 1768
98af4c9f 1769floop-flatten
093193be
MK
1770Common Ignore
1771Does nothing. Preserved for backward compatibility.
98af4c9f 1772
b60cc080 1773floop-nest-optimize
eece52b5 1774Common Var(flag_loop_nest_optimize) Optimization
e357a5e0 1775Enable the loop nest optimizer.
b60cc080 1776
6a78b724 1777fstrict-volatile-bitfields
eece52b5 1778Common Var(flag_strict_volatile_bitfields) Init(-1) Optimization
a7b2e184 1779Force bitfield accesses to match their type width.
6a78b724 1780
f663d9ad 1781fstore-merging
eece52b5 1782Common Var(flag_store_merging) Optimization
f663d9ad
KT
1783Merge adjacent stores.
1784
6ff3a151 1785fguess-branch-probability
eece52b5 1786Common Var(flag_guess_branch_prob) Optimization
a7b2e184 1787Enable guessing of branch probabilities.
6ff3a151 1788
95bb87b2
AO
1789fharden-compares
1790Common Var(flag_harden_compares) Optimization
1791Harden conditionals not used in branches, checking reversed conditions.
1792
1793fharden-conditional-branches
1794Common Var(flag_harden_conditional_branches) Optimization
1795Harden conditional branches by checking reversed conditions.
1796
31b66477
KC
1797; Nonzero means ignore `#ident' directives. 0 means handle them.
1798; Generate position-independent code for executables if possible
1799; On SVR4 targets, it also controls whether or not to emit a
1800; string identifying the compiler.
6ff3a151 1801fident
eece52b5 1802Common Var(flag_no_ident,0)
a7b2e184 1803Process #ident directives.
6ff3a151 1804
de32c0cb 1805fif-conversion
eece52b5 1806Common Var(flag_if_conversion) Optimization
a7b2e184 1807Perform conversion of conditional jumps to branchless equivalents.
de32c0cb
NB
1808
1809fif-conversion2
eece52b5 1810Common Var(flag_if_conversion2) Optimization
a7b2e184 1811Perform conversion of conditional jumps to conditional execution.
de32c0cb 1812
87e2a8fd 1813fstack-reuse=
082908e3 1814Common Joined RejectNegative Enum(stack_reuse_level) Var(flag_stack_reuse) Init(SR_ALL) Optimization
6a825afe 1815-fstack-reuse=[all|named_vars|none] Set stack reuse level for local variables.
87e2a8fd
XDL
1816
1817Enum
1818Name(stack_reuse_level) Type(enum stack_reuse_level) UnknownError(unknown Stack Reuse Level %qs)
1819
1820EnumValue
1821Enum(stack_reuse_level) String(all) Value(SR_ALL)
1822
1823EnumValue
1824Enum(stack_reuse_level) String(named_vars) Value(SR_NAMED_VARS)
1825
1826EnumValue
1827Enum(stack_reuse_level) String(none) Value(SR_NONE)
1828
384a5197 1829ftree-loop-if-convert
eece52b5 1830Common Var(flag_tree_loop_if_convert) Init(-1) Optimization
a7b2e184 1831Convert conditional jumps in innermost loops to branchless equivalents.
384a5197 1832
bd544141 1833ftree-loop-if-convert-stores
bef69eb5
RB
1834Common Ignore
1835Does nothing. Preserved for backward compatibility.
bd544141 1836
31b66477
KC
1837; -finhibit-size-directive inhibits output of .size for ELF.
1838; This is used only for compiling crtstuff.c,
1839; and it may be extended to other effects
1840; needed for crtstuff.c on other systems.
6ff3a151 1841finhibit-size-directive
eece52b5 1842Common Var(flag_inhibit_size_directive)
a7b2e184 1843Do not generate .size directives.
6ff3a151 1844
3e293154 1845findirect-inlining
eece52b5 1846Common Var(flag_indirect_inlining) Optimization
a7b2e184 1847Perform indirect inlining.
3e293154 1848
99ea07f8
RG
1849; General flag to enable inlining. Specifying -fno-inline will disable
1850; all inlining apart from always-inline functions.
de32c0cb 1851finline
eece52b5 1852Common Var(flag_no_inline,0) Init(0) Optimization
a7b2e184 1853Enable inlining of function declared \"inline\", disabling disables all inlining.
de32c0cb 1854
4d4b8cb9 1855finline-small-functions
eece52b5 1856Common Var(flag_inline_small_functions) Optimization
a7b2e184 1857Integrate functions into their callers when code size is known not to grow.
4d4b8cb9 1858
de32c0cb 1859finline-functions
eece52b5 1860Common Var(flag_inline_functions) Optimization
a7b2e184 1861Integrate functions not declared \"inline\" into their callers when profitable.
de32c0cb 1862
355866de 1863finline-functions-called-once
eece52b5 1864Common Var(flag_inline_functions_called_once) Optimization
a7b2e184 1865Integrate functions only required by their single caller.
d63db217 1866
d302c9d6 1867finline-limit-
5de8299c 1868Common RejectNegative Joined Alias(finline-limit=)
d302c9d6
NB
1869
1870finline-limit=
1871Common RejectNegative Joined UInteger
a7b2e184 1872-finline-limit=<number> Limit the size of inlined functions to <number>.
d302c9d6 1873
86951993 1874finline-atomics
eece52b5 1875Common Var(flag_inline_atomics) Init(1) Optimization
86951993
AM
1876Inline __atomic operations when a lock free instruction sequence is available.
1877
5c5f0b65
IT
1878fcf-protection
1879Common RejectNegative Alias(fcf-protection=,full)
1880
1881fcf-protection=
eece52b5 1882Common Joined RejectNegative Enum(cf_protection_level) Var(flag_cf_protection) Init(CF_NONE)
c4c22e83 1883-fcf-protection=[full|branch|return|none|check] Instrument functions with checks to verify jump/call/return control-flow transfer
5c5f0b65
IT
1884instructions have valid targets.
1885
1886Enum
cefc0906 1887Name(cf_protection_level) Type(enum cf_protection_level) UnknownError(unknown Control-Flow Protection Level %qs)
5c5f0b65
IT
1888
1889EnumValue
1890Enum(cf_protection_level) String(full) Value(CF_FULL)
1891
1892EnumValue
1893Enum(cf_protection_level) String(branch) Value(CF_BRANCH)
1894
1895EnumValue
1896Enum(cf_protection_level) String(return) Value(CF_RETURN)
1897
c4c22e83
L
1898EnumValue
1899Enum(cf_protection_level) String(check) Value(CF_CHECK)
1900
5c5f0b65
IT
1901EnumValue
1902Enum(cf_protection_level) String(none) Value(CF_NONE)
1903
6ff3a151 1904finstrument-functions
3b598848 1905Common Var(flag_instrument_function_entry_exit,1)
a7b2e184 1906Instrument function entry and exit with profiling calls.
6ff3a151 1907
3b598848
EB
1908finstrument-functions-once
1909Common Var(flag_instrument_function_entry_exit,2)
1910Instrument function entry and exit with profiling calls invoked once.
1911
8d5a7d1f
ILT
1912finstrument-functions-exclude-function-list=
1913Common RejectNegative Joined
b408e010 1914-finstrument-functions-exclude-function-list=name,... Do not instrument listed functions.
8d5a7d1f
ILT
1915
1916finstrument-functions-exclude-file-list=
1917Common RejectNegative Joined
b408e010 1918-finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files.
8d5a7d1f 1919
d6e14e8f 1920fipa-cp
eece52b5 1921Common Var(flag_ipa_cp) Optimization
a7b2e184 1922Perform interprocedural constant propagation.
d6e14e8f 1923
5e45130d 1924fipa-cp-clone
eece52b5 1925Common Var(flag_ipa_cp_clone) Optimization
a7b2e184 1926Perform cloning to make Interprocedural constant propagation stronger.
5e45130d 1927
3c99176a 1928fipa-cp-alignment
78117646
MJ
1929Common Ignore
1930Does nothing. Preserved for backward compatibility.
3c99176a 1931
209ca542 1932fipa-bit-cp
eece52b5 1933Common Var(flag_ipa_bit_cp) Optimization
209ca542
PK
1934Perform interprocedural bitwise constant propagation.
1935
d119f34c 1936fipa-modref
eece52b5 1937Common Var(flag_ipa_modref) Optimization
466b907f 1938Perform interprocedural modref analysis.
d119f34c 1939
e65bb9be 1940fipa-profile
eece52b5 1941Common Var(flag_ipa_profile) Init(0) Optimization
a7b2e184 1942Perform interprocedural profile propagation.
ea900239 1943
4cf4d6a3 1944fipa-pta
eece52b5 1945Common Var(flag_ipa_pta) Init(0) Optimization
a7b2e184 1946Perform interprocedural points-to analysis.
4cf4d6a3 1947
e65bb9be 1948fipa-pure-const
eece52b5 1949Common Var(flag_ipa_pure_const) Init(0) Optimization
a7b2e184 1950Discover pure and const functions.
e65bb9be 1951
b84d4347 1952fipa-icf
eece52b5 1953Common Var(flag_ipa_icf) Optimization
a7b2e184 1954Perform Identical Code Folding for functions and read-only variables.
b84d4347
ML
1955
1956fipa-icf-functions
eece52b5 1957Common Var(flag_ipa_icf_functions) Optimization
a7b2e184 1958Perform Identical Code Folding for functions.
b84d4347
ML
1959
1960fipa-icf-variables
eece52b5 1961Common Var(flag_ipa_icf_variables) Optimization
a7b2e184 1962Perform Identical Code Folding for variables.
b84d4347 1963
ea900239 1964fipa-reference
eece52b5 1965Common Var(flag_ipa_reference) Init(0) Optimization
2e14744f
ML
1966Discover read-only and non addressable static variables.
1967
1968fipa-reference-addressable
eece52b5 1969Common Var(flag_ipa_reference_addressable) Init(0) Optimization
2e14744f 1970Discover read-only, write-only and non-addressable static variables.
ea900239 1971
47b840eb 1972fipa-stack-alignment
eece52b5 1973Common Var(flag_ipa_stack_alignment) Init(1) Optimization
47b840eb
ML
1974Reduce stack alignment on call sites if possible.
1975
43d861a5 1976fipa-matrix-reorg
04f92ff4
RG
1977Common Ignore
1978Does nothing. Preserved for backward compatibility.
43d861a5 1979
e1dc98b2 1980fipa-struct-reorg
b8beb4d1
RG
1981Common Ignore
1982Does nothing. Preserved for backward compatibility.
e1dc98b2 1983
8bc5448f 1984fipa-vrp
eece52b5 1985Common Var(flag_ipa_vrp) Optimization
8bc5448f
KV
1986Perform IPA Value Range Propagation.
1987
058e97ec 1988fira-algorithm=
b16650ac 1989Common Joined RejectNegative Enum(ira_algorithm) Var(flag_ira_algorithm) Init(IRA_ALGORITHM_CB) Optimization
6a825afe 1990-fira-algorithm=[CB|priority] Set the used IRA algorithm.
7db7ed3c 1991
16c84809
JH
1992fipa-strict-aliasing
1993Common Var(flag_ipa_strict_aliasing) Init(1) Optimization
1994Assume strict aliasing rules apply across (uninlined) function boundaries.
1995
e6d4b984
JM
1996Enum
1997Name(ira_algorithm) Type(enum ira_algorithm) UnknownError(unknown IRA algorithm %qs)
1998
1999EnumValue
2000Enum(ira_algorithm) String(CB) Value(IRA_ALGORITHM_CB)
2001
2002EnumValue
2003Enum(ira_algorithm) String(priority) Value(IRA_ALGORITHM_PRIORITY)
2004
7db7ed3c 2005fira-region=
6b7a246d 2006Common Joined RejectNegative Enum(ira_region) Var(flag_ira_region) Init(IRA_REGION_ONE) Optimization
6a825afe 2007-fira-region=[one|all|mixed] Set regions for IRA.
058e97ec 2008
e6d4b984
JM
2009Enum
2010Name(ira_region) Type(enum ira_region) UnknownError(unknown IRA region %qs)
2011
2012EnumValue
2013Enum(ira_region) String(one) Value(IRA_REGION_ONE)
2014
2015EnumValue
2016Enum(ira_region) String(all) Value(IRA_REGION_ALL)
2017
2018EnumValue
2019Enum(ira_region) String(mixed) Value(IRA_REGION_MIXED)
2020
b11f0116 2021fira-hoist-pressure
eece52b5 2022Common Var(flag_ira_hoist_pressure) Init(1) Optimization
b11f0116
BC
2023Use IRA based register pressure calculation
2024in RTL hoist optimizations.
2025
1833192f 2026fira-loop-pressure
eece52b5 2027Common Var(flag_ira_loop_pressure) Optimization
1833192f
VM
2028Use IRA based register pressure calculation
2029in RTL loop optimizations.
2030
058e97ec 2031fira-share-save-slots
eece52b5 2032Common Var(flag_ira_share_save_slots) Init(1) Optimization
058e97ec
VM
2033Share slots for saving different hard registers.
2034
2035fira-share-spill-slots
eece52b5 2036Common Var(flag_ira_share_spill_slots) Init(1) Optimization
058e97ec
VM
2037Share stack slots for spilled pseudo-registers.
2038
2039fira-verbose=
5498f011 2040Common RejectNegative Joined UInteger Var(flag_ira_verbose) Init(5)
f94e1d66 2041-fira-verbose=<number> Control IRA's level of diagnostic messages.
058e97ec 2042
8b11a64c 2043fivopts
eece52b5 2044Common Var(flag_ivopts) Init(1) Optimization
a7b2e184 2045Optimize induction variables on trees.
8b11a64c 2046
82c0180d 2047fjump-tables
c662432e 2048Common Var(flag_jump_tables) Init(1) Optimization
a7b2e184 2049Use jump tables for sufficiently large switch statements.
82c0180d 2050
9b11203e
ML
2051fbit-tests
2052Common Var(flag_bit_tests) Init(1) Optimization
2053Use bit tests for sufficiently large switch statements.
2054
de32c0cb 2055fkeep-inline-functions
eece52b5 2056Common Var(flag_keep_inline_functions)
a7b2e184 2057Generate code for functions even if they are fully inlined.
de32c0cb 2058
787da5fd 2059fkeep-static-functions
eece52b5 2060Common Var(flag_keep_static_functions)
a7b2e184 2061Generate code for static functions even if they are never called.
787da5fd 2062
de32c0cb 2063fkeep-static-consts
eece52b5 2064Common Var(flag_keep_static_consts) Init(1)
a7b2e184 2065Emit static const variables even if they are not used.
de32c0cb 2066
6ff3a151 2067fleading-underscore
eece52b5 2068Common Var(flag_leading_underscore) Init(-1)
a7b2e184 2069Give external symbols a leading underscore.
6ff3a151 2070
efa1cdf0 2071floop-optimize
2d2bd949 2072Common Ignore
c0220ea4 2073Does nothing. Preserved for backward compatibility.
efa1cdf0 2074
d9cf932c 2075flra-remat
eece52b5 2076Common Var(flag_lra_remat) Optimization
a7b2e184 2077Do CFG-sensitive rematerialization in LRA.
d9cf932c 2078
d7f09764 2079flto
014d92e1 2080Common
d7f09764
DN
2081Enable link-time optimization.
2082
014d92e1
JH
2083flto=
2084Common RejectNegative Joined Var(flag_lto)
2085Link-time optimization with number of parallel jobs or jobserver.
2086
783dab6b
RB
2087Enum
2088Name(lto_partition_model) Type(enum lto_partition_model) UnknownError(unknown LTO partitioning model %qs)
852e4bd2 2089
783dab6b
RB
2090EnumValue
2091Enum(lto_partition_model) String(none) Value(LTO_PARTITION_NONE)
852e4bd2 2092
783dab6b
RB
2093EnumValue
2094Enum(lto_partition_model) String(one) Value(LTO_PARTITION_ONE)
2095
2096EnumValue
2097Enum(lto_partition_model) String(balanced) Value(LTO_PARTITION_BALANCED)
2098
2099EnumValue
2100Enum(lto_partition_model) String(1to1) Value(LTO_PARTITION_1TO1)
2101
2102EnumValue
2103Enum(lto_partition_model) String(max) Value(LTO_PARTITION_MAX)
c3c445e1 2104
783dab6b
RB
2105flto-partition=
2106Common Joined RejectNegative Enum(lto_partition_model) Var(flag_lto_partition) Init(LTO_PARTITION_BALANCED)
a7b2e184 2107Specify the algorithm to partition symbols and vars at linktime.
014d92e1 2108
d7f09764
DN
2109; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
2110flto-compression-level=
87741e51 2111Common Joined RejectNegative UInteger Var(flag_lto_compression_level) Init(-1) IntegerRange(0, 19)
65162572 2112Use zlib/zstd compression level <number> for IL.
d7f09764 2113
1ee85ee1 2114flto-odr-type-merging
686a56a8
JH
2115Common Ignore
2116Does nothing. Preserved for backward compatibility.
1ee85ee1 2117
d7f09764 2118flto-report
eece52b5 2119Common Var(flag_lto_report) Init(0)
a7b2e184 2120Report various link-time optimization statistics.
d7f09764 2121
057f8f20 2122flto-report-wpa
eece52b5 2123Common Var(flag_lto_report_wpa) Init(0)
a7b2e184 2124Report various link-time optimization statistics for WPA only.
057f8f20 2125
6ff3a151 2126fmath-errno
eece52b5 2127Common Var(flag_errno_math) Init(1) Optimization SetByCombined
a7b2e184 2128Set errno after built-in math functions.
6ff3a151 2129
3a789837
NF
2130fmax-errors=
2131Common Joined RejectNegative UInteger Var(flag_max_errors)
a7b2e184 2132-fmax-errors=<number> Maximum number of errors to report.
3a789837 2133
6ff3a151 2134fmem-report
eece52b5 2135Common Var(mem_report)
a7b2e184 2136Report on permanent memory allocation.
6ff3a151 2137
b3e44629 2138fmem-report-wpa
eece52b5 2139Common Var(mem_report_wpa)
a7b2e184 2140Report on permanent memory allocation in WPA only.
b3e44629 2141
31b66477
KC
2142; This will attempt to merge constant section constants, if 1 only
2143; string constants and constants from constant pool, if 2 also constant
2144; variables.
6ff3a151 2145fmerge-all-constants
eece52b5 2146Common Var(flag_merge_constants,2) Init(1)
a7b2e184 2147Attempt to merge identical constants and constant variables.
6ff3a151
NB
2148
2149fmerge-constants
eece52b5 2150Common Var(flag_merge_constants,1)
a7b2e184 2151Attempt to merge identical constants across compilation units.
6ff3a151 2152
28a08168 2153fmerge-debug-strings
eece52b5 2154Common Var(flag_merge_debug_strings) Init(1)
a7b2e184 2155Attempt to merge identical debug strings across compilation units.
28a08168 2156
de32c0cb
NB
2157fmessage-length=
2158Common RejectNegative Joined UInteger
a7b2e184 2159-fmessage-length=<number> Limit diagnostics to <number> characters per line. 0 suppresses line-wrapping.
de32c0cb 2160
e5626198 2161fmodulo-sched
eece52b5 2162Common Var(flag_modulo_sched) Optimization
a7b2e184 2163Perform SMS based modulo scheduling before the first scheduling pass.
e5626198 2164
517d76fa 2165fmodulo-sched-allow-regmoves
eece52b5 2166Common Var(flag_modulo_sched_allow_regmoves) Optimization
a7b2e184 2167Perform SMS based modulo scheduling with register moves allowed.
517d76fa 2168
5e962776 2169fmove-loop-invariants
eece52b5 2170Common Var(flag_move_loop_invariants) Optimization
a7b2e184 2171Move loop invariant computations out of loops.
5e962776 2172
9f489a57
RB
2173fmove-loop-stores
2174Common Var(flag_move_loop_stores) Optimization
2175Move stores out of loops.
2176
6b1a2474
AO
2177fmultiflags
2178Common Driver
2179Building block for specs-based multilib-aware TFLAGS.
2180
6fb5fa3c 2181fdce
6ae4be32 2182Common Var(flag_dce) Init(1) Optimization
a7b2e184 2183Use the RTL dead code elimination pass.
6fb5fa3c
DB
2184
2185fdse
c0fe6bce 2186Common Var(flag_dse) Init(0) Optimization
a7b2e184 2187Use the RTL dead store elimination pass.
6fb5fa3c 2188
d72372e4 2189freschedule-modulo-scheduled-loops
eece52b5 2190Common Var(flag_resched_modulo_sched) Optimization
a7b2e184 2191Enable/Disable the traditional scheduling in loops that already passed modulo scheduling.
d72372e4 2192
6ff3a151 2193fnon-call-exceptions
eece52b5 2194Common Var(flag_non_call_exceptions) Optimization
a7b2e184 2195Support synchronous non-call exceptions.
6ff3a151 2196
c713ddc0 2197foffload=
33c4e466 2198Driver Joined MissingArgError(targets missing after %qs)
33c4e466
TB
2199
2200foffload-options=
2201Common Driver Joined MissingArgError(options or targets=options missing after %qs)
a3ce7d75 2202-foffload-options=<targets>=<options> Specify options for the offloading targets.
c713ddc0
BS
2203
2204foffload-abi=
2a700fb8 2205Common Joined RejectNegative Enum(offload_abi)
b408e010 2206-foffload-abi=[lp64|ilp32] Set the ABI to use in an offload compiler.
c713ddc0
BS
2207
2208Enum
2209Name(offload_abi) Type(enum offload_abi) UnknownError(unknown offload ABI %qs)
2210
2211EnumValue
2212Enum(offload_abi) String(ilp32) Value(OFFLOAD_ABI_ILP32)
2213
2214EnumValue
2215Enum(offload_abi) String(lp64) Value(OFFLOAD_ABI_LP64)
2216
de32c0cb 2217fomit-frame-pointer
eece52b5 2218Common Var(flag_omit_frame_pointer) Optimization
a7b2e184 2219When possible do not generate stack frames.
de32c0cb 2220
78c60e3d 2221fopt-info
eece52b5 2222Common Var(flag_opt_info) Optimization
a7b2e184 2223Enable all optimization info dumps on stderr.
78c60e3d
SS
2224
2225fopt-info-
2226Common Joined RejectNegative Var(common_deferred_options) Defer
a7b2e184 2227-fopt-info[-<type>=filename] Dump compiler optimization details.
78c60e3d 2228
4a4412b9 2229fsave-optimization-record
eece52b5 2230Common Var(flag_save_optimization_record) Optimization
4a4412b9
DM
2231Write a SRCFILE.opt-record.json file detailing what optimizations were performed.
2232
6ff3a151 2233foptimize-register-move
3b6d1699
VM
2234Common Ignore
2235Does nothing. Preserved for backward compatibility.
6ff3a151 2236
de32c0cb 2237foptimize-sibling-calls
eece52b5 2238Common Var(flag_optimize_sibling_calls) Optimization
a7b2e184 2239Optimize sibling and tail recursive calls.
de32c0cb 2240
3e485f62 2241fpartial-inlining
eece52b5 2242Common Var(flag_partial_inlining) Optimization
a7b2e184 2243Perform partial inlining.
3e485f62 2244
a5573239 2245fpre-ipa-mem-report
eece52b5 2246Common Var(pre_ipa_mem_report)
a7b2e184 2247Report on memory allocation before interprocedural optimization.
a5573239
JH
2248
2249fpost-ipa-mem-report
eece52b5 2250Common Var(post_ipa_mem_report)
a7b2e184 2251Report on memory allocation before interprocedural optimization.
a5573239 2252
6ff3a151 2253fpack-struct
eece52b5 2254Common Var(flag_pack_struct) Optimization
a7b2e184 2255Pack structure members together without holes.
6ff3a151 2256
467cecf3 2257fpack-struct=
c662432e 2258Common RejectNegative Joined UInteger Optimization
a7b2e184 2259-fpack-struct=<number> Set initial maximum structure member alignment.
467cecf3 2260
de32c0cb 2261fpcc-struct-return
eece52b5 2262Common Var(flag_pcc_struct_return,1) Init(DEFAULT_PCC_STRUCT_RETURN)
a7b2e184 2263Return small aggregates in memory, not registers.
de32c0cb
NB
2264
2265fpeel-loops
eece52b5 2266Common Var(flag_peel_loops) Optimization
a7b2e184 2267Perform loop peeling.
de32c0cb
NB
2268
2269fpeephole
eece52b5 2270Common Var(flag_no_peephole,0) Optimization
a7b2e184 2271Enable machine specific peephole optimizations.
de32c0cb 2272
6ff3a151 2273fpeephole2
eece52b5 2274Common Var(flag_peephole2) Optimization
a7b2e184 2275Enable an RTL peephole pass before sched2.
6ff3a151 2276
31b66477 2277fPIC
eece52b5 2278Common Var(flag_pic,2) Negative(fPIE) Init(-1)
a7b2e184 2279Generate position-independent code if possible (large mode).
31b66477
KC
2280
2281fPIE
eece52b5 2282Common Var(flag_pie,2) Negative(fpic) Init(-1)
a7b2e184 2283Generate position-independent code for executables if possible (large mode).
31b66477 2284
6ff3a151 2285fpic
eece52b5 2286Common Var(flag_pic,1) Negative(fpie) Init(-1)
a7b2e184 2287Generate position-independent code if possible (small mode).
6ff3a151
NB
2288
2289fpie
eece52b5 2290Common Var(flag_pie,1) Negative(fPIC) Init(-1)
a7b2e184 2291Generate position-independent code for executables if possible (small mode).
6ff3a151 2292
b91fd3c7 2293fplt
eece52b5 2294Common Var(flag_plt) Init(1) Optimization
a7b2e184 2295Use PLT for PIC calls (-fno-plt: load the address from GOT at call site).
b91fd3c7 2296
68a607d8 2297fplugin=
21bf1558 2298Common Joined RejectNegative Var(common_deferred_options) Defer
a7b2e184 2299Specify a plugin to load.
68a607d8
DN
2300
2301fplugin-arg-
21bf1558 2302Common Joined RejectNegative Var(common_deferred_options) Defer
a7b2e184 2303-fplugin-arg-<name>-<key>[=<value>] Specify argument <key>=<value> for plugin <name>.
68a607d8 2304
bbc8a8dc 2305fpredictive-commoning
eece52b5 2306Common Var(flag_predictive_commoning) Optimization
bbc8a8dc
ZD
2307Run predictive commoning optimization.
2308
de32c0cb 2309fprefetch-loop-arrays
eece52b5 2310Common Var(flag_prefetch_loop_arrays) Init(-1) Optimization
a7b2e184 2311Generate prefetch instructions, if available, for arrays in loops.
de32c0cb 2312
6ff3a151 2313fprofile
eece52b5 2314Common Var(profile_flag)
a7b2e184 2315Enable basic program profiling code.
6ff3a151 2316
676519f7 2317fprofile-abs-path
eece52b5 2318Common Var(profile_abs_path_flag)
676519f7
BE
2319Generate absolute source path names for gcov.
2320
6ff3a151 2321fprofile-arcs
eece52b5 2322Common Var(profile_arc_flag)
a7b2e184 2323Insert arc-based program profiling code.
6ff3a151 2324
2f908293 2325fprofile-dir=
0576d21f 2326Common Joined RejectNegative Var(profile_data_prefix)
2f908293
SP
2327Set the top-level directory for storing the profile data.
2328The default is 'pwd'.
2329
8e37c995
ML
2330fprofile-note=
2331Common Joined RejectNegative Var(profile_note_location)
2332Select the name for storing the profile note file.
2333
52c76998 2334fprofile-correction
eece52b5 2335Common Var(flag_profile_correction)
a7b2e184 2336Enable correction of flow inconsistent profile data input.
52c76998 2337
22063dbc
ML
2338fprofile-update=
2339Common Joined RejectNegative Enum(profile_update) Var(flag_profile_update) Init(PROFILE_UPDATE_SINGLE)
4d209853 2340-fprofile-update=[single|atomic|prefer-atomic] Set the profile update method.
22063dbc 2341
e18240ff
ML
2342fprofile-filter-files=
2343Common Joined RejectNegative Var(flag_profile_filter_files)
8ca43e4e 2344Instrument only functions from files whose name matches any of the regular expressions (separated by semi-colons).
e18240ff
ML
2345
2346fprofile-exclude-files=
2347Common Joined RejectNegative Var(flag_profile_exclude_files)
8ca43e4e 2348Instrument only functions from files whose name does not match any of the regular expressions (separated by semi-colons).
e18240ff 2349
ea0b1252
ML
2350Enum
2351Name(profile_reproducibility) Type(enum profile_reproducibility) UnknownError(unknown profile reproducibility method %qs)
2352
2353EnumValue
2354Enum(profile_reproducibility) String(serial) Value(PROFILE_REPRODUCIBILITY_SERIAL)
2355
2356EnumValue
2357Enum(profile_reproducibility) String(parallel-runs) Value(PROFILE_REPRODUCIBILITY_PARALLEL_RUNS)
2358
2359EnumValue
2360Enum(profile_reproducibility) String(multithreaded) Value(PROFILE_REPRODUCIBILITY_MULTITHREADED)
2361
5089df53 2362fprofile-reproducible=
ea0b1252 2363Common Joined RejectNegative Var(flag_profile_reproducible) Enum(profile_reproducibility) Init(PROFILE_REPRODUCIBILITY_SERIAL)
b408e010 2364-fprofile-reproducible=[serial|parallel-runs|multithreaded] Control level of reproducibility of profile gathered by -fprofile-generate.
ea0b1252 2365
22063dbc
ML
2366Enum
2367Name(profile_update) Type(enum profile_update) UnknownError(unknown profile update method %qs)
2368
2369EnumValue
2370Enum(profile_update) String(single) Value(PROFILE_UPDATE_SINGLE)
2371
2372EnumValue
2373Enum(profile_update) String(atomic) Value(PROFILE_UPDATE_ATOMIC)
2374
4d209853
ML
2375EnumValue
2376Enum(profile_update) String(prefer-atomic) Value(PROFILE_UPDATE_PREFER_ATOMIC)
2377
44b32683
JH
2378fprofile-prefix-path=
2379Common Joined RejectNegative Var(profile_prefix_path)
850322df 2380Remove prefix from absolute path before mangling name for -fprofile-generate= and -fprofile-use=.
44b32683 2381
cde87638
ML
2382fprofile-prefix-map=
2383Common Joined RejectNegative Var(common_deferred_options) Defer
2384-fprofile-prefix-map=<old>=<new> Map one directory name to another in GCOV coverage result.
2385
a8a5f53a
JH
2386fprofile-generate
2387Common
a7b2e184 2388Enable common options for generating profile info for profile feedback directed optimizations.
a8a5f53a 2389
2f908293
SP
2390fprofile-generate=
2391Common Joined RejectNegative
a7b2e184 2392Enable common options for generating profile info for profile feedback directed optimizations, and set -fprofile-dir=.
2f908293 2393
27f7fb79
SH
2394fprofile-info-section
2395Common RejectNegative
2396Register the profile information in the .gcov_info section instead of using a constructor/destructor.
2397
2398fprofile-info-section=
2399Common Joined RejectNegative Var(profile_info_section)
2400Register the profile information in the specified section instead of using a constructor/destructor.
2401
34fbe3f0 2402fprofile-partial-training
eece52b5 2403Common Var(flag_profile_partial_training) Optimization
c86b722b 2404Do not assume that functions never executed during the train run are cold.
34fbe3f0 2405
a8a5f53a 2406fprofile-use
2f908293 2407Common Var(flag_profile_use)
a7b2e184 2408Enable common options for performing profile feedback directed optimizations.
a8a5f53a 2409
2f908293
SP
2410fprofile-use=
2411Common Joined RejectNegative
a7b2e184 2412Enable common options for performing profile feedback directed optimizations, and set -fprofile-dir=.
2f908293 2413
fca9dc00 2414fprofile-values
eece52b5 2415Common Var(flag_profile_values)
a7b2e184 2416Insert code to profile values of expressions.
fca9dc00 2417
37e5402b 2418fprofile-report
eece52b5 2419Common Var(profile_report)
a7b2e184 2420Report on consistency of profile.
37e5402b 2421
9cec31f4 2422fprofile-reorder-functions
eece52b5 2423Common Var(flag_profile_reorder_functions) Optimization
a7b2e184 2424Enable function reordering that improves code placement.
9cec31f4 2425
417ca011 2426fpatchable-function-entry=
0d701e3e 2427Common Var(flag_patchable_function_entry) Joined Optimization
417ca011
TD
2428Insert NOP instructions at each function entry.
2429
de32c0cb 2430frandom-seed
299404a1 2431Common Var(common_deferred_options) Defer
de32c0cb
NB
2432
2433frandom-seed=
299404a1 2434Common Joined RejectNegative Var(common_deferred_options) Defer
4bfede85 2435-frandom-seed=<string> Make compile reproducible using <string>.
de32c0cb 2436
e0d9d0dd
NC
2437; This switch causes the command line that was used to create an
2438; object file to be recorded into the object file. The exact format
2439; of this recording is target and binary file format dependent.
2440; It is related to the -fverbose-asm switch, but that switch only
2441; records information in the assembler output file as comments, so
2442; they never reach the object file.
2443frecord-gcc-switches
eece52b5 2444Common Var(flag_record_gcc_switches)
e0d9d0dd
NC
2445Record gcc command line switches in the object file.
2446
de32c0cb 2447freg-struct-return
eece52b5 2448Common Var(flag_pcc_struct_return,0) Optimization
a7b2e184 2449Return small aggregates in registers.
de32c0cb 2450
6ff3a151 2451fregmove
3b6d1699
VM
2452Common Ignore
2453Does nothing. Preserved for backward compatibility.
6ff3a151 2454
f522930c 2455flifetime-dse
eece52b5 2456Common Var(flag_lifetime_dse,2) Init(2) Optimization
f522930c
JM
2457Tell DSE that the storage for a C++ object is dead when the constructor
2458starts and when the destructor finishes.
2459
a021961c 2460flifetime-dse=
63010089 2461Common Joined RejectNegative UInteger Var(flag_lifetime_dse) Optimization IntegerRange(0, 2)
a021961c 2462
6fd6a2ff
QZ
2463flive-patching
2464Common RejectNegative Alias(flive-patching=,inline-clone) Optimization
2465
2466flive-patching=
eece52b5 2467Common Joined RejectNegative Enum(live_patching_level) Var(flag_live_patching) Init(LIVE_PATCHING_NONE) Optimization
6fd6a2ff
QZ
2468-flive-patching=[inline-only-static|inline-clone] Control IPA
2469optimizations to provide a safe compilation for live-patching. At the same
2470time, provides multiple-level control on the enabled IPA optimizations.
2471
2472Enum
2473Name(live_patching_level) Type(enum live_patching_level) UnknownError(unknown Live-Patching Level %qs)
2474
2475EnumValue
2476Enum(live_patching_level) String(inline-only-static) Value(LIVE_PATCHING_INLINE_ONLY_STATIC)
2477
2478EnumValue
2479Enum(live_patching_level) String(inline-clone) Value(LIVE_PATCHING_INLINE_CLONE)
2480
6343b6bf 2481fallocation-dce
eece52b5 2482Common Var(flag_allocation_dce) Init(1) Optimization
6343b6bf
ML
2483Tell DCE to remove unused C++ allocations.
2484
f20f2613 2485flive-range-shrinkage
eece52b5 2486Common Var(flag_live_range_shrinkage) Init(0) Optimization
a7b2e184 2487Relief of register pressure through live range shrinkage.
f20f2613 2488
6ff3a151 2489frename-registers
e415bc4c 2490Common Var(flag_rename_registers) Optimization EnabledBy(funroll-loops)
a7b2e184 2491Perform a register renaming optimization pass.
6ff3a151 2492
b16abbcb 2493fschedule-fusion
eece52b5 2494Common Var(flag_schedule_fusion) Init(2) Optimization
a7b2e184 2495Perform a target dependent instruction fusion optimization pass.
b16abbcb 2496
6ff3a151 2497freorder-blocks
eece52b5 2498Common Var(flag_reorder_blocks) Optimization
a7b2e184 2499Reorder basic blocks to improve code placement.
6ff3a151 2500
59faab7c
SB
2501freorder-blocks-algorithm=
2502Common Joined RejectNegative Enum(reorder_blocks_algorithm) Var(flag_reorder_blocks_algorithm) Init(REORDER_BLOCKS_ALGORITHM_SIMPLE) Optimization
6a825afe 2503-freorder-blocks-algorithm=[simple|stc] Set the used basic block reordering algorithm.
59faab7c
SB
2504
2505Enum
2506Name(reorder_blocks_algorithm) Type(enum reorder_blocks_algorithm) UnknownError(unknown basic block reordering algorithm %qs)
2507
2508EnumValue
2509Enum(reorder_blocks_algorithm) String(simple) Value(REORDER_BLOCKS_ALGORITHM_SIMPLE)
2510
2511EnumValue
2512Enum(reorder_blocks_algorithm) String(stc) Value(REORDER_BLOCKS_ALGORITHM_STC)
2513
750054a2 2514freorder-blocks-and-partition
eece52b5 2515Common Var(flag_reorder_blocks_and_partition) Optimization
a7b2e184 2516Reorder basic blocks and partition into hot and cold sections.
750054a2 2517
6ff3a151 2518freorder-functions
eece52b5 2519Common Var(flag_reorder_functions) Optimization
a7b2e184 2520Reorder functions to improve code placement.
6ff3a151 2521
de32c0cb 2522frerun-cse-after-loop
eece52b5 2523Common Var(flag_rerun_cse_after_loop) Optimization
a7b2e184 2524Add a common subexpression elimination pass after loop optimizations.
de32c0cb 2525
efa1cdf0 2526frerun-loop-opt
2d2bd949 2527Common Ignore
c0220ea4 2528Does nothing. Preserved for backward compatibility.
efa1cdf0 2529
039c3d42 2530frounding-math
eece52b5 2531Common Var(flag_rounding_math) Optimization SetByCombined
a7b2e184 2532Disable optimizations that assume default FP rounding behavior.
039c3d42 2533
6ff3a151 2534fsched-interblock
eece52b5 2535Common Var(flag_schedule_interblock) Init(1) Optimization
a7b2e184 2536Enable scheduling across basic blocks.
6ff3a151 2537
ce18efcb 2538fsched-pressure
eece52b5 2539Common Var(flag_sched_pressure) Init(0) Optimization
a7b2e184 2540Enable register pressure sensitive insn scheduling.
ce18efcb 2541
6ff3a151 2542fsched-spec
eece52b5 2543Common Var(flag_schedule_speculative) Init(1) Optimization
a7b2e184 2544Allow speculative motion of non-loads.
6ff3a151
NB
2545
2546fsched-spec-load
eece52b5 2547Common Var(flag_schedule_speculative_load) Optimization
a7b2e184 2548Allow speculative motion of some loads.
6ff3a151
NB
2549
2550fsched-spec-load-dangerous
eece52b5 2551Common Var(flag_schedule_speculative_load_dangerous) Optimization
a7b2e184 2552Allow speculative motion of more loads.
6ff3a151 2553
de32c0cb 2554fsched-verbose=
4111f1c9 2555Common RejectNegative Joined UInteger Var(sched_verbose_param) Init(1)
a7b2e184 2556-fsched-verbose=<number> Set the verbosity level of the scheduler.
de32c0cb 2557
6ff3a151 2558fsched2-use-superblocks
eece52b5 2559Common Var(flag_sched2_use_superblocks) Optimization
a7b2e184 2560If scheduling post reload, do superblock scheduling.
6ff3a151
NB
2561
2562fsched2-use-traces
2d2bd949 2563Common Ignore
57257f0d 2564Does nothing. Preserved for backward compatibility.
6ff3a151 2565
de32c0cb 2566fschedule-insns
eece52b5 2567Common Var(flag_schedule_insns) Optimization
a7b2e184 2568Reschedule instructions before register allocation.
de32c0cb
NB
2569
2570fschedule-insns2
eece52b5 2571Common Var(flag_schedule_insns_after_reload) Optimization
a7b2e184 2572Reschedule instructions after register allocation.
de32c0cb 2573
e855c69d
AB
2574; This flag should be on when a target implements non-trivial
2575; scheduling hooks, maybe saving some information for its own sake.
a7b2e184 2576; On IA64, for example, this is used for correct bundling.
e855c69d 2577fselective-scheduling
eece52b5 2578Common Var(flag_selective_scheduling) Optimization
a7b2e184 2579Schedule instructions using selective scheduling algorithm.
e855c69d
AB
2580
2581fselective-scheduling2
eece52b5 2582Common Var(flag_selective_scheduling2) Optimization
a7b2e184 2583Run selective scheduling after reload.
e855c69d 2584
ecfc21ff
DM
2585fself-test=
2586Common Undocumented Joined Var(flag_self_test)
2587Run self-tests, using the given path to locate test files.
d9b950dd 2588
e855c69d 2589fsel-sched-pipelining
eece52b5 2590Common Var(flag_sel_sched_pipelining) Init(0) Optimization
a7b2e184 2591Perform software pipelining of inner loops during selective scheduling.
e855c69d
AB
2592
2593fsel-sched-pipelining-outer-loops
eece52b5 2594Common Var(flag_sel_sched_pipelining_outer_loops) Init(0) Optimization
a7b2e184 2595Perform software pipelining of outer loops during selective scheduling.
e855c69d
AB
2596
2597fsel-sched-reschedule-pipelined
eece52b5 2598Common Var(flag_sel_sched_reschedule_pipelined) Init(0) Optimization
a7b2e184 2599Reschedule pipelined regions without pipelining.
e855c69d 2600
e288a46c 2601fsemantic-interposition
75ac95f6 2602Common Var(flag_semantic_interposition) Init(1) Optimization
a7b2e184 2603Allow interposing function (or variables) by ones with different semantics (or initializer) respectively by dynamic linker.
e288a46c 2604
31b66477
KC
2605; sched_stalled_insns means that insns can be moved prematurely from the queue
2606; of stalled insns into the ready list.
569fa502 2607fsched-stalled-insns
eece52b5 2608Common Var(flag_sched_stalled_insns) Optimization UInteger
a7b2e184 2609Allow premature scheduling of queued insns.
569fa502
DN
2610
2611fsched-stalled-insns=
b16650ac 2612Common RejectNegative Joined UInteger Optimization
a7b2e184 2613-fsched-stalled-insns=<number> Set number of queued insns that can be prematurely scheduled.
569fa502 2614
31b66477
KC
2615; sched_stalled_insns_dep controls how many recently scheduled cycles will
2616; be examined for a dependency on a stalled insn that is candidate for
2617; premature removal from the queue of stalled insns into the ready list (has
2618; an effect only if the flag 'sched_stalled_insns' is set).
569fa502 2619fsched-stalled-insns-dep
eece52b5 2620Common Var(flag_sched_stalled_insns_dep,1) Init(1) Optimization UInteger
a7b2e184 2621Set dependence distance checking in premature scheduling of queued insns.
569fa502
DN
2622
2623fsched-stalled-insns-dep=
b16650ac 2624Common RejectNegative Joined UInteger Optimization
a7b2e184 2625-fsched-stalled-insns-dep=<number> Set dependence distance checking in premature scheduling of queued insns.
569fa502 2626
ee4764a8 2627fsched-group-heuristic
eece52b5 2628Common Var(flag_sched_group_heuristic) Init(1) Optimization
a7b2e184 2629Enable the group heuristic in the scheduler.
ee4764a8
GS
2630
2631fsched-critical-path-heuristic
eece52b5 2632Common Var(flag_sched_critical_path_heuristic) Init(1) Optimization
a7b2e184 2633Enable the critical path heuristic in the scheduler.
ee4764a8
GS
2634
2635fsched-spec-insn-heuristic
eece52b5 2636Common Var(flag_sched_spec_insn_heuristic) Init(1) Optimization
a7b2e184 2637Enable the speculative instruction heuristic in the scheduler.
ee4764a8 2638
ee4764a8 2639fsched-rank-heuristic
eece52b5 2640Common Var(flag_sched_rank_heuristic) Init(1) Optimization
a7b2e184 2641Enable the rank heuristic in the scheduler.
ee4764a8
GS
2642
2643fsched-last-insn-heuristic
eece52b5 2644Common Var(flag_sched_last_insn_heuristic) Init(1) Optimization
a7b2e184 2645Enable the last instruction heuristic in the scheduler.
ee4764a8
GS
2646
2647fsched-dep-count-heuristic
eece52b5 2648Common Var(flag_sched_dep_count_heuristic) Init(1) Optimization
a7b2e184 2649Enable the dependent count heuristic in the scheduler.
ee4764a8 2650
aacd3885 2651fsection-anchors
eece52b5 2652Common Var(flag_section_anchors) Optimization
a7b2e184 2653Access data in the same section from shared anchor points.
aacd3885 2654
8cd37d0b 2655fsee
2d2bd949 2656Common Ignore
8393a9c8 2657Does nothing. Preserved for backward compatibility.
8cd37d0b 2658
87a0ebfd 2659fzee
26cd9add
EI
2660Common Ignore
2661Does nothing. Preserved for backward compatibility.
2662
2663free
eece52b5 2664Common Var(flag_ree) Init(0) Optimization
26cd9add 2665Turn on Redundant Extensions Elimination pass.
87a0ebfd 2666
8abb6b22 2667fshow-column
eece52b5 2668Common Var(flag_show_column) Init(1)
a7b2e184 2669Show column numbers in diagnostics, when available. Default on.
8abb6b22 2670
484db665 2671fshrink-wrap
eece52b5 2672Common Var(flag_shrink_wrap) Optimization
484db665
BS
2673Emit function prologues only before parts of the function that need it,
2674rather than at the top of the function.
2675
20a6ece0 2676fshrink-wrap-separate
eece52b5 2677Common Var(flag_shrink_wrap_separate) Init(1) Optimization
20a6ece0
SB
2678Shrink-wrap parts of the prologue and epilogue separately.
2679
6ff3a151 2680fsignaling-nans
eece52b5 2681Common Var(flag_signaling_nans) Optimization SetByCombined
a7b2e184 2682Disable optimizations observable by IEEE signaling NaNs.
6ff3a151 2683
db02da79 2684fsigned-zeros
eece52b5 2685Common Var(flag_signed_zeros) Init(1) Optimization SetByCombined
a7b2e184 2686Disable floating point optimizations that ignore the IEEE signedness of zero.
db02da79 2687
6ff3a151 2688fsingle-precision-constant
eece52b5 2689Common Var(flag_single_precision_constant) Optimization
a7b2e184 2690Convert floating point constants to single precision constants.
6ff3a151 2691
113d659a 2692fsplit-ivs-in-unroller
eece52b5 2693Common Var(flag_split_ivs_in_unroller) Init(1) Optimization
a7b2e184 2694Split lifetimes of induction variables when loops are unrolled.
113d659a 2695
7458026b 2696fsplit-stack
eece52b5 2697Common Var(flag_split_stack) Init(-1)
a7b2e184 2698Generate discontiguous stack frames.
7458026b 2699
e53a16e7 2700fsplit-wide-types
eece52b5 2701Common Var(flag_split_wide_types) Optimization
a7b2e184 2702Split wide types into independent registers.
e53a16e7 2703
b18081df 2704fsplit-wide-types-early
eece52b5 2705Common Var(flag_split_wide_types_early) Optimization
b18081df
SB
2706Split wide types into independent registers earlier.
2707
6a75d560 2708fssa-backprop
eece52b5 2709Common Var(flag_ssa_backprop) Init(1) Optimization
6a75d560
RS
2710Enable backward propagation of use properties at the SSA level.
2711
68f6df73 2712fssa-phiopt
eece52b5 2713Common Var(flag_ssa_phiopt) Optimization
a7b2e184 2714Optimize conditional patterns using SSA PHI nodes.
68f6df73 2715
98ce9490 2716fstdarg-opt
eece52b5 2717Common Var(flag_stdarg_opt) Init(1) Optimization
a7b2e184 2718Optimize amount of stdarg registers saved to stack at start of function.
98ce9490 2719
f37a4f14 2720fvariable-expansion-in-unroller
eece52b5 2721Common Var(flag_variable_expansion_in_unroller) Optimization
a7b2e184 2722Apply variable expansion when loops are unrolled.
f37a4f14 2723
b38f3813 2724fstack-check=
eece52b5 2725Common RejectNegative Joined Optimization
a7b2e184 2726-fstack-check=[no|generic|specific] Insert stack checking code into the program.
b38f3813 2727
6ff3a151 2728fstack-check
5de8299c 2729Common Alias(fstack-check=, specific, no)
a7b2e184 2730Insert stack checking code into the program. Same as -fstack-check=specific.
6ff3a151 2731
ee8f15c6 2732fstack-clash-protection
eece52b5 2733Common Var(flag_stack_clash_protection) Optimization
ee8f15c6
JL
2734Insert code to probe each page of stack space as it is allocated to protect
2735from stack-clash style attacks.
2736
de32c0cb 2737fstack-limit
21bf1558 2738Common Var(common_deferred_options) Defer
de32c0cb 2739
058de654 2740fstack-limit-register=
21bf1558 2741Common RejectNegative Joined Var(common_deferred_options) Defer
a7b2e184 2742-fstack-limit-register=<register> Trap if the stack goes past <register>.
058de654
NB
2743
2744fstack-limit-symbol=
21bf1558 2745Common RejectNegative Joined Var(common_deferred_options) Defer
a7b2e184 2746-fstack-limit-symbol=<name> Trap if the stack goes past symbol <name>.
058de654 2747
7d69de61 2748fstack-protector
eece52b5 2749Common Var(flag_stack_protect, 1) Init(-1) Optimization
a7b2e184 2750Use propolice as a stack protection method.
7d69de61
RH
2751
2752fstack-protector-all
eece52b5 2753Common RejectNegative Var(flag_stack_protect, 2) Init(-1) Optimization
a7b2e184 2754Use a stack protection method for every function.
7d69de61 2755
f6bc1c4a 2756fstack-protector-strong
eece52b5 2757Common RejectNegative Var(flag_stack_protect, 3) Init(-1) Optimization
a7b2e184 2758Use a smart stack protection method for certain functions.
f6bc1c4a 2759
5434dc07 2760fstack-protector-explicit
eece52b5 2761Common RejectNegative Var(flag_stack_protect, 4) Optimization
a7b2e184 2762Use stack protection method only for functions with the stack_protect attribute.
5434dc07 2763
d3c12306
EB
2764fstack-usage
2765Common RejectNegative Var(flag_stack_usage)
a7b2e184 2766Output stack usage information on a per-function basis.
d3c12306 2767
de32c0cb 2768fstrength-reduce
2d2bd949 2769Common Ignore
c0220ea4 2770Does nothing. Preserved for backward compatibility.
de32c0cb 2771
31b66477
KC
2772; Nonzero if we should do (language-dependent) alias analysis.
2773; Typically, this analysis will assume that expressions of certain
2774; types do not alias expressions of certain other types. Only used
2775; if alias analysis (in general) is enabled.
6ff3a151 2776fstrict-aliasing
eece52b5 2777Common Var(flag_strict_aliasing) Optimization
a7b2e184 2778Assume strict aliasing rules apply.
6ff3a151 2779
eeef0e45 2780fstrict-overflow
eece52b5 2781Common
3fccbb9e 2782Treat signed overflow as undefined. Negated as -fwrapv -fwrapv-pointer.
eeef0e45 2783
e8053cf5 2784fsync-libcalls
eece52b5 2785Common Var(flag_sync_libcalls) Init(1)
a7b2e184 2786Implement __atomic operations via libcalls to legacy __sync functions.
e8053cf5 2787
de32c0cb 2788fsyntax-only
eece52b5 2789Common Var(flag_syntax_only)
a7b2e184 2790Check for syntax errors, then stop.
de32c0cb 2791
6ff3a151 2792ftest-coverage
eece52b5 2793Common Var(flag_test_coverage)
a7b2e184 2794Create data files needed by \"gcov\".
6ff3a151 2795
de32c0cb 2796fthread-jumps
eece52b5 2797Common Var(flag_thread_jumps) Optimization
a7b2e184 2798Perform jump threading optimizations.
de32c0cb 2799
6ff3a151 2800ftime-report
eece52b5 2801Common Var(time_report)
a7b2e184 2802Report the time taken by each compiler pass.
6ff3a151 2803
8df06bd0 2804ftime-report-details
eece52b5 2805Common Var(time_report_details)
8df06bd0
RB
2806Record times taken by sub-phases separately.
2807
058de654 2808ftls-model=
e6d4b984 2809Common Joined RejectNegative Enum(tls_model) Var(flag_tls_default) Init(TLS_MODEL_GLOBAL_DYNAMIC)
a7b2e184 2810-ftls-model=[global-dynamic|local-dynamic|initial-exec|local-exec] Set the default thread-local storage code generation model.
058de654 2811
e6d4b984
JM
2812Enum
2813Name(tls_model) Type(enum tls_model) UnknownError(unknown TLS model %qs)
2814
2815EnumValue
2816Enum(tls_model) String(global-dynamic) Value(TLS_MODEL_GLOBAL_DYNAMIC)
2817
2818EnumValue
2819Enum(tls_model) String(local-dynamic) Value(TLS_MODEL_LOCAL_DYNAMIC)
2820
2821EnumValue
2822Enum(tls_model) String(initial-exec) Value(TLS_MODEL_INITIAL_EXEC)
2823
2824EnumValue
2825Enum(tls_model) String(local-exec) Value(TLS_MODEL_LOCAL_EXEC)
2826
474eccc6 2827ftoplevel-reorder
eece52b5 2828Common Var(flag_toplevel_reorder) Init(2) Optimization
a7b2e184 2829Reorder top level functions, variables, and asms.
474eccc6 2830
de32c0cb 2831ftracer
eece52b5 2832Common Var(flag_tracer) Optimization
a7b2e184 2833Perform superblock formation via tail duplication.
de32c0cb 2834
4c640e26 2835ftrampolines
eece52b5 2836Common Var(flag_trampolines) Init(0)
4c640e26
EB
2837For targets that normally need trampolines for nested functions, always
2838generate them instead of using descriptors.
2839
31b66477
KC
2840; Zero means that floating-point math operations cannot generate a
2841; (user-visible) trap. This is the case, for example, in nonstop
2842; IEEE 754 arithmetic.
6ff3a151 2843ftrapping-math
eece52b5 2844Common Var(flag_trapping_math) Init(1) Optimization SetByCombined
a7b2e184 2845Assume floating-point operations can trap.
6ff3a151
NB
2846
2847ftrapv
eece52b5 2848Common Var(flag_trapv) Optimization
a7b2e184 2849Trap for signed overflow in addition, subtraction and multiplication.
6ff3a151 2850
6de9cd9a 2851ftree-ccp
eece52b5 2852Common Var(flag_tree_ccp) Optimization
a7b2e184 2853Enable SSA-CCP optimization on trees.
6de9cd9a 2854
0b4b14ac 2855ftree-bit-ccp
eece52b5 2856Common Var(flag_tree_bit_ccp) Optimization
a7b2e184 2857Enable SSA-BIT-CCP optimization on trees.
0b4b14ac 2858
0bca51f0 2859ftree-store-ccp
2d2bd949 2860Common Ignore
dce2b2f6 2861Does nothing. Preserved for backward compatibility.
0bca51f0 2862
6de9cd9a 2863ftree-ch
eece52b5 2864Common Var(flag_tree_ch) Optimization
a7b2e184 2865Enable loop header copying on trees.
6de9cd9a 2866
21d01365 2867ftree-coalesce-inlined-vars
1f9ceff1
AO
2868Common Ignore RejectNegative
2869Does nothing. Preserved for backward compatibility.
21d01365
AO
2870
2871ftree-coalesce-vars
eece52b5 2872Common Var(flag_tree_coalesce_vars) Optimization
a7b2e184 2873Enable SSA coalescing of user variables.
21d01365 2874
6de9cd9a 2875ftree-copyrename
1f9ceff1
AO
2876Common Ignore
2877Does nothing. Preserved for backward compatibility.
6de9cd9a 2878
0bca51f0 2879ftree-copy-prop
eece52b5 2880Common Var(flag_tree_copy_prop) Optimization
a7b2e184 2881Enable copy propagation on trees.
0bca51f0
DN
2882
2883ftree-store-copy-prop
2d2bd949 2884Common Ignore
e9033855 2885Does nothing. Preserved for backward compatibility.
0bca51f0 2886
a5828d1e 2887ftree-cselim
177b800f 2888Common Var(flag_tree_cselim) Optimization
a7b2e184 2889Transform condition stores into unconditional ones.
a5828d1e 2890
b6e99746 2891ftree-switch-conversion
eece52b5 2892Common Var(flag_tree_switch_conversion) Optimization
b6e99746
MJ
2893Perform conversions of switch initializations.
2894
6de9cd9a 2895ftree-dce
eece52b5 2896Common Var(flag_tree_dce) Optimization
a7b2e184 2897Enable SSA dead code elimination optimization on trees.
6de9cd9a
DN
2898
2899ftree-dominator-opts
eece52b5 2900Common Var(flag_tree_dom) Optimization
a7b2e184 2901Enable dominator optimizations.
6de9cd9a 2902
c9e93168 2903ftree-tail-merge
eece52b5 2904Common Var(flag_tree_tail_merge) Optimization
a7b2e184 2905Enable tail merging on trees.
c9e93168 2906
6de9cd9a 2907ftree-dse
eece52b5 2908Common Var(flag_tree_dse) Optimization
a7b2e184 2909Enable dead store elimination.
6de9cd9a 2910
248fc9f3 2911ftree-forwprop
eece52b5 2912Common Var(flag_tree_forwprop) Init(1) Optimization
a7b2e184 2913Enable forward propagation on trees.
248fc9f3 2914
ff2ad0f7 2915ftree-fre
eece52b5 2916Common Var(flag_tree_fre) Optimization
a7b2e184 2917Enable Full Redundancy Elimination (FRE) on trees.
ff2ad0f7 2918
8b57bfeb 2919foptimize-strlen
eece52b5 2920Common Var(flag_optimize_strlen) Optimization
a7b2e184 2921Enable string length optimizations on trees.
8b57bfeb 2922
ae93744d 2923fisolate-erroneous-paths-dereference
eece52b5 2924Common Var(flag_isolate_erroneous_paths_dereference) Optimization
408e8aa4
SL
2925Detect paths that trigger erroneous or undefined behavior due to
2926dereferencing a null pointer. Isolate those paths from the main control
2927flow and turn the statement with erroneous or undefined behavior into a trap.
ae93744d
JL
2928
2929fisolate-erroneous-paths-attribute
eece52b5 2930Common Var(flag_isolate_erroneous_paths_attribute) Optimization
51956afe 2931Detect paths that trigger erroneous or undefined behavior due to a null value
408e8aa4 2932being used in a way forbidden by a returns_nonnull or nonnull
ae93744d 2933attribute. Isolate those paths from the main control flow and turn the
a7b2e184 2934statement with erroneous or undefined behavior into a trap.
8fdc414d 2935
dea61d92 2936ftree-loop-distribution
eece52b5 2937Common Var(flag_tree_loop_distribution) Optimization
a7b2e184 2938Enable loop distribution on trees.
dea61d92 2939
20769d5e 2940ftree-loop-distribute-patterns
eece52b5 2941Common Var(flag_tree_loop_distribute_patterns) Optimization
a7b2e184 2942Enable loop distribution for patterns transformed into a library call.
20769d5e 2943
1b08d87d 2944ftree-loop-im
eece52b5 2945Common Var(flag_tree_loop_im) Init(1) Optimization
a7b2e184 2946Enable loop invariant motion on trees.
a7e5372d 2947
599eabdb 2948ftree-loop-linear
d6bb5ccf 2949Common Alias(floop-nest-optimize)
a7b2e184 2950Enable loop nest transforms. Same as -floop-nest-optimize.
599eabdb 2951
1b08d87d 2952ftree-loop-ivcanon
eece52b5 2953Common Var(flag_tree_loop_ivcanon) Init(1) Optimization
a7b2e184 2954Create canonical induction variables in loops.
1b08d87d 2955
c66b6c66 2956ftree-loop-optimize
eece52b5 2957Common Var(flag_tree_loop_optimize) Init(1) Optimization
a7b2e184 2958Enable loop optimizations on tree level.
c66b6c66 2959
5f40b3cb 2960ftree-parallelize-loops=
eece52b5 2961Common Joined RejectNegative UInteger Var(flag_tree_parallelize_loops) Init(1) Optimization
9453ba0a 2962-ftree-parallelize-loops=<number> Enable automatic parallelization of loops.
5f40b3cb 2963
248fc9f3 2964ftree-phiprop
eece52b5 2965Common Var(flag_tree_phiprop) Init(1) Optimization
248fc9f3
RG
2966Enable hoisting loads from conditional pointers.
2967
6de9cd9a 2968ftree-pre
eece52b5 2969Common Var(flag_tree_pre) Optimization
a7b2e184 2970Enable SSA-PRE optimization on trees.
6de9cd9a 2971
fa06ad0d 2972ftree-partial-pre
eece52b5 2973Common Var(flag_tree_partial_pre) Optimization
a7b2e184 2974In SSA-PRE optimization on trees, enable partial-partial redundancy elimination.
fa06ad0d 2975
248fc9f3 2976ftree-pta
eece52b5 2977Common Var(flag_tree_pta) Optimization
248fc9f3
RG
2978Perform function-local points-to analysis on trees.
2979
13c59415 2980ftree-reassoc
eece52b5 2981Common Var(flag_tree_reassoc) Init(1) Optimization
a7b2e184 2982Enable reassociation on tree level.
13c59415 2983
c75ab022 2984ftree-salias
2d2bd949 2985Common Ignore
1353232d 2986Does nothing. Preserved for backward compatibility.
c75ab022 2987
fa555252 2988ftree-sink
eece52b5 2989Common Var(flag_tree_sink) Optimization
a7b2e184 2990Enable SSA code sinking on trees.
fa555252 2991
75cfe445 2992ftree-slsr
eece52b5 2993Common Var(flag_tree_slsr) Optimization
a7b2e184 2994Perform straight-line strength reduction.
75cfe445 2995
6de9cd9a 2996ftree-sra
eece52b5 2997Common Var(flag_tree_sra) Optimization
a7b2e184 2998Perform scalar replacement of aggregates.
6de9cd9a
DN
2999
3000ftree-ter
eece52b5 3001Common Var(flag_tree_ter) Optimization
a7b2e184 3002Replace temporary expressions in the SSA->normal pass.
6de9cd9a 3003
c662432e 3004ftree-lrs
eece52b5 3005Common Var(flag_tree_live_range_split) Optimization
a7b2e184 3006Perform live range splitting during the SSA->normal pass.
c662432e 3007
0bca51f0 3008ftree-vrp
eece52b5 3009Common Var(flag_tree_vrp) Init(0) Optimization
a7b2e184 3010Perform Value Range Propagation on trees.
0bca51f0 3011
8fe17e23 3012fsplit-paths
eece52b5 3013Common Var(flag_split_paths) Init(0) Optimization
8fe17e23
AA
3014Split paths leading to loop backedges.
3015
71017a7b
AL
3016funconstrained-commons
3017Common Var(flag_unconstrained_commons) Optimization
3018Assume common declarations may be overridden with ones with a larger
3019trailing array.
3020
de32c0cb 3021funit-at-a-time
eece52b5 3022Common Var(flag_unit_at_a_time) Init(1)
a7b2e184 3023Compile whole compilation unit at a time.
de32c0cb 3024
d68d3664
JM
3025funreachable-traps
3026Common Var(flag_unreachable_traps) Optimization
3027Trap on __builtin_unreachable instead of using it for optimization.
3028
de32c0cb 3029funroll-loops
e415bc4c 3030Common Var(flag_unroll_loops) Optimization EnabledBy(funroll-all-loops)
a7b2e184 3031Perform loop unrolling when iteration count is known.
de32c0cb
NB
3032
3033funroll-all-loops
eece52b5 3034Common Var(flag_unroll_all_loops) Optimization
a7b2e184 3035Perform loop unrolling for all loops.
de32c0cb 3036
71489d8e 3037funroll-completely-grow-size
fe9458c2 3038Undocumented Var(flag_cunroll_grow_size) Optimization
71489d8e 3039; Internal undocumented flag, allow size growth during complete unrolling
3040
f9cc1a70
PB
3041; Nonzero means that loop optimizer may assume that the induction variables
3042; that control loops do not overflow and that the loops with nontrivial
3043; exit condition are not infinite
3044funsafe-loop-optimizations
78f63b79
BC
3045Common Ignore
3046Does nothing. Preserved for backward compatibility.
f9cc1a70 3047
a1a82611 3048fassociative-math
eece52b5 3049Common Var(flag_associative_math) SetByCombined Optimization
a1a82611
RE
3050Allow optimization for floating-point arithmetic which may change the
3051result of the operation due to rounding.
3052
3053freciprocal-math
eece52b5 3054Common Var(flag_reciprocal_math) SetByCombined Optimization
a1a82611
RE
3055Same as -fassociative-math for expressions which include division.
3056
31b66477
KC
3057; Nonzero means that unsafe floating-point math optimizations are allowed
3058; for the sake of speed. IEEE compliance is not guaranteed, and operations
3059; are allowed to assume that their arguments and results are "normal"
3060; (e.g., nonnegative for SQRT).
6ff3a151 3061funsafe-math-optimizations
eece52b5 3062Common Var(flag_unsafe_math_optimizations) Optimization SetByCombined
a7b2e184 3063Allow math optimizations that may violate IEEE or ISO standards.
6ff3a151 3064
de32c0cb 3065funswitch-loops
eece52b5 3066Common Var(flag_unswitch_loops) Optimization
a7b2e184 3067Perform loop unswitching.
de32c0cb 3068
28df8730 3069fsplit-loops
eece52b5 3070Common Var(flag_split_loops) Optimization
28df8730
MM
3071Perform loop splitting.
3072
13e08dc9 3073fversion-loops-for-strides
eece52b5 3074Common Var(flag_version_loops_for_strides) Optimization
13e08dc9
RS
3075Version loops based on whether indices have a stride of one.
3076
6ff3a151 3077funwind-tables
eece52b5 3078Common Var(flag_unwind_tables) Optimization
a7b2e184 3079Just generate unwind tables for exception handling.
6ff3a151 3080
b352afba 3081fuse-ld=bfd
b78e932d 3082Common Driver Negative(fuse-ld=gold)
a7b2e184 3083Use the bfd linker instead of the default linker.
b352afba
NC
3084
3085fuse-ld=gold
b78e932d 3086Common Driver Negative(fuse-ld=bfd)
a7b2e184 3087Use the gold linker instead of the default linker.
b352afba 3088
d69ac8b7
RG
3089fuse-ld=lld
3090Common Driver Negative(fuse-ld=lld)
3091Use the lld LLVM linker instead of the default linker.
3092
ad964f7e
ML
3093fuse-ld=mold
3094Common Driver Negative(fuse-ld=mold)
3095Use the Modern linker (MOLD) linker instead of the default linker.
3096
da18ea94 3097fuse-linker-plugin
063d671d 3098Common Undocumented Var(flag_use_linker_plugin)
da18ea94 3099
e90afde6
JM
3100; Positive if we should track variables, negative if we should run
3101; the var-tracking pass only to discard debug annotations, zero if
4cb52980 3102; we're not to run it.
014a1138 3103fvar-tracking
4cb52980 3104Common Var(flag_var_tracking) PerFunction EnabledBy(fvar-tracking-uninit)
a7b2e184 3105Perform variable tracking.
014a1138 3106
e90afde6
JM
3107; Positive if we should track variables at assignments, negative if
3108; we should run the var-tracking pass only to discard debug
4cb52980 3109; annotations.
b5b8b0ac 3110fvar-tracking-assignments
4cb52980 3111Common Var(flag_var_tracking_assignments) PerFunction
a7b2e184 3112Perform variable tracking by annotating assignments.
b5b8b0ac 3113
e90afde6
JM
3114; Nonzero if we should toggle flag_var_tracking_assignments after
3115; processing options and computing its default. */
b5b8b0ac 3116fvar-tracking-assignments-toggle
eece52b5 3117Common Var(flag_var_tracking_assignments_toggle) PerFunction
a7b2e184 3118Toggle -fvar-tracking-assignments.
b5b8b0ac 3119
1267ca30
EB
3120; Positive if we should track uninitialized variables, negative if
3121; we should run the var-tracking pass only to discard debug
4cb52980 3122; annotations.
62760ffd 3123fvar-tracking-uninit
eece52b5 3124Common Var(flag_var_tracking_uninit) PerFunction
a7b2e184 3125Perform variable tracking and also tag variables that are uninitialized.
62760ffd 3126
26d476cd 3127; Alias to enable both -ftree-loop-vectorize and -ftree-slp-vectorize.
79fe1b3b 3128ftree-vectorize
2b8453c4 3129Common Var(flag_tree_vectorize) Optimization
a7b2e184 3130Enable vectorization on trees.
79fe1b3b 3131
78c60e3d 3132ftree-vectorizer-verbose=
477e804b
SS
3133Common Joined RejectNegative Ignore
3134Does nothing. Preserved for backward compatibility.
78c60e3d 3135
ea0f3e87 3136ftree-loop-vectorize
eece52b5 3137Common Var(flag_tree_loop_vectorize) Optimization EnabledBy(ftree-vectorize)
a7b2e184 3138Enable loop vectorization on trees.
ea0f3e87 3139
a70d6342 3140ftree-slp-vectorize
eece52b5 3141Common Var(flag_tree_slp_vectorize) Optimization EnabledBy(ftree-vectorize)
a7b2e184 3142Enable basic block vectorization (SLP) on trees.
a70d6342 3143
d6d11272 3144fvect-cost-model=
b16650ac 3145Common Joined RejectNegative Enum(vect_cost_model) Var(flag_vect_cost_model) Init(VECT_COST_MODEL_DEFAULT) Optimization
0b0061f4 3146-fvect-cost-model=[unlimited|dynamic|cheap|very-cheap] Specifies the cost model for vectorization.
a7b2e184 3147
8b5e1202 3148fsimd-cost-model=
b16650ac 3149Common Joined RejectNegative Enum(vect_cost_model) Var(flag_simd_cost_model) Init(VECT_COST_MODEL_UNLIMITED) Optimization
0b0061f4 3150-fsimd-cost-model=[unlimited|dynamic|cheap|very-cheap] Specifies the vectorization cost model for code marked with a simd directive.
8b5e1202 3151
d6d11272
XDL
3152Enum
3153Name(vect_cost_model) Type(enum vect_cost_model) UnknownError(unknown vectorizer cost model %qs)
3154
3155EnumValue
3156Enum(vect_cost_model) String(unlimited) Value(VECT_COST_MODEL_UNLIMITED)
3157
3158EnumValue
3159Enum(vect_cost_model) String(dynamic) Value(VECT_COST_MODEL_DYNAMIC)
3160
3161EnumValue
3162Enum(vect_cost_model) String(cheap) Value(VECT_COST_MODEL_CHEAP)
3163
0b0061f4
RS
3164EnumValue
3165Enum(vect_cost_model) String(very-cheap) Value(VECT_COST_MODEL_VERY_CHEAP)
3166
792ed98b 3167fvect-cost-model
205d7111 3168Common Alias(fvect-cost-model=,dynamic,unlimited)
d6d11272
XDL
3169Enables the dynamic vectorizer cost model. Preserved for backward compatibility.
3170
c12cc930 3171ftree-vect-loop-version
d6d11272
XDL
3172Common Ignore
3173Does nothing. Preserved for backward compatibility.
c12cc930 3174
fbf798fc 3175ftree-scev-cprop
eece52b5 3176Common Var(flag_tree_scev_cprop) Init(1) Optimization
fbf798fc
DN
3177Enable copy propagation of scalar-evolution information.
3178
a25e0b5e 3179ftrivial-auto-var-init=
3180Common Joined RejectNegative Enum(auto_init_type) Var(flag_auto_var_init) Init(AUTO_INIT_UNINITIALIZED) Optimization
3181-ftrivial-auto-var-init=[uninitialized|pattern|zero] Add initializations to automatic variables.
3182
3183Enum
3184Name(auto_init_type) Type(enum auto_init_type) UnknownError(unrecognized automatic variable initialization type %qs)
3185
3186EnumValue
3187Enum(auto_init_type) String(uninitialized) Value(AUTO_INIT_UNINITIALIZED)
3188
3189EnumValue
3190Enum(auto_init_type) String(pattern) Value(AUTO_INIT_PATTERN)
3191
3192EnumValue
3193Enum(auto_init_type) String(zero) Value(AUTO_INIT_ZERO)
3194
31b66477
KC
3195; -fverbose-asm causes extra commentary information to be produced in
3196; the generated assembly code (to make it more readable). This option
3197; is generally only of use to those who actually need to read the
3198; generated assembly code (perhaps while debugging the compiler itself).
3199; -fno-verbose-asm, the default, causes the extra information
3200; to not be added and is useful when comparing two assembler files.
6ff3a151 3201fverbose-asm
eece52b5 3202Common Var(flag_verbose_asm)
a7b2e184 3203Add extra commentary to assembler output.
6ff3a151 3204
d7afec4b 3205fvisibility=
e6d4b984 3206Common Joined RejectNegative Enum(symbol_visibility) Var(default_visibility) Init(VISIBILITY_DEFAULT)
a7b2e184 3207-fvisibility=[default|internal|hidden|protected] Set the default symbol visibility.
d7afec4b 3208
e6d4b984
JM
3209Enum
3210Name(symbol_visibility) Type(enum symbol_visibility) UnknownError(unrecognized visibility value %qs)
3211
3212EnumValue
3213Enum(symbol_visibility) String(default) Value(VISIBILITY_DEFAULT)
3214
3215EnumValue
3216Enum(symbol_visibility) String(internal) Value(VISIBILITY_INTERNAL)
3217
3218EnumValue
3219Enum(symbol_visibility) String(hidden) Value(VISIBILITY_HIDDEN)
3220
3221EnumValue
3222Enum(symbol_visibility) String(protected) Value(VISIBILITY_PROTECTED)
d7afec4b 3223
2077db1b
CT
3224fvtable-verify=
3225Common Joined RejectNegative Enum(vtv_priority) Var(flag_vtable_verify) Init(VTV_NO_PRIORITY)
3226Validate vtable pointers before using them.
3227
3228Enum
3229Name(vtv_priority) Type(enum vtv_priority) UnknownError(unknown vtable verify initialization priority %qs)
3230
3231EnumValue
3232Enum(vtv_priority) String(none) Value(VTV_NO_PRIORITY)
3233
3234EnumValue
3235Enum(vtv_priority) String(std) Value(VTV_STANDARD_PRIORITY)
3236
3237EnumValue
3238Enum(vtv_priority) String(preinit) Value(VTV_PREINIT_PRIORITY)
3239
3240fvtv-counts
3241Common Var(flag_vtv_counts)
3242Output vtable verification counters.
3243
3244fvtv-debug
3245Common Var(flag_vtv_debug)
3246Output vtable verification pointer sets information.
3247
fca9dc00 3248fvpt
eece52b5 3249Common Var(flag_value_profile_transformations) Optimization
a7b2e184 3250Use expression value profiles in optimizations.
fca9dc00 3251
62551c66 3252fweb
e415bc4c 3253Common Var(flag_web) Optimization EnabledBy(funroll-loops)
a7b2e184 3254Construct webs and split unrelated uses of single variable.
62551c66 3255
c2699190 3256ftree-builtin-call-dce
eece52b5 3257Common Var(flag_tree_builtin_call_dce) Init(0) Optimization
a7b2e184 3258Enable conditional dead code elimination for builtin calls.
c2699190 3259
ce91e74c 3260fwhole-program
eece52b5 3261Common Var(flag_whole_program) Init(0)
a7b2e184 3262Perform whole program optimizations.
ce91e74c 3263
3fccbb9e 3264fwrapv-pointer
eece52b5 3265Common Var(flag_wrapv_pointer) Optimization
3fccbb9e
JJ
3266Assume pointer overflow wraps around.
3267
6ff3a151 3268fwrapv
eece52b5 3269Common Var(flag_wrapv) Optimization
a7b2e184 3270Assume signed arithmetic overflow wraps around.
6ff3a151 3271
6ff3a151 3272fzero-initialized-in-bss
eece52b5 3273Common Var(flag_zero_initialized_in_bss) Init(1)
a7b2e184 3274Put zero initialized data in the bss section.
6ff3a151 3275
d10f3e90 3276fzero-call-used-regs=
eece52b5 3277Common RejectNegative Joined
d10f3e90 3278Clear call-used registers upon function return.
3279
e01cc6dc 3280g
9ed32e27 3281Common Driver RejectNegative JoinedOrMissing
a7b2e184 3282Generate debug information in default format.
df38ffef 3283
924c9e3e 3284gas-loc-support
4cb52980 3285Common Driver Var(dwarf2out_as_loc_support)
04e5c73d 3286Assume assembler support for (DWARF2+) .loc directives.
924c9e3e
AO
3287
3288gas-locview-support
4cb52980 3289Common Driver Var(dwarf2out_as_locview_support)
04e5c73d 3290Assume assembler support for view in (DWARF2+) .loc directives.
924c9e3e 3291
e7e95821 3292gcoff
68a57628 3293Common Driver WarnRemoved
e7e95821
JW
3294Does nothing. Preserved for backward compatibility.
3295
3296gcoff1
68a57628 3297Common Driver WarnRemoved
e7e95821
JW
3298Does nothing. Preserved for backward compatibility.
3299
3300gcoff2
68a57628 3301Common Driver WarnRemoved
e7e95821
JW
3302Does nothing. Preserved for backward compatibility.
3303
3304gcoff3
68a57628 3305Common Driver WarnRemoved
e7e95821
JW
3306Does nothing. Preserved for backward compatibility.
3307
0029b929 3308gcolumn-info
8008dd1c 3309Common Driver Var(debug_column_info,1) Init(1)
0029b929
JJ
3310Record DW_AT_decl_column and DW_AT_call_column in DWARF.
3311
b7e215a8
IB
3312; The CTF generation process feeds off DWARF dies. This option implicitly
3313; updates the debug_info_level to DINFO_LEVEL_NORMAL.
3314gctf
3315Common Driver RejectNegative JoinedOrMissing
3316Generate CTF debug information at default level.
3317
3318gbtf
3319Common Driver RejectNegative JoinedOrMissing
3320Generate BTF debug information at default level.
3321
6782438d 3322gdwarf
1c70261c 3323Common Driver JoinedOrMissing Negative(gdwarf-)
a7b2e184 3324Generate debug information in default version of DWARF format.
6782438d 3325
53b2323e 3326gdwarf-
8dffd0e9 3327Common Driver Joined UInteger Var(dwarf_version) Init(DWARF_VERSION_DEFAULT)
a7b2e184 3328Generate debug information in DWARF v2 (or later) format.
df38ffef 3329
65312dfc
JJ
3330gdwarf32
3331Common Driver Var(dwarf_offset_size,4) Init(4) RejectNegative
3332Use 32-bit DWARF format when emitting DWARF debug information.
3333
3334gdwarf64
3335Common Driver Var(dwarf_offset_size,8) RejectNegative
3336Use 64-bit DWARF format when emitting DWARF debug information.
3337
df38ffef 3338ggdb
1c70261c 3339Common Driver JoinedOrMissing
a7b2e184 3340Generate debug information in default extended format.
df38ffef 3341
924c9e3e 3342ginline-points
4cb52980 3343Common Driver Var(debug_inline_points)
04e5c73d 3344Generate extended entry point information for inlined functions.
924c9e3e
AO
3345
3346ginternal-reset-location-views
3347Common Driver Var(debug_internal_reset_location_views) Init(2)
04e5c73d 3348Compute locview reset points based on insn length estimates.
924c9e3e 3349
9ed32e27
AO
3350gno-
3351RejectNegative Joined Undocumented
3352; Catch the gno- prefix, so it doesn't backtrack to g<level>.
3353
5175cbaf 3354gno-pubnames
1c70261c 3355Common Driver Negative(gpubnames) Var(debug_generate_pub_sections, 0) Init(-1)
5175cbaf
SA
3356Don't generate DWARF pubnames and pubtypes sections.
3357
3358gpubnames
1c70261c 3359Common Driver Negative(ggnu-pubnames) Var(debug_generate_pub_sections, 1)
5175cbaf
SA
3360Generate DWARF pubnames and pubtypes sections.
3361
7a1dd0fa 3362ggnu-pubnames
1c70261c 3363Common Driver Negative(gno-pubnames) Var(debug_generate_pub_sections, 2)
7a1dd0fa
SA
3364Generate DWARF pubnames and pubtypes sections with GNU extensions.
3365
e967adf4 3366grecord-gcc-switches
9ed32e27 3367Common Driver Var(dwarf_record_gcc_switches) Init(1)
e967adf4
JJ
3368Record gcc command line switches in DWARF DW_AT_producer.
3369
99ea153e 3370gsplit-dwarf
9ed32e27 3371Common Driver Var(dwarf_split_debug_info) Init(0)
a7b2e184 3372Generate debug information in separate .dwo files.
99ea153e 3373
df38ffef 3374gstabs
7e0db0cd
ML
3375Common Driver WarnRemoved
3376Does nothing. Preserved for backward compatibility.
df38ffef
NB
3377
3378gstabs+
7e0db0cd
ML
3379Common Driver WarnRemoved
3380Does nothing. Preserved for backward compatibility.
df38ffef 3381
8697bf9f 3382gstatement-frontiers
b4702276 3383Common Driver Var(debug_nonbind_markers_p) PerFunction
8697bf9f
AO
3384Emit progressive recommended breakpoint locations.
3385
65f753a0 3386gstrict-dwarf
eece52b5 3387Common Driver Var(dwarf_strict) Init(0)
a7b2e184 3388Don't emit DWARF additions beyond selected version.
65f753a0 3389
03e992ac 3390gdescribe-dies
eece52b5 3391Common Driver Var(flag_describe_dies) Init(0)
03e992ac
TV
3392Add description attributes to some DWARF DIEs that have no name attribute.
3393
2153915d 3394gtoggle
eece52b5 3395Common Driver Var(flag_gtoggle)
a7b2e184 3396Toggle debug information generation.
2153915d 3397
bd2b9f1e 3398gvariable-location-views
4cb52980 3399Common Driver Var(debug_variable_location_views, 1)
bd2b9f1e
AO
3400Augment variable location lists with progressive views.
3401
3402gvariable-location-views=incompat5
3403Common Driver RejectNegative Var(debug_variable_location_views, -1) Init(2)
3404
df38ffef 3405gvms
7e0db0cd 3406Common Driver JoinedOrMissing
a7b2e184 3407Generate debug information in VMS format.
df38ffef
NB
3408
3409gxcoff
7e0db0cd
ML
3410Common Driver WarnRemoved
3411Does nothing. Preserved for backward compatibility.
df38ffef
NB
3412
3413gxcoff+
7e0db0cd
ML
3414Common Driver JoinedOrMissing WarnRemoved
3415Does nothing. Preserved for backward compatibility.
e01cc6dc 3416
29d7cbd1
RO
3417Enum
3418Name(compressed_debug_sections) Type(int)
3419
3420; Since -gz= is completely handled in specs, the values aren't used and we
3421; assign arbitrary constants.
3422EnumValue
3423Enum(compressed_debug_sections) String(none) Value(0)
3424
3425EnumValue
3426Enum(compressed_debug_sections) String(zlib) Value(1)
3427
3428EnumValue
b7723e13
ML
3429Enum(compressed_debug_sections) String(zstd) Value(2)
3430
3431EnumValue
3432Enum(compressed_debug_sections) String(zlib-gnu) Value(3)
29d7cbd1
RO
3433
3434gz
3435Common Driver
a7b2e184 3436Generate compressed debug sections.
29d7cbd1
RO
3437
3438gz=
9ed32e27 3439Common Driver RejectNegative Joined Enum(compressed_debug_sections)
a7b2e184 3440-gz=<format> Generate compressed debug sections in format <format>.
29d7cbd1 3441
6d721f67
JM
3442h
3443Driver Joined Separate
3444
4adbd5dd
MK
3445iplugindir=
3446Common Joined Var(plugindir_string) Init(0)
a7b2e184 3447-iplugindir=<dir> Set <dir> to be the default plugin directory.
4adbd5dd 3448
e0cdc09f
MK
3449imultiarch
3450Common Joined Separate RejectDriver Var(imultiarch) Init(0)
a7b2e184 3451-imultiarch <dir> Set <dir> to be the multiarch include subdirectory.
e0cdc09f 3452
603349bf
JM
3453l
3454Driver Joined Separate
3455
dd9f93dc
JM
3456n
3457Driver
3458
603349bf
JM
3459no-canonical-prefixes
3460Driver
3461
d9d16a19
JM
3462nodefaultlibs
3463Driver
3464
bab79a40
JM
3465nostartfiles
3466Driver
3467
f37866e8
OH
3468nolibc
3469Driver
3470
d9d16a19
JM
3471nostdlib
3472Driver
3473
fc2fb4fd
AO
3474nostdlib++
3475Driver
3476
d185d268 3477o
d5478783 3478Common Driver Joined Separate Var(asm_file_name) MissingArgError(missing filename after %qs)
a7b2e184 3479-o <file> Place output into <file>.
d185d268
NB
3480
3481p
50431bc4 3482Common Var(profile_flag)
a7b2e184 3483Enable function profiling.
d185d268 3484
603349bf
JM
3485pass-exit-codes
3486Driver Var(pass_exit_codes)
3487
d185d268 3488pedantic
c1771a20 3489Common Alias(Wpedantic)
d185d268
NB
3490
3491pedantic-errors
d5478783 3492Common Var(flag_pedantic_errors)
a7b2e184 3493Like -pedantic but issue them as errors.
d185d268 3494
d9d16a19
JM
3495pg
3496Driver
3497
603349bf
JM
3498pipe
3499Driver Var(use_pipes)
3500
3501print-file-name=
3502Driver JoinedOrMissing Var(print_file_name)
3503
3504print-libgcc-file-name
3505Driver
3506
3507print-multi-directory
3508Driver Var(print_multi_directory)
3509
3510print-multi-lib
3511Driver Var(print_multi_lib)
3512
3513print-multi-os-directory
3514Driver Var(print_multi_os_directory)
a7b2e184 3515
e0cdc09f
MK
3516print-multiarch
3517Driver Var(print_multiarch)
603349bf
JM
3518
3519print-prog-name=
3520Driver JoinedOrMissing Var(print_prog_name)
3521
3522print-search-dirs
3523Driver Var(print_search_dirs)
3524
3525print-sysroot
3526Driver Var(print_sysroot)
3527
3528print-sysroot-headers-suffix
3529Driver Var(print_sysroot_headers_suffix)
3530
d7b42618 3531quiet
603349bf 3532Common Var(quiet_flag) RejectDriver
a7b2e184 3533Do not display functions compiled or elapsed time.
d7b42618 3534
dd9f93dc
JM
3535r
3536Driver
3537
3538s
3539Driver
3540
603349bf
JM
3541save-temps
3542Driver
3543
3544save-temps=
3545Driver Joined
3546
dd9f93dc
JM
3547t
3548Driver
3549
603349bf
JM
3550time
3551Driver Var(report_times)
3552
3553time=
3554Driver JoinedOrMissing
3555
e200444e
JM
3556u
3557Driver Joined Separate
3558
5642f5d5
JM
3559undef
3560Driver
3561; C option, but driver must not handle as "-u ndef".
3562
603349bf 3563v
d5478783 3564Common Driver Var(verbose_flag)
a7b2e184 3565Enable verbose output.
603349bf 3566
d185d268 3567version
603349bf 3568Common Var(version_flag) RejectDriver
a7b2e184 3569Display the compiler's version.
d185d268
NB
3570
3571w
50431bc4 3572Common Var(inhibit_warnings)
a7b2e184 3573Suppress warnings.
d185d268 3574
603349bf
JM
3575wrapper
3576Driver Separate Var(wrapper_string)
3577
3578x
3579Driver Joined Separate
3580
528dc603 3581shared
b4fed890 3582Driver RejectNegative Negative(static-pie)
a7b2e184 3583Create a shared library.
528dc603 3584
603349bf
JM
3585shared-libgcc
3586Driver
3587
3588specs
5de8299c 3589Driver Separate Alias(specs=)
603349bf
JM
3590
3591specs=
3592Driver Joined
3593
d9d16a19
JM
3594static
3595Driver
3596
603349bf
JM
3597static-libgcc
3598Driver
3599
3600static-libgfortran
3601Driver
3602; Documented for Fortran, but always accepted by driver.
3603
185b307b
IB
3604static-libphobos
3605Driver
3606; Documented for D, but always accepted by driver.
3607
745be54b
JJ
3608static-libquadmath
3609Driver
3610; Documented for Fortran, but always accepted by driver.
3611
603349bf
JM
3612static-libstdc++
3613Driver
3614
7a938933
ILT
3615static-libgo
3616Driver
3617; Documented for Go, but always accepted by driver.
3618
7e8d1b2d
L
3619static-libasan
3620Driver
3621
3bd87832
MM
3622static-libhwasan
3623Driver
3624
32b4b7f5
DV
3625static-libtsan
3626Driver
3627
9065ada9
JJ
3628static-liblsan
3629Driver
3630
de5a5fa1
MP
3631static-libubsan
3632Driver
3633
e200444e
JM
3634symbolic
3635Driver
3636
428b3812 3637no-pie
5460e1fc 3638Driver RejectNegative Negative(shared)
b4fed890 3639Don't create a dynamically linked position independent executable.
428b3812
L
3640
3641pie
3642Driver RejectNegative Negative(no-pie)
b4fed890
L
3643Create a dynamically linked position independent executable.
3644
3645static-pie
3646Driver RejectNegative Negative(pie)
3647Create a static position independent executable.
528dc603 3648
6d721f67
JM
3649z
3650Driver Joined Separate
3651
1e288103 3652fipa-ra
eece52b5 3653Common Var(flag_ipa_ra) Optimization
a7b2e184 3654Use caller save register across calls if possible.
d996e61a 3655
d7b42618 3656; This comment is to ensure we retain the blank line above.