aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/invoke.texi
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/doc/invoke.texi')
-rw-r--r--gcc/doc/invoke.texi209
1 files changed, 161 insertions, 48 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 0980230..c0b7aab 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -268,7 +268,7 @@ in the following sections.
-Wrange-loop-construct -Wredundant-move -Wredundant-tags
-Wreorder -Wregister -Wno-sfinae-incomplete
-Wstrict-null-sentinel -Wno-subobject-linkage -Wtemplates
--Wno-non-template-friend -Wold-style-cast
+-Wno-non-c-typedef-for-linkage -Wno-non-template-friend -Wold-style-cast
-Woverloaded-virtual -Wno-pmf-conversions -Wself-move -Wsign-promo
-Wsized-deallocation -Wsuggest-final-methods
-Wsuggest-final-types -Wsuggest-override -Wno-template-body
@@ -322,6 +322,9 @@ Objective-C and Objective-C++ Dialects}.
-fno-diagnostics-show-cwe
-fno-diagnostics-show-rules
-fno-diagnostics-show-highlight-colors
+-fno-diagnostics-show-nesting
+-fno-diagnostics-show-nesting-locations
+-fdiagnostics-show-nesting-levels
-fdiagnostics-minimum-margin-width=@var{width}
-fdiagnostics-parseable-fixits -fdiagnostics-generate-patch
-fdiagnostics-show-template-tree -fno-elide-type
@@ -331,7 +334,8 @@ Objective-C and Objective-C++ Dialects}.
-fdiagnostics-column-unit=@r{[}display@r{|}byte@r{]}
-fdiagnostics-column-origin=@var{origin}
-fdiagnostics-escape-format=@r{[}unicode@r{|}bytes@r{]}
--fdiagnostics-text-art-charset=@r{[}none@r{|}ascii@r{|}unicode@r{|}emoji@r{]}}
+-fdiagnostics-text-art-charset=@r{[}none@r{|}ascii@r{|}unicode@r{|}emoji@r{]}
+-fdiagnostics-show-context@r{[}=@var{depth}@r{]}}
@item Warning Options
@xref{Warning Options,,Options to Request or Suppress Warnings}.
@@ -388,6 +392,7 @@ Objective-C and Objective-C++ Dialects}.
-Winit-self -Winline -Wno-int-conversion -Wint-in-bool-context
-Wno-int-to-pointer-cast -Wno-invalid-memory-model
-Winvalid-pch -Winvalid-utf8 -Wno-unicode -Wjump-misses-init
+-Wkeyword-macro
-Wlarger-than=@var{byte-size} -Wleading-whitespace=@var{kind}
-Wlogical-not-parentheses -Wlogical-op
-Wlong-long -Wno-lto-type-mismatch -Wmain -Wmaybe-uninitialized
@@ -915,7 +920,7 @@ Objective-C and Objective-C++ Dialects}.
@emph{AVR Options} (@ref{AVR Options})
@gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args -mcvt
-mbranch-cost=@var{cost} -mfuse-add=@var{level} -mfuse-move=@var{level}
--mcall-prologues -mgas-isr-prologues -mint8 -mflmap
+-mfuse-move2 -mcall-prologues -mgas-isr-prologues -mint8 -mflmap
-mdouble=@var{bits} -mlong-double=@var{bits} -mno-call-main
-mn_flash=@var{size} -mfract-convert-truncate -mno-interrupts
-mmain-is-OS_task -mrelax -mrmw -mstrict-X -mtiny-stack
@@ -1098,7 +1103,8 @@ Objective-C and Objective-C++ Dialects}.
-mcmodel=@var{code-model} -mrelax -mpass-mrelax-to-as
-mrecip -mrecip=@var{opt} -mfrecipe -mno-frecipe -mdiv32 -mno-div32
-mlam-bh -mno-lam-bh -mlamcas -mno-lamcas -mld-seq-sa -mno-ld-seq-sa
--mtls-dialect=@var{opt} -mannotate-tablejump -mno-annotate-tablejump}
+-mscq -mno-scq -mtls-dialect=@var{opt}
+-mannotate-tablejump -mno-annotate-tablejump}
@emph{M32C Options} (@ref{M32C Options})
@gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
@@ -1259,7 +1265,7 @@ See RS/6000 and PowerPC Options.
@emph{PRU Options} (@ref{PRU Options})
@gccoptlist{-mmcu=@var{mcu} -minrt -mno-relax -mloop
--mabi=@var{variant}}
+-mmul -mfillzero -mabi=@var{variant}}
@emph{RISC-V Options} (@ref{RISC-V Options})
@gccoptlist{-mbranch-cost=@var{N-instruction}
@@ -3016,8 +3022,9 @@ Version 20, which first appeared in G++ 15, fixes manglings of lambdas
in static data member initializers.
Version 21, which first appeared in G++ 16, fixes unnecessary captures
-in noexcept lambdas (c++/119764) and layout of a base class
-with all explicitly defaulted constructors (c++/120012).
+in noexcept lambdas (c++/119764), layout of a base class with all explicitly
+defaulted constructors (c++/120012), and mangling of class and array
+objects with implicitly zero-initialized non-trailing subobjects (c++/121231).
See also @option{-Wabi}.
@@ -4489,6 +4496,28 @@ to @code{__null}. Although it is a null pointer constant rather than a
null pointer, it is guaranteed to be of the same size as a pointer.
But this use is not portable across different compilers.
+@opindex Wno-non-c-typedef-for-linkage
+@opindex Wnon-c-typedef-for-linkage
+@item -Wno-non-c-typedef-for-linkage @r{(C++ and Objective-C++ only)}
+Disable pedwarn for unnamed classes with a typedef name for linkage purposes
+containing C++ specific members, base classes, default member initializers
+or lambda expressions, including those on nested member classes.
+
+@smallexample
+typedef struct @{
+ int a; // non-static data members are ok
+ struct T @{ int b; @}; // member classes too
+ enum E @{ E1, E2, E3 @}; // member enumerations as well
+ int c = 42; // default member initializers are not ok
+ struct U : A @{ int c; @}; // classes with base classes are not ok
+ typedef int V; // typedef is not ok
+ using W = int; // using declaration is not ok
+ decltype([]()@{@}) x; // lambda expressions not ok
+@} S;
+@end smallexample
+
+In all these cases, the tag name S should be added after the struct keyword.
+
@opindex Wno-non-template-friend
@opindex Wnon-template-friend
@item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
@@ -5427,7 +5456,8 @@ options:
-fdiagnostics-urls=never
-fdiagnostics-path-format=separate-events
-fdiagnostics-text-art-charset=none
--fno-diagnostics-show-event-links}
+-fno-diagnostics-show-event-links
+-fno-diagnostics-show-nesting}
In the future, if GCC changes the default appearance of its diagnostics, the
corresponding option to disable the new behavior will be added to this list.
@@ -5764,6 +5794,22 @@ left margin.
This option controls the minimum width of the left margin printed by
@option{-fdiagnostics-show-line-numbers}. It defaults to 6.
+@opindex fdiagnostics-show-context
+@item -fdiagnostics-show-context[=@var{depth}]
+@itemx -fno-diagnostics-show-context
+With this option, the compiler might print the interesting control flow
+chain that guards the basic block of the statement which has the warning.
+@var{depth} is the maximum depth of the control flow chain.
+Currently, The list of the impacted warning options includes:
+@option{-Warray-bounds}, @option{-Wstringop-overflow},
+@option{-Wstringop-overread}, @option{-Wstringop-truncation}.
+and @option{-Wrestrict}.
+More warning options might be added to this list in future releases.
+The forms @option{-fdiagnostics-show-context} and
+@option{-fno-diagnostics-show-context} are aliases for
+@option{-fdiagnostics-show-context=1} and
+@option{-fdiagnostics-show-context=0}, respectively.
+
@opindex fdiagnostics-parseable-fixits
@item -fdiagnostics-parseable-fixits
Emit fix-it hints in a machine-parseable format, suitable for consumption
@@ -6049,6 +6095,40 @@ emoji variant of the character).
The default is @samp{emoji}, except when the environment variable @env{LANG}
is set to @samp{C}, in which case the default is @samp{ascii}.
+@opindex fno-diagnostics-show-nesting
+@opindex fdiagnostics-show-nesting
+@item -fno-diagnostics-show-nesting
+Some GCC diagnostics have an internal tree-like structure of nested
+sub-diagnostics, such as for problems when instantiating C++ templates.
+
+By default GCC uses indentation and bullet points in its text output to
+show the nesting structure of these diagnostics, moves location
+information to separate lines to make the structure clearer, and
+eliminates redundant repeated information.
+
+Selecting @option{-fno-diagnostics-show-nesting} suppresses this
+indentation, reformatting, and elision, restoring an older `look'' for the
+diagnostics.
+
+@opindex fno-diagnostics-show-nesting-locations
+@opindex fdiagnostics-show-nesting-locations
+@item -fno-diagnostics-show-nesting-locations
+
+When @option{fdiagnostics-show-nesting} is enabled, file names and
+line- and column- numbers are displayed on separate lines from the
+messages. This location information can be disabled altogether with
+@option{-fno-diagnostics-show-nesting-locations}.
+This option exists for use by GCC developers, for writing DejaGnu test cases.
+
+@opindex fdiagnostics-show-nesting-levels
+@opindex fno-diagnostics-show-nesting-levels
+@item -fdiagnostics-show-nesting-levels
+When @option{fdiagnostics-show-nesting} is enabled, use
+@option{fdiagnostics-show-nesting-levels} to also display numbers
+showing the depth of the nesting.
+This option exists for use by GCC developers for debugging nested
+diagnostics, but may be of use to plugin authors.
+
@opindex fdiagnostics-format
@item -fdiagnostics-format=@var{FORMAT}
Select a different format for printing diagnostics.
@@ -6097,18 +6177,18 @@ Supported keys are:
Override colorization settings from @option{-fdiagnostics-color} for this
text output.
-@item experimental-nesting=@r{[}yes@r{|}no@r{]}
-Enable an experimental mode that emphasizes hierarchical relationships
-within diagnostics messages, displaying location information on separate
-lines.
+@item show-nesting=@r{[}yes@r{|}no@r{]}
+Enable a mode that emphasizes hierarchical relationships
+within diagnostics messages, as per @option{-fdiagnostics-show-nesting}.
+Defaults to @code{yes}.
-@item experimental-nesting-show-locations=@r{[}yes@r{|}no@r{]}
-If @code{experimental-nesting=yes}, then by default locations are
+@item show-nesting-locations=@r{[}yes@r{|}no@r{]}
+If @code{show-nesting=yes}, then by default locations are
shown; set this key to @code{no} to disable printing such locations.
This exists for use by GCC developers, for writing DejaGnu test cases.
-@item experimental-nesting-show-levels=@r{[}yes@r{|}no@r{]}
-This is a debugging option for use with @code{experimental-nesting=yes}.
+@item show-nesting-levels=@r{[}yes@r{|}no@r{]}
+This is a debugging option for use with @code{show-nesting=yes}.
Set this key to @code{yes} to print explicit nesting levels in the output.
This exists for use by GCC developers.
@@ -10398,6 +10478,14 @@ Do not warn if certain built-in macros are redefined. This suppresses
warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
@code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
+@opindex Wkeyword-macro
+@opindex Wno-keyword-macro
+@item -Wkeyword-macro
+Warn if a keyword is defined as a macro or undefined.
+For C++ identifiers with special meaning or standard attribute identifiers
+are diagnosed as well. This warning is enabled by default for C++26
+if @code{-Wpedantic} and emits a pedwarn in that case.
+
@opindex Wfree-labels
@opindex Wno-free-labels
@item -Wfree-labels @r{(C and Objective-C only)}
@@ -15563,7 +15651,7 @@ If omitted, it defaults to @file{fbdata.afdo} in the current directory.
Producing an AutoFDO profile data file requires running your program
with the @command{perf} utility on a supported GNU/Linux target system.
-For more information, see @uref{https://perf.wiki.kernel.org/}.
+For more information, see @uref{https://perfwiki.github.io/main/}.
E.g.
@smallexample
@@ -17784,6 +17872,9 @@ Instructions number above which STFL stall penalty can be compensated.
The maximum number of use and def visits when discovering a STV chain before
the discovery is aborted.
+@item ix86-vect-unroll-limit
+Limit how much the autovectorizer may unroll a loop.
+
@end table
@end table
@@ -20612,18 +20703,22 @@ LTO output files.
@opindex fdump-rtl-@var{pass}
@item -d@var{letters}
@itemx -fdump-rtl-@var{pass}
-@itemx -fdump-rtl-@var{pass}=@var{filename}
+@itemx -fdump-rtl-@var{pass}-@var{options}
+@itemx -fdump-rtl-@var{pass}-@var{options}=@var{filename}
Says to make debugging dumps during compilation at times specified by
-@var{letters}. This is used for debugging the RTL-based passes of the
+@var{letters} when using @option{-d} or by @var{pass} when using
+@option{-fdump-rtl}. This is used for debugging the RTL-based passes of the
compiler.
Some @option{-d@var{letters}} switches have different meaning when
@option{-E} is used for preprocessing. @xref{Preprocessor Options},
for information about preprocessor-specific dump options.
-Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
-@option{-d} option @var{letters}. Here are the possible
-letters for use in @var{pass} and @var{letters}, and their meanings:
+The @samp{-@var{options}} form allows greater control over the details of the
+dump. See @option{-fdump-tree}.
+
+Here are actual instances of command-line options following these patterns and
+their meanings:
@table @gcctabopt
@@ -21150,8 +21245,7 @@ GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}. Each function in
the file is pretty-printed as a subgraph, so that GraphViz can render them
all in a single plot.
-This option currently only works for RTL dumps, and the RTL is always
-dumped in slim form.
+RTL is always dumped in slim form.
@item vops
Enable showing virtual operands for every statement.
@item lineno
@@ -22846,7 +22940,7 @@ Compile for the CDNA3 gfx950 devices. (Experimental)
@item gfx9-generic
Compile generic code for Vega devices, executable on the following subset of
-GFX9 devices: gfx900, gfx902, gfx904, gfx906, gfx909 and gfx90c. (Experimental)
+GFX9 devices: gfx900, gfx902, gfx904, gfx906, gfx909 and gfx90c.
@item gfx9-4-generic
Compile generic code for CDNA3 devices, executable on the following subset of
@@ -22875,7 +22969,7 @@ Compile for RDNA2 gfx1036 devices (GFX10 series).
@item gfx10-3-generic
Compile generic code for GFX10-3 devices, executable on gfx1030,
-gfx1031, gfx1032, gfx1033, gfx1034, gfx1035, and gfx1036. (Experimental)
+gfx1031, gfx1032, gfx1033, gfx1034, gfx1035, and gfx1036.
@item gfx1100
Compile for RDNA3 gfx1100 devices (GFX11 series).
@@ -22903,7 +22997,7 @@ Compile for RDNA3 gfx1153 devices (GFX11 series). (Experimental)
@item gfx11-generic
Compile generic code for GFX11 devices, executable on gfx1100, gfx1101,
-gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, and gfx1153. (Experimental)
+gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, and gfx1153.
@end table
@opindex msram-ecc
@@ -25110,6 +25204,10 @@ Valid values for @var{level} are in the range @code{0} @dots{} @code{23}
which is a 3:2:2:2 mixed radix value. Each digit controls some
aspect of the optimization.
+@opindex mfuse-move2
+@item -mfuse-move2
+Run a post combine optimization pass that tries to fuse move instructions.
+
@opindex mstrict-X
@item -mstrict-X
Use address register @code{X} in a way proposed by the hardware. This means
@@ -28496,6 +28594,14 @@ Whether a same-address load-load barrier (@code{dbar 0x700}) is needed. When
build with @option{-march=la664}, it is enabled by default. The default is
@option{-mno-ld-seq-sa}, the load-load barrier is needed.
+@opindex mscq
+@opindex mno-scq
+@item -mscq
+@item -mno-scq
+Use (do not use) the 16-byte conditional store instruction @code{sc.q}.
+The default is @option{-mscq} if the machine type specified with
+@option{-march=} supports this instruction, @option{-mno-scq} otherwise.
+
@opindex mtls-dialect
@item -mtls-dialect=@var{opt}
This option controls which tls dialect may be used for general dynamic and
@@ -31219,6 +31325,14 @@ instead of the @option{--relax} option.
@item -mloop
Allow (or do not allow) GCC to use the LOOP instruction.
+@opindex mmul
+@item -mmul
+Allow (or do not allow) GCC to use the PRU multiplier unit.
+
+@opindex mfillzero
+@item -mfillzero
+Allow (or do not allow) GCC to use the FILL and ZERO instructions.
+
@opindex mabi
@item -mabi=@var{variant}
Specify the ABI variant to output code for. @option{-mabi=ti} selects the
@@ -31329,7 +31443,7 @@ The default is @option{-misa-spec=20191213} unless GCC has been configured
with @option{--with-isa-spec=} specifying a different default version.
@opindex march
-@item -march=@var{ISA-string|Profiles|Profile_ISA-string}
+@item -march=@var{ISA-string|Profiles|Profile_ISA-string|help|unset}
Generate code for given RISC-V ISA or Profiles or a combination of them
(e.g.@: @samp{rv64im} @samp{rvi20u64} @samp{rvi20u64_zbb}). ISA strings and
Profiles must be lower-case. Examples include @samp{rv64i}, @samp{rv32g},
@@ -31340,6 +31454,12 @@ at the beginning of the option, then use underline connect ISA-string (e.g.@:
@option{help} (@option{-march=help}) is accepted to list all supported
extensions.
+@samp{-march=unset} causes the compiler to ignore any @samp{-march=@dots{}} options
+that appear earlier on the command line, behaving as if the option was never
+passed. This is useful for ensuring that the architecture is taken from the
+@samp{-mcpu} option, and it will result in an error if no @samp{-mcpu} option
+is given when @samp{-march=unset} is used.
+
The syntax of the ISA string is defined as follows:
@table @code
@@ -31370,31 +31490,14 @@ When the RISC-V specifications define an extension as depending on other
extensions, GCC will implicitly add the dependent extensions to the enabled
extension set if they weren't added explicitly.
-@opindex mcpu
-@item -mcpu=@var{processor-string}
-Use architecture of and optimize the output for the given processor, specified
-by particular CPU name.
-Permissible values for this option are: @samp{mips-p8700}, @samp{sifive-e20},
-@samp{sifive-e21}, @samp{sifive-e24}, @samp{sifive-e31}, @samp{sifive-e34},
-@samp{sifive-e76}, @samp{sifive-s21}, @samp{sifive-s51}, @samp{sifive-s54},
-@samp{sifive-s76}, @samp{sifive-u54}, @samp{sifive-u74}, @samp{sifive-x280},
-@samp{sifive-xp450}, @samp{sifive-x670}, @samp{thead-c906}, @samp{tt-ascalon-d8},
-@samp{xiangshan-nanhu}, @samp{xiangshan-kunminghu}, @samp{xt-c908}, @samp{xt-c908v},
-@samp{xt-c910}, @samp{xt-c910v2}, @samp{xt-c920}, @samp{xt-c920v2}.
+@include riscv-mcpu.texi
Note that @option{-mcpu} does not override @option{-march} or @option{-mtune}.
-@opindex mtune
-@item -mtune=@var{processor-string}
-Optimize the output for the given processor, specified by microarchitecture or
-particular CPU name. Permissible values for this option are:
-@samp{generic-ooo}, @samp{mips-p8700}, @samp{rocket}, @samp{sifive-3-series},
-@samp{sifive-5-series}, @samp{sifive-7-series}, @samp{size},
-@samp{sifive-p400-series}, @samp{sifive-p600-series}, and all valid options for
-@option{-mcpu=}.
+@include riscv-mtune.texi
When @option{-mtune=} is not specified, use the setting from @option{-mcpu},
-the default is @samp{rocket} if both are not specified.
+the default is @samp{generic} if both are not specified.
The @samp{size} choice is not intended for use by end-users. This is used
when @option{-Os} is specified. It overrides the instruction cost info
@@ -37804,6 +37907,16 @@ compilation which is to be used as input to the next stage: for example,
the output of the preprocessor, which is the input to the compiler
proper.
+@vindex GCC_DIAGNOSTICS_LOG
+@item GCC_DIAGNOSTICS_LOG
+If @env{GCC_DIAGNOSTICS_LOG} is set, then additional information
+about the diagnostics subsystem will be emitted. If it is set to an empty
+value, then the information will be written to stderr; otherwise, GCC will
+attempt to open that file and write the information there.
+
+The precise content and format of the information is subject to change;
+it is intended for use by GCC developers, rather than end-users.
+
@vindex GCC_COMPARE_DEBUG
@item GCC_COMPARE_DEBUG
Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing