diff options
Diffstat (limited to 'gcc/doc/invoke.texi')
| -rw-r--r-- | gcc/doc/invoke.texi | 3252 |
1 files changed, 1905 insertions, 1347 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 020442a..8db0aa0 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -194,7 +194,12 @@ in the following sections. -pass-exit-codes -pipe -specs=@var{file} -wrapper @@@var{file} -ffile-prefix-map=@var{old}=@var{new} -fcanon-prefix-map -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg} --fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{unit} -fdump-go-spec=@var{file}} +-fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{unit} +-fdump-go-spec=@var{file} +--assemble --compile --dumpbase @var{dumpbase} +--dumpbase-ext @var{auxdropsuf} --dumpdir @var{dumppfx} +--language=@var{language} --output=@var{file} --pass-exit-codes +--pipe --preprocess --specs=@var{file} --verbose} @item C Language Options @xref{C Dialect Options,,Options Controlling C Dialect}. @@ -206,27 +211,41 @@ in the following sections. -fpermitted-flt-eval-methods=@var{standard} -fplan9-extensions -fsigned-bitfields -funsigned-bitfields -fsigned-char -funsigned-char -fstrict-flex-arrays[=@var{n}] --fsso-struct=@var{endianness}} +-fsso-struct=@var{endianness} --ansi} @item C++ Language Options @xref{C++ Dialect Options,,Options Controlling C++ Dialect}. -@gccoptlist{-fabi-version=@var{n} -fno-access-control --faligned-new=@var{n} -fno-assume-sane-operators-new-delete +@gccoptlist{--compile-std-module +-fabi-compat-version=@var{n} -fabi-version=@var{n} +-fno-access-control -faligned-new=@r{[}@var{n}@r{]} +-fno-assume-sane-operators-new-delete -fchar8_t -fcheck-new --fconcepts -fconstexpr-depth=@var{n} -fconstexpr-cache-depth=@var{n} +-fconcepts -fconcepts-diagnostics-depth=@var{n} +-fconstexpr-depth=@var{n} -fconstexpr-cache-depth=@var{n} -fconstexpr-loop-limit=@var{n} -fconstexpr-ops-limit=@var{n} +-fcontracts -fcontract-assumption-mode=@r{[}on@r{|}off@r{]} +-fcontract-build-level=@r{[}off@r{|}default@r{|}audit@r{]} +-fcontract-continuation-mode=@r{[}on@r{|}off@r{]} +-fcontract-mode=@r{[}on@r{|}off@r{]} +-fcontract-role=@var{name}:@var{default},@var{audit},@var{axiom} +-fcontract-semantic=@r{[}default@r{|}audit@r{|}axiom@r{]}:@var{semantic} +-fcontract-strict-declarations=@r{[}on@r{|}off@r{]} +-fcoroutines -fdiagnostics-all-candidates -fno-elide-constructors -fno-enforce-eh-specs +-fext-numeric-literals -fno-gnu-keywords -fno-immediate-escalation --fno-implicit-templates --fno-implicit-inline-templates -fno-implement-inlines --fmodule-header@r{[}=@var{kind}@r{]} -fmodule-only -fmodules +-fimplicit-constexpr +-fno-implicit-inline-templates +-fno-implicit-templates +-fmodule-header@r{[}=@var{kind}@r{]} -fmodule-implicit-inline -fno-module-lazy -fmodule-mapper=@var{specification} --fmodule-version-ignore +-fmodule-only +-fmodules -fms-extensions -fnew-inheriting-ctors -fnew-ttp-matching @@ -234,19 +253,20 @@ in the following sections. -fno-optional-diags -fno-pretty-templates -frange-for-ext-temps -fno-rtti -fsized-deallocation --fstrong-eval-order@r{[}=@var{kind}@r{]} +-fstrict-enums -fstrong-eval-order@r{[}=@var{kind}@r{]} -ftemplate-backtrace-limit=@var{n} -ftemplate-depth=@var{n} --fno-threadsafe-statics -fuse-cxa-atexit +-fno-threadsafe-statics -fuse-cxa-atexit -fno-use-cxa-get-exception-ptr -fno-weak -nostdinc++ -fvisibility-inlines-hidden -fvisibility-ms-compat --fext-numeric-literals -flang-info-include-translate@r{[}=@var{header}@r{]} -flang-info-include-translate-not -flang-info-module-cmi@r{[}=@var{module}@r{]} -stdlib=@var{libstdc++,libc++} --Wabi-tag -Wcatch-value -Wcatch-value=@var{n} +-Wabbreviated-auto-in-template-arg +-Wabi-tag -Waligned-new@r{[}=@var{kind}@r{]} +-Wcatch-value -Wcatch-value=@var{n} -Wno-class-conversion -Wclass-memaccess -Wcomma-subscript -Wconditionally-supported -Wno-conversion-null -Wctad-maybe-unsupported @@ -254,22 +274,24 @@ in the following sections. -Wno-defaulted-function-deleted -Wno-delete-incomplete -Wdelete-non-virtual-dtor -Wno-deprecated-array-compare --Wdeprecated-copy -Wdeprecated-copy-dtor --Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion --Weffc++ -Wno-elaborated-enum-base --Wno-exceptions -Wextra-semi -Wno-global-module -Wno-inaccessible-base +-Wdeprecated-copy -Wdeprecated-copy-dtor +-Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion +-Wno-deprecated-literal-operator -Wdeprecated-variadic-comma-omission +-Weffc++ -Wno-elaborated-enum-base +-Wno-exceptions -Wno-expose-global-module-tu-local -Wno-external-tu-local +-Wextra-semi -Wno-global-module -Wno-inaccessible-base -Wno-inherited-variadic-ctor -Wno-init-list-lifetime --Winvalid-constexpr -Winvalid-imported-macros +-Winvalid-constexpr -Winvalid-imported-macros -Wno-invalid-offsetof -Wno-literal-suffix --Wmismatched-new-delete -Wmismatched-tags +-Wmismatched-new-delete -Wmismatched-tags -Wmultiple-inheritance -Wnamespaces -Wnarrowing -Wnoexcept -Wnoexcept-type -Wnon-virtual-dtor -Wpessimizing-move -Wno-placement-new -Wplacement-new=@var{n} --Wrange-loop-construct -Wredundant-move -Wredundant-tags --Wreorder -Wregister +-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 --Woverloaded-virtual -Wno-pmf-conversions -Wself-move -Wsign-promo +-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 -Wno-template-id-cdtor -Wtemplate-names-tu-local @@ -312,7 +334,7 @@ Objective-C and Objective-C++ Dialects}. -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]} -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]} -fdiagnostics-urls=@r{[}auto@r{|}never@r{|}always@r{]} --fdiagnostics-format=@r{[}text@r{|}sarif-stderr@r{|}sarif-file@r{|}json@r{|}json-stderr@r{|}json-file@r{]} +-fdiagnostics-format=@r{[}text@r{|}sarif-stderr@r{|}sarif-file@r{]} -fdiagnostics-add-output=@var{DIAGNOSTICS-OUTPUT-SPEC} -fdiagnostics-set-output=@var{DIAGNOSTICS-OUTPUT-SPEC} -fno-diagnostics-json-formatting @@ -322,6 +344,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 +356,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}. @@ -340,7 +366,7 @@ Objective-C and Objective-C++ Dialects}. -w -Wextra -Wall -Wabi=@var{n} -Waddress -Wno-address-of-packed-member -Waggregate-return -Walloc-size -Walloc-size-larger-than=@var{byte-size} -Walloc-zero --Walloca -Walloca-larger-than=@var{byte-size} +-Walloca -Walloca-larger-than=@var{byte-size} -Wauto-profile -Wno-aggressive-loop-optimizations -Warith-conversion -Warray-bounds -Warray-bounds=@var{n} -Warray-compare @@ -353,10 +379,10 @@ Objective-C and Objective-C++ Dialects}. -Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat -Wc11-c23-compat -Wc23-c2y-compat -Wc++-compat -Wc++11-compat -Wc++14-compat -Wc++17-compat --Wc++20-compat +-Wc++20-compat -Wc++26-compat -Wno-c++11-extensions -Wno-c++14-extensions -Wno-c++17-extensions -Wno-c++20-extensions -Wno-c++23-extensions --Wcalloc-transposed-args +-Wcalloc-transposed-args -Wcannot-profile -Wcast-align -Wcast-align=strict -Wcast-function-type -Wcast-qual -Wchar-subscripts -Wclobbered -Wcomment @@ -375,7 +401,7 @@ Objective-C and Objective-C++ Dialects}. -Werror -Werror=* -Wexpansion-to-defined -Wfatal-errors -Wflex-array-member-not-at-end -Wfloat-conversion -Wfloat-equal -Wformat -Wformat=2 --Wno-format-contains-nul -Wno-format-extra-args +-Wno-format-contains-nul -Wno-format-diag -Wno-format-extra-args -Wformat-nonliteral -Wformat-overflow=@var{n} -Wformat-security -Wformat-signedness -Wformat-truncation=@var{n} -Wformat-y2k -Wframe-address @@ -388,6 +414,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 @@ -419,7 +446,7 @@ Objective-C and Objective-C++ Dialects}. -Wsizeof-array-div -Wsizeof-pointer-div -Wsizeof-pointer-memaccess -Wstack-protector -Wstack-usage=@var{byte-size} -Wstrict-aliasing --Wstrict-aliasing=n -Wstrict-overflow -Wstrict-overflow=@var{n} +-Wstrict-aliasing=@var{n} -Wstrict-overflow -Wstrict-overflow=@var{n} -Wstring-compare -Wno-stringop-overflow -Wno-stringop-overread -Wno-stringop-truncation -Wstrict-flex-arrays @@ -433,7 +460,8 @@ Objective-C and Objective-C++ Dialects}. -Wunsuffixed-float-constants -Wunterminated-string-initialization -Wunused --Wunused-but-set-parameter -Wunused-but-set-variable +-Wunused-but-set-parameter -Wunused-but-set-parameter=@var{n} +-Wunused-but-set-variable -Wunused-but-set-variable=@var{n} -Wunused-const-variable -Wunused-const-variable=@var{n} -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-macros @@ -446,7 +474,9 @@ Objective-C and Objective-C++ Dialects}. -Wvolatile-register-var -Wwrite-strings -Wno-xor-used-as-pow -Wzero-as-null-pointer-constant --Wzero-length-bounds} +-Wzero-length-bounds +--all-warnings --extra-warnings --no-warnings +--pedantic --pedantic-errors} @item Static Analyzer Options @gccoptlist{ @@ -513,6 +543,7 @@ Objective-C and Objective-C++ Dialects}. -Wno-analyzer-tainted-divisor -Wno-analyzer-tainted-offset -Wno-analyzer-tainted-size +-Wno-analyzer-throw-of-unexpected-type -Wanalyzer-symbol-too-complex -Wanalyzer-too-complex -Wno-analyzer-undefined-behavior-ptrdiff @@ -533,7 +564,9 @@ Objective-C and Objective-C++ Dialects}. @gccoptlist{-Wbad-function-cast -Wdeprecated-non-prototype -Wfree-labels -Wmissing-declarations -Wmissing-parameter-name -Wmissing-parameter-type -Wdeclaration-missing-parameter-type -Wmissing-prototypes --Wmissing-variable-declarations -Wnested-externs -Wold-style-declaration +-Wmissing-variable-declarations +-Wmultiple-parameter-fwd-decl-lists +-Wnested-externs -Wold-style-declaration -Wold-style-definition -Wstrict-prototypes -Wtraditional -Wtraditional-conversion -Wdeclaration-after-statement -Wpointer-sign} @@ -560,7 +593,8 @@ Objective-C and Objective-C++ Dialects}. -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} -fno-eliminate-unused-debug-symbols -femit-class-debug-always -fno-merge-debug-strings -fno-dwarf2-cfi-asm --fvar-tracking -fvar-tracking-assignments} +-fvar-tracking -fvar-tracking-assignments -fvar-tracking-uninit +--debug} @item Optimization Options @xref{Optimize Options,,Options that Control Optimization}. @@ -572,29 +606,34 @@ Objective-C and Objective-C++ Dialects}. -fmin-function-alignment=[@var{n}] -fno-allocation-dce -fallow-store-data-races -fassociative-math -fauto-profile -fauto-profile[=@var{path}] --fauto-inc-dec -fbranch-probabilities +-fauto-profile-inlining -fauto-inc-dec -fbranch-probabilities -fcaller-saves -fcombine-stack-adjustments -fconserve-stack -ffold-mem-offsets -fcompare-elim -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules --fcx-limited-range +-fcx-limited-range -fcx-method -fdata-sections -fdce -fdelayed-branch --fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively --fdevirtualize-at-ltrans -fdse --fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects --ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} --ffinite-loops --fforward-propagate -ffp-contract=@var{style} -ffunction-sections +-fdelete-null-pointer-checks -fdep-fusion -fdevirtualize +-fdevirtualize-speculatively -fdevirtualize-at-ltrans -fdse +-fearly-inlining -fexcess-precision=@var{style} +-fexpensive-optimizations -fext-dce +-ffast-math -ffat-lto-objects -ffinite-loops +-ffinite-math-only -ffloat-store +-fforward-propagate -ffp-contract=@var{style} -ffp-int-builtin-inexact +-ffunction-sections -ffuse-ops-with-volatile-access -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity -fgcse-sm -fhoist-adjacent-loads -fif-conversion -fif-conversion2 -findirect-inlining --finline-stringops[=@var{fn}] --finline-functions -finline-functions-called-once -finline-limit=@var{n} --finline-small-functions -fipa-modref -fipa-cp -fipa-cp-clone +-finline-atomics -finline-functions -finline-functions-called-once +-finline-limit=@var{n} -finline-small-functions +-finline-stringops@r{[}=@var{fn}@r{]} +-fipa-modref -fipa-cp -fipa-cp-clone -fipa-bit-cp -fipa-vrp -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-reference-addressable -fipa-reorder-for-locality --fipa-stack-alignment -fipa-icf -fira-algorithm=@var{algorithm} +-fipa-sra -fipa-stack-alignment +-fipa-icf -fipa-icf-functions -fipa-icf-variables +-fira-algorithm=@var{algorithm} -flate-combine-instructions -flifetime-dse -flive-patching=@var{level} -fira-region=@var{region} -fira-hoist-pressure -fira-loop-pressure -fno-ira-share-save-slots @@ -609,7 +648,7 @@ Objective-C and Objective-C++ Dialects}. -flto-incremental-cache-size=@var{n} -fmalloc-dce -fmerge-all-constants -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmove-loop-stores -fno-branch-count-reg --fno-defer-pop -fno-fp-int-builtin-inexact -fno-function-cse +-fno-defer-pop -fno-function-cse -fno-guess-branch-probability -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 -fno-printf-return-value -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @@ -649,7 +688,7 @@ Objective-C and Objective-C++ Dialects}. -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize -ftree-loop-vectorize --ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta +-ftree-parallelize-loops[=@var{n}] -ftree-pre -ftree-partial-pre -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slsr -ftree-sra -ftree-switch-conversion -ftree-tail-merge -ftree-ter -ftree-vectorize -ftree-vrp -ftrivial-auto-var-init @@ -658,14 +697,14 @@ Objective-C and Objective-C++ Dialects}. -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb -fwhole-program -fwpa -fuse-linker-plugin -fzero-call-used-regs --param @var{name}=@var{value} --O -O0 -O1 -O2 -O3 -Os -Ofast -Og -Oz} +-O -O0 -O1 -O2 -O3 -Os -Ofast -Og -Oz --optimize} @item Program Instrumentation Options @xref{Instrumentation Options,,Program Instrumentation Options}. -@gccoptlist{-p -pg -fprofile-arcs --coverage -ftest-coverage +@gccoptlist{-p -pg -fprofile-arcs -coverage -ftest-coverage -fcondition-coverage -fpath-coverage --fprofile-abs-path +-fprofile -fprofile-abs-path -fprofile-dir=@var{path} -fprofile-generate -fprofile-generate=@var{path} -fprofile-info-section -fprofile-info-section=@var{name} -fprofile-note=@var{path} -fprofile-prefix-path=@var{path} @@ -693,13 +732,12 @@ Objective-C and Objective-C++ Dialects}. -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} -fprofile-prefix-map=@var{old}=@var{new} --fpatchable-function-entry=@var{N}@r{[},@var{M}@r{]}} +-fpatchable-function-entry=@var{N}@r{[},@var{M}@r{]} +--coverage --profile} @item Preprocessor Options @xref{Preprocessor Options,,Options Controlling the Preprocessor}. -@gccoptlist{-A@var{question}=@var{answer} --A-@var{question}@r{[}=@var{answer}@r{]} --C -CC -D@var{macro}@r{[}=@var{defn}@r{]} +@gccoptlist{-C -CC -D@var{macro}@r{[}=@var{defn}@r{]} -dD -dI -dM -dN -dU -fdebug-cpp -fdirectives-only -fdollars-in-identifiers -fexec-charset=@var{charset} -fextended-identifiers @@ -713,23 +751,39 @@ Objective-C and Objective-C++ Dialects}. -no-integrated-cpp -P -pthread -remap -traditional -traditional-cpp -trigraphs -U@var{macro} -undef --Wp,@var{option} -Xpreprocessor @var{option}} +-Wp,@var{option} -Xpreprocessor @var{option} +--comments --comments-in-macros +--define-macro=@var{macro}@r{[}=@var{defn}@r{]} +--dependencies --dump=@var{letters} +--imacros=@var{file} --include=@var{file} +--no-integrated-cpp --no-line-commands +--print-missing-file-dependencies +--traditional --traditional-cpp --trigraphs --trace-includes +--undefine-macro=@var{macro} +--user-dependencies --write-dependencies --write-user-dependencies +} @item Assembler Options @xref{Assembler Options,,Passing Options to the Assembler}. -@gccoptlist{-Wa,@var{option} -Xassembler @var{option}} +@gccoptlist{-Wa,@var{option} -Xassembler @var{option} +--for-assembler=@var{option}} @item Linker Options @xref{Link Options,,Options for Linking}. -@gccoptlist{@var{object-file-name} -fuse-ld=@var{linker} -l@var{library} +@gccoptlist{@var{object-file-name} -flink-libatomic -fuse-ld=@var{linker} -l@var{library} -nostartfiles -nodefaultlibs -nolibc -nostdlib -nostdlib++ --e @var{entry} --entry=@var{entry} +-e @var{entry} -pie -pthread -r -rdynamic -s -static -static-pie -static-libgcc -static-libstdc++ -static-libasan -static-libtsan -static-liblsan -static-libubsan -shared -shared-libgcc -symbolic -T @var{script} -Wl,@var{option} -Xlinker @var{option} --u @var{symbol} -z @var{keyword}} +-u @var{symbol} +-Tbss=@var{addr} -Tdata=@var{addr} -Ttext=@var{addr} +-N -n -t -Z -z @var{keyword} +--entry=@var{entry} --for-linker=@var{option} +--force-link=@var{symbol} --no-standard-library +--pie --static --static-pie --symbolic} @item Directory Options @xref{Directory Options,,Options for Directory Search}. @@ -739,9 +793,15 @@ Objective-C and Objective-C++ Dialects}. -iplugindir=@var{dir} -iprefix @var{file} -iquote @var{dir} -isysroot @var{dir} -isystem @var{dir} -iwithprefix @var{dir} -iwithprefixbefore @var{dir} ---embed-dir=@var{dir} -L@var{dir} -no-canonical-prefixes --no-sysroot-suffix --nostdinc -nostdinc++ --sysroot=@var{dir}} +-nostdinc -nostdinc++ +--embed-dir=@var{dir} --embed-directory=@var{dir} +--include-barrier --include-directory=@var{dir} +--include-directory-after=@var{dir} --include-prefix=@var{prefix} +--include-with-prefix=@var{prefix} --include-with-prefix-after=@var{prefix} +--include-with-prefix-before=@var{prefix} +--no-canonical-prefixes --no-standard-includes +--prefix=@var{prefix} --sysroot=@var{dir}} @item Code Generation Options @xref{Code Gen Options,,Options for Code Generation Conventions}. @@ -762,7 +822,8 @@ Objective-C and Objective-C++ Dialects}. -ftrapv -fwrapv -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} -fstrict-volatile-bitfields -fsync-libcalls --fzero-init-padding-bits=@var{value}} +-fzero-init-padding-bits=@var{value} +-Qy -Qn} @item Developer Options @xref{Developer Options,,GCC Developer Options}. @@ -778,6 +839,7 @@ Objective-C and Objective-C++ Dialects}. -fdump-debug -fdump-earlydebug -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links -fdump-final-insns@r{[}=@var{file}@r{]} +-fdump-internal-locations -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline -fdump-lang-all -fdump-lang-@var{switch} @@ -804,9 +866,17 @@ Objective-C and Objective-C++ Dialects}. -fvar-tracking-assignments-toggle -gtoggle -print-file-name=@var{library} -print-libgcc-file-name -print-multi-directory -print-multi-lib -print-multi-os-directory +-print-multiarch -print-prog-name=@var{program} -print-search-dirs -Q -print-sysroot -print-sysroot-headers-suffix --save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}} +-save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]} +--dump=@var{letters} +--print-file-name=@var{library} --print-libgcc-file-file-name +--print-multi-directory --print-multi-lib --print-multi-os-directory +--print-multiarch --print-prog-name=@var{program} +--print-search-dirs --print-sysroot --print-sysroot-headers-suffix +--save-temps +} @item Machine-Dependent Options @xref{Submodel Options,,Machine-Dependent Options}. @@ -816,36 +886,41 @@ Objective-C and Objective-C++ Dialects}. @emph{AArch64 Options} (@ref{AArch64 Options}) @gccoptlist{-mabi=@var{name} -mbig-endian -mlittle-endian +-menable-sysreg-checking -mgeneral-regs-only -mcmodel=tiny -mcmodel=small -mcmodel=large --mstrict-align -mno-strict-align --momit-leaf-frame-pointer +-mstrict-align -momit-leaf-frame-pointer -mtls-dialect=desc -mtls-dialect=traditional --mtls-size=@var{size} +-mtls-size=@var{size} -mtp=@var{name} -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 -mlow-precision-recip-sqrt -mlow-precision-sqrt -mlow-precision-div +-mmax-vectorization -mautovec-preference=@var{name} -mpc-relative-literal-loads -msign-return-address=@var{scope} --mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf} -+@var{b-key}]|@var{bti}|@var{gcs} +-mbranch-protection=@var{features} -mharden-sls=@var{opts} -march=@var{name} -mcpu=@var{name} -mtune=@var{name} --moverride=@var{string} -mverbose-cost-dump --mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{sysreg} --mstack-protector-guard-offset=@var{offset} -mtrack-speculation --moutline-atomics -mearly-ldp-fusion -mlate-ldp-fusion --Wexperimental-fmv-target} +-moverride=@var{string} +-mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{sysreg} +-mstack-protector-guard-offset=@var{offset} -mtrack-speculation +-moutline-atomics -mearly-ra -mearly-ldp-fusion -mlate-ldp-fusion +-msve-vector-bits=@var{bits}} @emph{Adapteva Epiphany Options} (@ref{Adapteva Epiphany Options}) @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} -mround-nearest -mlong-calls -mshort-calls -msmall16 --mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} +-mfp-mode=@var{mode} -mmay-round-for-trunc -mfp-iarith +-mvect-double -max-vect-align=@var{num} -msplit-vecmove-early -m1reg-@var{reg}} @emph{AMD GCN Options} (@ref{AMD GCN Options}) -@gccoptlist{-march=@var{gpu} -mtune=@var{gpu} -mstack-size=@var{bytes}} +@gccoptlist{-march=@var{gpu} -mtune=@var{gpu} +-mgang-private-size=@var{bytes} +-msram-ecc=@r{[}on@r{|}off@r{|}any@r{]} +-mxnack=@r{[}on@r{|}off@r{|}any@r{]} +-Wopenacc-dims} @emph{ARC Options} (@ref{ARC Options}) @gccoptlist{-mbarrel-shifter -mjli-always @@ -868,27 +943,22 @@ Objective-C and Objective-C++ Dialects}. -mdiv-rem -mcode-density -mll64 -mfpu=@var{fpu} -mrf16 -mbranch-index} @emph{ARM Options} (@ref{ARM Options}) -@gccoptlist{-mapcs-frame -mno-apcs-frame +@gccoptlist{-mapcs-frame -mapcs -mabi=@var{name} --mapcs-stack-check -mno-apcs-stack-check --mapcs-reentrant -mno-apcs-reentrant --mgeneral-regs-only --msched-prolog -mno-sched-prolog +-mgeneral-regs-only -mno-sched-prolog -mlittle-endian -mbig-endian -mbe8 -mbe32 -mfloat-abi=@var{name} -mfp16-format=@var{name} --mthumb-interwork -mno-thumb-interwork --mcpu=@var{name} -march=@var{name} -mfpu=@var{name} --mtune=@var{name} -mprint-tune-info +-mthumb-interwork +-mcpu=@var{name} -march=@var{name} -mfpu=@var{name} -mtune=@var{name} -mstructure-size-boundary=@var{n} --mabort-on-noreturn --mlong-calls -mno-long-calls --msingle-pic-base -mno-single-pic-base --mpic-register=@var{reg} +-mabort-on-noreturn -mlong-calls +-msingle-pic-base -mpic-register=@var{reg} +-mpic-data-is-text-relative -mnop-fun-dllimport -mpoke-function-name --mthumb -marm -mflip-thumb +-mthumb -marm -mtpcs-frame -mtpcs-leaf-frame -mcaller-super-interworking -mcallee-super-interworking -mtp=@var{name} -mtls-dialect=@var{dialect} @@ -897,23 +967,21 @@ Objective-C and Objective-C++ Dialects}. -mfix-cortex-a57-aes-1742098 -mfix-cortex-a72-aes-1655431 -munaligned-access --mneon-for-64bits -mslow-flash-data -masm-syntax-unified -mrestrict-it --mverbose-cost-dump -mpure-code -mcmse -mfix-cmse-cve-2021-35465 --mstack-protector-guard=@var{guard} -mstack-protector-guard-offset=@var{offset} +-mstack-protector-guard=@var{guard} +-mstack-protector-guard-offset=@var{offset} -mfdpic --mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}] -[+@var{bti}]|@var{bti}[+@var{pac-ret}[+@var{leaf}]]} +-mbranch-protection=@var{features}} @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 @@ -923,18 +991,18 @@ Objective-C and Objective-C++ Dialects}. @emph{Blackfin Options} (@ref{Blackfin Options}) @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} --msim -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer --mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly --mlow-64k -mno-low64k -mstack-check-l1 -mid-shared-library --mno-id-shared-library -mshared-library-id=@var{n} --mleaf-id-shared-library -mno-leaf-id-shared-library --msep-data -mno-sep-data -mlong-calls -mno-long-calls +-msim -momit-leaf-frame-pointer +-mspecld-anomaly -mcsync-anomaly +-mlow-64k -mstack-check-l1 -mid-shared-library +-mleaf-id-shared-library +-mshared-library-id=@var{n} +-msep-data -mlong-calls -mfast-fp -minline-plt -mmulticore -mcorea -mcoreb -msdram -micplb} @emph{C6X Options} (@ref{C6X Options}) @gccoptlist{-mbig-endian -mlittle-endian -march=@var{cpu} --msim -msdata=@var{sdata-type}} +-msim -msdata=@var{sdata-type} -mdsbt -mlong-calls} @emph{CRIS Options} (@ref{CRIS Options}) @gccoptlist{-mcpu=@var{cpu} -march=@var{cpu} @@ -942,51 +1010,57 @@ Objective-C and Objective-C++ Dialects}. -metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects -mstack-align -mdata-align -mconst-align -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue --melf -maout -sim -sim2 --mmul-bug-workaround -mno-mul-bug-workaround} +-mbest-lib-options -moverride-best-lib-options +-mtrap-using-break8 -mtrap-unaligned-atomic +-munaligned-atomic-may-use-library +-sim -sim2 +-mmul-bug-workaround} @emph{C-SKY Options} (@ref{C-SKY Options}) @gccoptlist{-march=@var{arch} -mcpu=@var{cpu} --mbig-endian -EB -mlittle-endian -EL --mhard-float -msoft-float -mfpu=@var{fpu} -mdouble-float -mfdivdu +-mbig-endian -mlittle-endian +-mfpu=@var{fpu} -mdouble-float -mfdivdu -mfloat-abi=@var{name} -melrw -mistack -mmp -mcp -mcache -msecurity -mtrust -mdsp -medsp -mvdsp -mdiv -msmart -mhigh-registers -manchor -mpushpop -mmultiple-stld -mconstpool -mstack-size -mccrt --mbranch-cost=@var{n} -mcse-cc -msched-prolog -msim} +-mbranch-cost=@var{n} -msched-prolog -msim} @emph{Cygwin and MinGW Options} (@ref{Cygwin and MinGW Options}) @gccoptlist{-mconsole -mcrtdll=@var{library} -mdll --mnop-fun-dllimport -mthread --municode -mwin32 -mwindows -fno-set-stack-executable} +-mnop-fun-dllimport -mthreads +-municode -mwin32 -mwindows -fno-set-stack-executable +-fwritable-relocated-rdata -mpe-aligned-commons} @emph{Darwin Options} (@ref{Darwin Options}) -@gccoptlist{-all_load -allowable_client -arch -arch_errors_fatal --arch_only -bind_at_load -bundle -bundle_loader +@gccoptlist{-all_load -allowable_client -arch @var{name} +-arch_errors_fatal -asm_macosx_version_min=@var{version} +-bind_at_load -bundle -bundle_loader -client_name -compatibility_version -current_version -dead_strip --dependency-file -dylib_file -dylinker_install_name +-dependency-file -dylib_file -dylinker -dylinker_install_name -dynamic -dynamiclib -exported_symbols_list --filelist -flat_namespace -force_cpusubtype_ALL --force_flat_namespace -headerpad_max_install_names --iframework --image_base -init -install_name -keep_private_externs --multi_module -multiply_defined -multiply_defined_unused --noall_load -no_dead_strip_inits_and_terms -nodefaultrpaths --nofixprebinding -nomultidefs -noprebind -noseglinkedit --pagezero_size -prebind -prebind_all_twolevel_modules --private_bundle -read_only_relocs -sectalign --sectobjectsymbols -whyload -seg1addr --sectcreate -sectobjectsymbols -sectorder --segaddr -segs_read_only_addr -segs_read_write_addr --seg_addr_table -seg_addr_table_filename -seglinkedit +-fapple-kext -fconstant-cfstrings -ffix-and-continue +-filelist -findirect-data -flat_namespace -force_cpusubtype_ALL +-force_flat_namespace -framework @var{name} -gfull -gused +-headerpad_max_install_names -iframework +-image_base -init @var{symbol-name} -install_name -keep_private_externs +-matt-stubs -mconstant-cfstrings -mdynamic-no-pic +-mfix-and-continue -mkernel -mmacosx-version-min=@var{version} +-mone-byte-bool -msymbol-stubs -mtarget-linker@r{[}=@r{]}@var{version} +-nodefaultexport -nodefaultrpaths +-pagezero_size -preload -read_only_relocs +-sectalign -sectcreate +-seg_addr_table +-seg1addr -segaddr -segprot -segs_read_only_addr -segs_read_write_addr --single_module -static -sub_library -sub_umbrella --twolevel_namespace -umbrella -undefined --unexported_symbols_list -weak_reference_mismatches --whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} --mkernel -mone-byte-bool} +-sub_library -sub_umbrella +-twolevel_namespace -twolevel_namespace_hints +-umbrella -undefined -unexported_symbols_list +-weak_framework @var{name} -weak_reference_mismatches +-whatsloaded -whyload +-F -ObjC -ObjC++ -Wnonportable-cfstrings} @emph{DEC Alpha Options} (@ref{DEC Alpha Options}) @gccoptlist{-mno-fp-regs -msoft-float @@ -999,38 +1073,36 @@ Objective-C and Objective-C++ Dialects}. -mfloat-vax -mfloat-ieee -mexplicit-relocs -msmall-data -mlarge-data -msmall-text -mlarge-text --mmemory-latency=@var{time}} +-mmemory-latency=@var{time} +-mtls-kernel -mtls-size=@var{bitsize} +-mlong-double-128 -mlong-double-64} @emph{eBPF Options} (@ref{eBPF Options}) -@gccoptlist{-mbig-endian -mlittle-endian --mframe-limit=@var{bytes} -mxbpf -mco-re -mno-co-re -mjmpext --mjmp32 -malu32 -mv3-atomics -mbswap -msdiv -msmov -mcpu=@var{version} --masm=@var{dialect} -minline-memops-threshold=@var{bytes}} +@gccoptlist{-mbig-endian -mlittle-endian +-mframe-limit=@var{bytes} -mxbpf -mco-re -mjmpext -mjmp32 +-malu32 -mv3-atomics -mbswap -msdiv -msmov -mcpu=@var{version} +-masm=@var{dialect} -minline-memops-threshold=@var{bytes}} @emph{FR30 Options} (@ref{FR30 Options}) @gccoptlist{-msmall-model -mno-lsim} -@emph{FT32 Options} (@ref{FT32 Options}) -@gccoptlist{-msim -mlra -mnodiv -mft32b -mcompress -mnopm} - @emph{FRV Options} (@ref{FRV Options}) @gccoptlist{-mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 -mhard-float -msoft-float --malloc-cc -mfixed-cc -mdword -mno-dword --mdouble -mno-double --mmedia -mno-media -mmuladd -mno-muladd +-malloc-cc -mfixed-cc -mdword -mdouble -mmedia -mmuladd -mfdpic -minline-plt -mgprel-ro -multilib-library-pic -mlinked-fp -mlong-calls -malign-labels -mlibrary-pic -macc-4 -macc-8 --mpack -mno-pack -mno-eflags -mcond-move -mno-cond-move --moptimize-membar -mno-optimize-membar --mscc -mno-scc -mcond-exec -mno-cond-exec --mvliw-branch -mno-vliw-branch --mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec --mno-nested-cond-exec -mtomcat-stats +-mpack -mno-eflags -mno-cond-move +-mno-optimize-membar -mno-scc -mno-cond-exec +-mno-vliw-branch -mno-multi-cond-exec -mno-nested-cond-exec +-mtomcat-stats -mTLS -mtls -mcpu=@var{cpu}} +@emph{FT32 Options} (@ref{FT32 Options}) +@gccoptlist{-msim -mnodiv -mft32b -mcompress -mnopm} + @emph{GNU/Linux Options} (@ref{GNU/Linux Options}) @gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid -tno-android-cc -tno-android-ld} @@ -1086,7 +1158,7 @@ Objective-C and Objective-C++ Dialects}. -mfpu=@var{fpu-type} -msimd=@var{simd-type} -msoft-float -msingle-float -mdouble-float -mlsx -mno-lsx -mlasx -mno-lasx -mbranch-cost=@var{n} -maddr-reg-reg-cost=@var{n} -mcheck-zero-division --mno-check-zero-division +-mno-check-zero-division -mbreak-code=@var{code} -mcond-move-int -mno-cond-move-int -mcond-move-float -mno-cond-move-float -memcpy -mno-memcpy -mstrict-align -mno-strict-align -G @var{num} @@ -1096,7 +1168,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}} @@ -1257,7 +1330,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} @@ -1267,7 +1340,7 @@ See RS/6000 and PowerPC Options. -mfence-tso -mno-fence-tso -mdiv -mno-div -misa-spec=@var{ISA-spec-string} --march=@var{ISA-string} +-march=@var{ISA-string|Profiles|Profiles_ISA-string|CPU/processor string} -mtune=@var{processor-string} -mpreferred-stack-boundary=@var{num} -msmall-data-limit=@var{N-bytes} @@ -1430,7 +1503,7 @@ See RS/6000 and PowerPC Options. -mfix-at697f -mfix-ut699 -mfix-ut700 -mfix-gr712rc} @emph{System V Options} (@ref{System V Options}) -@gccoptlist{-Qy -Qn -YP,@var{paths} -Ym,@var{dir}} +@gccoptlist{-YP,@var{paths} -Ym,@var{dir}} @emph{V850 Options} (@ref{V850 Options}) @gccoptlist{-mlong-calls -mno-long-calls -mep -mno-ep @@ -1495,8 +1568,7 @@ See RS/6000 and PowerPC Options. -mamx-tile -mamx-int8 -mamx-bf16 -muintr -mhreset -mavxvnni -mamx-fp8 -mavx512fp16 -mavxifma -mavxvnniint8 -mavxneconvert -mcmpccxadd -mamx-fp16 -mprefetchi -mraoint -mamx-complex -mavxvnniint16 -msm3 -msha512 -msm4 -mapxf --musermsr -mavx10.1 -mavx10.1-256 -mavx10.1-512 -mevex512 -mavx10.2 --mamx-avx512 -mamx-tf32 -mamx-transpose -mmovrs -mamx-movrs +-musermsr -mavx10.1 -mavx10.2 -mamx-avx512 -mamx-tf32 -mmovrs -mamx-movrs -mcldemote -mms-bitfields -mno-align-stringops -minline-all-stringops -minline-stringops-dynamically -mstringop-strategy=@var{alg} -mkl -mwidekl @@ -1694,10 +1766,13 @@ Any file name with no recognized suffix is treated this way. @end table @opindex x +@opindex language You can specify the input language explicitly with the @option{-x} option: @table @gcctabopt @item -x @var{language} +@itemx --language=@var{language} +@itemx --language @var{language} Specify explicitly the @var{language} for the following input files (rather than letting the compiler choose a default based on the file name suffix). This option applies to all following input files until @@ -1733,7 +1808,9 @@ one of the options @option{-c}, @option{-S}, or @option{-E} to say where @table @gcctabopt @opindex c +@opindex compile @item -c +@itemx --compile Compile or assemble the source files, but do not link. The linking stage simply is not done. The ultimate output is in the form of an object file for each source file. @@ -1745,7 +1822,9 @@ Unrecognized input files, not requiring compilation or assembly, are ignored. @opindex S +@opindex assemble @item -S +@itemx --assemble Stop after the stage of compilation proper; do not assemble. The output is in the form of an assembler code file for each non-assembler input file specified. @@ -1756,7 +1835,9 @@ replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}. Input files that don't require compilation are ignored. @opindex E +@opindex preprocess @item -E +@itemx --preprocess Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output. @@ -1765,7 +1846,10 @@ Input files that don't require preprocessing are ignored. @cindex output file option @opindex o +@opindex output @item -o @var{file} +@itemx --output=@var{file} +@itemx --output @var{file} Place the primary output in file @var{file}. This applies to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code. @@ -1837,6 +1921,7 @@ by the options @option{-dumpbase}, @option{-dumpbase-ext}, @opindex dumpbase @item -dumpbase @var{dumpbase} +@item --dumpbase @var{dumpbase} This option sets the base name for auxiliary and dump output files. It does not affect the name of the primary output file. Intermediate outputs, when preserved, are not regarded as primary outputs, but as @@ -1926,6 +2011,7 @@ auxiliary files. @opindex dumpbase-ext @item -dumpbase-ext @var{auxdropsuf} +@itemx --dumpbase-ext @var{auxdropsuf} When forming the name of an auxiliary (but not a dump) output file, drop trailing @var{auxdropsuf} from @var{dumpbase} before appending any suffixes. If not specified, this option defaults to the suffix of a @@ -1960,6 +2046,7 @@ the auxiliary and dump outputs by using the executable name minus @opindex dumpdir @item -dumpdir @var{dumppfx} +@itemx --dumpdir @var{dumppfx} When forming the name of an auxiliary or dump output file, use @var{dumppfx} as a prefix: @@ -2087,7 +2174,9 @@ component so that it overrides any @option{-dumpdir}, and passes that as @option{-dumpbase} to sub-compilers. @opindex v +@opindex verbose @item -v +@itemx --verbose Print (on standard error output) the commands executed to run the stages of compilation. Also print the version number of the compiler driver program and of the preprocessor and the compiler proper. @@ -2240,6 +2329,7 @@ Display the version number and copyrights of the invoked GCC@. @opindex pass-exit-codes @item -pass-exit-codes +@itemx --pass-exit-codes Normally the @command{gcc} program exits with the code of 1 if any phase of the compiler returns a non-success return code. If you specify @option{-pass-exit-codes}, the @command{gcc} program instead returns with @@ -2249,6 +2339,7 @@ compiler error is encountered. @opindex pipe @item -pipe +@itemx --pipe Use pipes rather than temporary files for communication between the various stages of compilation. This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has @@ -2256,6 +2347,8 @@ no trouble. @opindex specs @item -specs=@var{file} +@itemx --specs=@var{file} +@itemx --specs @var{file} Process @var{file} after the compiler reads in the standard @file{specs} file, in order to override the defaults which the @command{gcc} driver program uses when determining what switches to pass to @command{cc1}, @@ -2318,6 +2411,7 @@ Define an argument called @var{key} with a value of @var{value} for the plugin called @var{name}. @opindex fdump-ada-spec +@opindex fdump-ada-spec-slim @item -fdump-ada-spec@r{[}-slim@r{]} For C and C++ source and include files, generate corresponding Ada specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn, @@ -2392,6 +2486,7 @@ accepts: @cindex ISO support @opindex ansi @item -ansi +@itemx --ansi In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is equivalent to @option{-std=c++98}. @@ -2439,8 +2534,8 @@ ISO C99. This standard is substantially completely supported, modulo bugs and floating-point issues (mainly but not entirely relating to optional C99 features from Annexes F and G). See -@w{@uref{https://gcc.gnu.org/c99status.html}} for more information. The -names @samp{c9x} and @samp{iso9899:199x} are deprecated. +@w{@uref{https://gcc.gnu.org/projects/c-status.html}} for more information. +The names @samp{c9x} and @samp{iso9899:199x} are deprecated. @item c11 @itemx c1x @@ -2535,21 +2630,21 @@ The name @samp{c++1z} is deprecated. @item gnu++17 @itemx gnu++1z GNU dialect of @option{-std=c++17}. -This is the default for C++ code. The name @samp{gnu++1z} is deprecated. @item c++20 @itemx c++2a The 2020 ISO C++ standard plus amendments. -Support is experimental, and could change in incompatible ways in -future releases. +C++20 modules support is still experimental and needs to be +enabled with @option{-fmodules} option. The name @samp{c++2a} is deprecated. @item gnu++20 @itemx gnu++2a GNU dialect of @option{-std=c++20}. -Support is experimental, and could change in incompatible ways in -future releases. +This is the default for C++ code. +C++20 modules support is still experimental and needs to be +enabled with @option{-fmodules} option. The name @samp{gnu++2a} is deprecated. @item c++23 @@ -2930,6 +3025,15 @@ Here is a list of options that are @emph{only} for compiling C++ programs: @table @gcctabopt +@opindex compile-std-module +@item --compile-std-module +Build the compiled module interfaces (@pxref{C++ Modules}) for the +@samp{<bits/stdc++.h>} header unit and the @samp{std} and +@samp{std.compat} modules before compiling any source files explicitly +specified on the command line. This is intended to be useful for +building simple programs that use @samp{import std;} with a single +command. + @opindex fabi-version @item -fabi-version=@var{n} Use version @var{n} of the C++ ABI@. The default is version 0. @@ -3005,12 +3109,19 @@ in C++14 and up. Version 18, which first appeared in G++ 13, fixes manglings of lambdas that have additional context. -Version 19, which first appeared in G++ 14, fixes manglings of structured -bindings to include ABI tags. +Version 19, which first appeared in G++ 14, fixes manglings of +structured bindings to include ABI tags, handling of cv-qualified +[[no_unique_address]] members, and adds mangling of C++20 constraints +on function templates. 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), 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}. @opindex fabi-compat-version @@ -3038,6 +3149,7 @@ around bugs in the access control code. @opindex faligned-new @item -faligned-new +@itemx -faligned-new=@var{alignment} Enable support for C++17 @code{new} of types that require more alignment than @code{void* ::operator new(std::size_t)} provides. A numeric argument such as @code{-faligned-new=32} can be used to @@ -3153,6 +3265,11 @@ into the standard, could additionally be enabled by in GCC 14 and removed in GCC 15; users are expected to convert their code to C++20 concepts. +@opindex fconcepts-diagnostics-depth +@item -fconcepts-diagnostics-depth=@var{n} +Specify maximum error replay depth during recursive diagnosis of a constraint +satisfaction failure. The default is 1. + @opindex fconstexpr-depth @item -fconstexpr-depth=@var{n} Set the maximum nested evaluation depth for C++11 constexpr functions @@ -3224,37 +3341,38 @@ used together. @table @gcctabopt @opindex fcontract-mode -@item -fcontract-mode=[on|off] +@item -fcontract-mode=@r{[}on@r{|}off@r{]} Control whether any contracts have any semantics at all. Defaults to on. @opindex fcontract-assumption-mode -@item -fcontract-assumption-mode=[on|off] +@item -fcontract-assumption-mode=@r{[}on@r{|}off@r{]} [N4820] Control whether contracts with level @samp{axiom} should have the assume semantic. Defaults to on. @opindex fcontract-build-level -@item -fcontract-build-level=[off|default|audit] +@item -fcontract-build-level=@r{[}off@r{|}default@r{|}audit@r{]} [N4820] Specify which level of contracts to generate checks for. Defaults to @samp{default}. @opindex fcontract-continuation-mode -@item -fcontract-continuation-mode=[on|off] +@item -fcontract-continuation-mode=@r{[}on@r{|}off@r{]} [N4820] Control whether to allow the program to continue executing after a contract violation. That is, do checked contracts have the @samp{maybe} semantic described below rather than the @samp{never} semantic. Defaults to off. @opindex fcontract-role -@item -fcontract-role=<name>:<default>,<audit>,<axiom> +@item -fcontract-role=@var{name}:@var{default},@var{audit},@var{axiom} [P1332] Specify the concrete semantics for each contract level of a particular contract role. -@item -fcontract-semantic=[default|audit|axiom]:<semantic> +@opindex fcontract-semantic +@item -fcontract-semantic=@r{[}default@r{|}audit@r{|}axiom@r{]}:@var{semantic} [P1429] Specify the concrete semantic for a particular contract level. @opindex fcontract-strict-declarations -@item -fcontract-strict-declarations=[on|off] +@item -fcontract-strict-declarations=@r{[}on@r{|}off@r{]} Control whether to reject adding contracts to a function after its first declaration. Defaults to off. @end table @@ -3283,13 +3401,59 @@ called. If the handler returns, execution continues normally. @opindex fcoroutines @item -fcoroutines -Enable support for the C++ coroutines extension (experimental). +Enable support for the C++ coroutines extension. With @option{-std=c++20} +and above, coroutines are part of the language standard, so +@option{-fcoroutines} defaults to on. @opindex fdiagnostics-all-candidates @item -fdiagnostics-all-candidates Permit the C++ front end to note all candidates during overload resolution failure, including when a deleted function is selected. +@item -fdump-lang- +@itemx -fdump-lang-@var{switch} +@itemx -fdump-lang-@var{switch}-@var{options} +@itemx -fdump-lang-@var{switch}-@var{options}=@var{filename} +Control the dumping of C++-specific information. The @var{options} +and @var{filename} portions behave as described in the +@option{-fdump-tree} option. The following @var{switch} values are +accepted: + +@table @samp +@item all +Enable all of the below. + +@opindex fdump-lang-class +@item class +Dump class hierarchy information. Virtual table information is emitted +unless '@option{slim}' is specified. + +@opindex fdump-lang-module +@item module +Dump module information. Options @option{lineno} (locations), +@option{graph} (reachability), @option{blocks} (clusters), +@option{uid} (serialization), @option{alias} (mergeable), +@option{asmname} (Elrond), @option{eh} (mapper) & @option{vops} +(macros) may provide additional information. + +@opindex fdump-lang-raw +@item raw +Dump the raw internal tree data. + +@opindex fdump-lang-tinst +@item tinst +Dump the sequence of template instantiations, indented to show the +depth of recursion. The @option{lineno} option adds the source +location where the instantiation was triggered, and the +@option{details} option also dumps pre-instantiation substitutions +such as those performed during template argument deduction. + +Lines in the .tinst dump start with @samp{I} for an instantiation, +@samp{S} for another substitution, and @samp{R[IS]} for the reopened +context of a deferred instantiation. + +@end table + @opindex fno-elide-constructors @opindex felide-constructors @item -fno-elide-constructors @@ -3341,7 +3505,8 @@ aliases, the default is @option{-fno-extern-tls-init}. @item -ffold-simple-inlines @itemx -fno-fold-simple-inlines Permit the C++ frontend to fold calls to @code{std::move}, @code{std::forward}, -@code{std::addressof} and @code{std::as_const}. In contrast to inlining, this +@code{std::addressof}, @code{std::to_underlying} +and @code{std::as_const}. In contrast to inlining, this means no debug information will be generated for such calls. Since these functions are rarely interesting to debug, this flag is enabled by default unless @option{-fno-inline} is active. @@ -3764,6 +3929,23 @@ Warn when a type with an ABI tag is used in a context that does not have that ABI tag. See @ref{C++ Attributes} for more information about ABI tags. +@opindex Wabbreviated-auto-in-template-arg +@opindex Wno-abbreviated-auto-in-template-arg +@item -Wno-abbreviated-auto-in-template-arg +Disable the error for an @code{auto} placeholder type used within a +template argument list to declare a C++20 abbreviated function +template, e.g. + +@smallexample +void f(S<auto>); +@end smallexample + +This feature was proposed in the Concepts TS, but was not adopted into +C++20; in the standard, a placeholder in a parameter declaration must +appear as a decl-specifier. The error can also be reduced to a +warning by @option{-fpermissive} or +@option{-Wno-error=abbreviated-auto-in-template-arg}. + @opindex Wcomma-subscript @opindex Wno-comma-subscript @item -Wcomma-subscript @r{(C++ and Objective-C++ only)} @@ -3917,8 +4099,12 @@ by @option{-Wall}. Warn that the implicit declaration of a copy constructor or copy assignment operator is deprecated if the class has a user-provided copy constructor or copy assignment operator, in C++11 and up. This -warning is enabled by @option{-Wextra}. With -@option{-Wdeprecated-copy-dtor}, also deprecate if the class has a +warning is enabled by @option{-Wextra}. + +@opindex Wdeprecated-copy-dtor +@opindex Wno-deprecated-copy-dtor +@item -Wdeprecated-copy-dtor @r{(C++ and Objective-C++ only)} +Similar to @option{-Wdeprecated-copy}, but also deprecate if the class has a user-provided destructor. @opindex Wdeprecated-enum-enum-conversion @@ -4396,6 +4582,20 @@ to filter out those warnings. Disable the warning about the case when an exception handler is shadowed by another handler, which can point out a wrong ordering of exception handlers. +@opindex Wsfinae-incomplete +@opindex Wno-sfinae-incomplete +Warn about a class that is found to be incomplete, or a function with +auto return type that has not yet been deduced, in a context where +that causes substitution failure rather than an error, and then the +class or function is defined later in the translation unit. This is +problematic because template instantiations or concept checks could +have different results if they first occur either before or after the +definition. + +This warning is enabled by default. @option{-Wsfinae-incomplete=2} +adds a warning at the point of substitution failure, to make it easier +to track down problems flagged by the default mode. + @opindex Wstrict-null-sentinel @opindex Wno-strict-null-sentinel @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)} @@ -4405,6 +4605,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)} @@ -4643,6 +4865,55 @@ The presence of an explicit instantiation silences the warning. This flag is enabled by @option{-Wextra}. +@opindex Wexpose-global-module-tu-local +@opindex Wno-expose-global-module-tu-local +@item -Wno-expose-global-module-tu-local +An exposure of a translation-unit-local entity from a module interface is +invalid, as this may cause ODR violations and manifest in link errors or other +unexpected behaviour. However, many existing libraries declare TU-local +entities in their interface, and avoiding exposures of these entities may be +difficult in some cases. + +As an extension, GCC allows exposures of internal variables and functions that +were declared in the global module fragment. This warning indicates when such +an invalid exposure has occurred, and can be silenced using diagnostic pragmas +either at the site of the exposure, or at the point of declaration of the +internal declaration. + +When combined with @option{-Wtemplate-names-tu-local}, GCC will also warn about +non-exposure references to TU-local entities in template bodies. Such templates +can still be instantiated in other TUs but the above risks regarding exposures +of translation-unit-local entities apply. + +This warning is enabled by default, and is upgraded to an error by +@option{-pedantic-errors}. + +@opindex Wexternal-tu-local +@opindex Wno-external-tu-local +@item -Wno-external-tu-local +Warn when naming a TU-local entity outside of the translation unit it +was declared in. Such declarations will be ignored during name lookup. +This can occur when performing ADL from a template declared in the same +TU as the internal function: + +@smallexample +export module M; +template <typename T> void foo(T t) @{ + bar(t); +@} +struct S @{@} s; +static void bar(S) @{@} // internal linkage + +// instantiating foo(s) from outside this TU can see ::bar, +// but naming it there is ill-formed. +@end smallexample + +This can be worked around by making @code{bar} attached to the global +module, using @code{extern "C++"}. + +This warning is enabled by default, and is upgraded to an error by +@option{-pedantic-errors}. + @opindex Wterminate @opindex Wno-terminate @item -Wno-terminate @r{(C++ and Objective-C++ only)} @@ -4705,6 +4976,7 @@ Enabled by default with @option{-std=c++20}. Before @opindex Waligned-new @opindex Wno-aligned-new @item -Waligned-new +@itemx -Waligned-new=@r{[}none@r{|}global@r{|}all@r{]} Warn about a new-expression of a type that requires greater alignment than the @code{alignof(std::max_align_t)} but uses an allocation function without an explicit alignment parameter. This option is @@ -5331,6 +5603,7 @@ Note - this option also affects the display of the @samp{#error} and function/type/variable attribute. It does not however affect the @samp{pragma GCC warning} and @samp{pragma GCC error} pragmas. +@opindex fdiagnostics-plain-output @item -fdiagnostics-plain-output This option requests that diagnostic output look as plain as possible, which may be useful when running @command{dejagnu} or other utilities that need to @@ -5343,7 +5616,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. @@ -5680,6 +5954,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 @@ -5892,8 +6182,7 @@ column numbers, such as @command{dejagnu}. @opindex fdiagnostics-column-unit @item -fdiagnostics-column-unit=@var{UNIT} Select the units for the column number. This affects traditional diagnostics -(in the absence of @option{-fno-show-column}), as well as JSON format -diagnostics if requested. +(in the absence of @option{-fno-show-column}). The default @var{UNIT}, @samp{display}, considers the number of display columns occupied by each character. This may be larger than the number @@ -5966,11 +6255,47 @@ 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 +@opindex fdiagnostics-format=text +@opindex fdiagnostics-format=sarif-stderr +@opindex fdiagnostics-format=sarif-file @item -fdiagnostics-format=@var{FORMAT} Select a different format for printing diagnostics. -@var{FORMAT} is @samp{text}, @samp{sarif-stderr}, @samp{sarif-file}, -@samp{json}, @samp{json-stderr}, or @samp{json-file}. +@var{FORMAT} is @samp{text}, @samp{sarif-stderr} or @samp{sarif-file}. Using this option replaces any additional ``output sinks'' added by @option{-fdiagnostics-add-output=}, or that set by @@ -5978,18 +6303,12 @@ Using this option replaces any additional ``output sinks'' added by The default is @samp{text}. +@cindex diagnostic output formats, sarif-stderr +@cindex diagnostic output formats, sarif-file The @samp{sarif-stderr} and @samp{sarif-file} formats both emit diagnostics in SARIF Version 2.1.0 format, either to stderr, or to a file named @file{@var{source}.sarif}, respectively. -The various @samp{json}, @samp{json-stderr}, and @samp{json-file} values -are deprecated and refer to a legacy JSON-based output format. -The @samp{json} format is a synonym for @samp{json-stderr}. -The @samp{json-stderr} and @samp{json-file} formats are identical, apart from -where the JSON is emitted to. With @samp{json-stderr}, the JSON is emitted -to stderr, whereas with @samp{json-file} it is written to -@file{@var{source}.gcc.json}. - @opindex fdiagnostics-add-output @item -fdiagnostics-add-output=@var{DIAGNOSTICS-OUTPUT-SPEC} Add an additional ``output sink'' for emitting diagnostics. @@ -6012,6 +6331,7 @@ or be removed without notice. @table @gcctabopt +@opindex fdiagnostics-add-output=text @item text Emit diagnostics to stderr using GCC's classic text output format. @@ -6023,23 +6343,25 @@ 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. @end table +@cindex SARIF file output sink +@opindex fdiagnostics-add-output=sarif @item sarif Emit diagnostics to a file in SARIF format. @@ -6052,6 +6374,11 @@ Specify the filename to write the SARIF output to, potentially with a leading absolute or relative path. If not specified, it defaults to @file{@var{source}.sarif}. +@item serialization=@r{[}json@r{]} +Specify the serialization format to use when writing out the SARIF. +Currently this can only be @code{json}, but is present as an +extension point for experimenting with other serializations. + @item version=@r{[}2.1@r{|}2.2-prerelease@r{]} Specify the version of SARIF to use for the output. If not specified, defaults to 2.1. @code{2.2-prerelease} uses an unofficial draft of the @@ -6060,6 +6387,71 @@ in this release. @end table +There is also this key intended for use by GCC developers, rather than +end-users, and subject to change or removal without notice: + +@table @gcctabopt + +@item state-graphs=@r{[}yes@r{|}no@r{]} +This is a debugging feature and defaults to @code{no}. +If @code{state-graphs=yes}, then attempt to capture detailed state +information from @option{-fanalyzer} in the generated SARIF. + +@end table + +@opindex fdiagnostics-add-output=experimental-html +@item experimental-html +Emit diagnostics to a file in HTML format. This scheme is experimental, +and may go away in future GCC releases. The keys and details of the output +are also subject to change. + +Supported keys are: + +@table @gcctabopt + +@item css=@r{[}yes@r{|}no@r{]} +Add an embedded <style> to the generated HTML. Defaults to yes. + +@item file=@var{FILENAME} +Specify the filename to write the HTML output to, potentially with a +leading absolute or relative path. If not specified, it defaults to +@file{@var{source}.html}. + +@item javascript=@r{[}yes@r{|}no@r{]} +Add an embedded <script> to the generated HTML providing a barebones UI +for viewing results. Defaults to yes. + +@end table + +There are also these keys intended for use by GCC developers, rather than +end-users, and subject to change or removal without notice: + +@table @gcctabopt + +@item show-state-diagrams=@r{[}yes@r{|}no@r{]} +This is a debugging feature and defaults to @code{no}. +If @code{show-state-diagrams=yes}, then attempt to use @command{dot} to +generate SVG diagrams in the generated HTML, visualizing the state at each +event in a diagnostic path. +These are visible by pressing ``j'' and ``k'' to single-step forward and +backward through events. Enabling this option will slow down +HTML generation. + +@item show-graph-dot-src=@r{[}yes@r{|}no@r{]} +This is a debugging feature and defaults to @code{no}. +If @code{show-graph-dot-src=yes} +then if @code{show-state-diagrams=yes}, +the generated state diagrams will also show the .dot source input to +GraphViz used for the diagram. + +@item show-graph-sarif=@r{[}yes@r{|}no@r{]} +This is a debugging feature and defaults to @code{no}. +If @code{show-graph-sarif=yes} +then if @code{show-state-diagrams=yes}, the generated state diagrams will +also show a SARIF representation of the state. + +@end table + @end table For example, @@ -6079,7 +6471,7 @@ In EBNF: @var{diagnostics-output-specifier} = @var{diagnostics-output-name} | @var{diagnostics-output-name}, ":", @var{key-value-pairs}; -@var{diagnostics-output-name} = "text" | "sarif"; +@var{diagnostics-output-name} = "text" | "sarif" | "experimental-html"; @var{key-value-pairs} = @var{key-value-pair} | @var{key-value-pair} "," @var{key-value-pairs}; @@ -6103,11 +6495,8 @@ replaces all existing output sinks, such as from @option{-fdiagnostics-format=}, @opindex fdiagnostics-json-formatting @item -fno-diagnostics-json-formatting By default, when JSON is emitted for diagnostics (via -@option{-fdiagnostics-format=sarif-stderr}, -@option{-fdiagnostics-format=sarif-file}, -@option{-fdiagnostics-format=json}, -@option{-fdiagnostics-format=json-stderr}, -@option{-fdiagnostics-format=json-file}), +@option{-fdiagnostics-format=sarif-stderr} or +@option{-fdiagnostics-format=sarif-file}), GCC will add newlines and indentation to visually emphasize the hierarchical structure of the JSON. @@ -6149,7 +6538,9 @@ specified, then @option{-Wfatal-errors} takes precedence over this option. @opindex w +@opindex no-warnings @item -w +@itemx --no-warnings Inhibit all warning messages. @opindex Werror @@ -6230,6 +6621,7 @@ problems, in some cases it may also cause false positives. @opindex Wno-pedantic @item -Wpedantic @itemx -pedantic +@itemx --pedantic Issue all the warnings demanded by strict ISO C and ISO C++; diagnose all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++. This follows the version @@ -6268,6 +6660,7 @@ nothing to warn about.) @opindex pedantic-errors @item -pedantic-errors +@itemx --pedantic-errors Give an error whenever the @dfn{base standard} (see @option{-Wpedantic}) requires a diagnostic, in some cases where there is undefined behavior at compile-time and in some other cases that do not prevent compilation @@ -6321,6 +6714,7 @@ only by this flag, but it also downgrades some C and C++ diagnostics that have their own flag: @gccoptlist{ +-Wabbreviated-auto-in-template-arg @r{(C++ and Objective-C++ only)} -Wdeclaration-missing-parameter-type @r{(C and Objective-C only)} -Wimplicit-function-declaration @r{(C and Objective-C only)} -Wimplicit-int @r{(C and Objective-C only)} @@ -6337,7 +6731,9 @@ modes (@option{-std=c89}, @option{-std=gnu89}, @option{-std=c90}, @opindex Wall @opindex Wno-all +@opindex all-warnings @item -Wall +@itemx --all-warnings This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. This also @@ -6439,7 +6835,9 @@ them must be enabled individually. @opindex W @opindex Wextra @opindex Wno-extra +@opindex extra-warnings @item -Wextra +@itemx --extra-warnings This enables some extra warning flags that are not enabled by @option{-Wall}. (This option used to be called @option{-W}. The older name is still supported, but the newer name is more descriptive.) @@ -6461,6 +6859,7 @@ name is still supported, but the newer name is more descriptive.) -Wmissing-parameter-name @r{(C/ObjC only)} -Wmissing-parameter-type @r{(C/ObjC only)} -Wold-style-declaration @r{(C/ObjC only)} +-Wmultiple-parameter-fwd-decl-lists @r{(C/ObjC only)} -Woverride-init @r{(C/ObjC only)} -Wredundant-move @r{(C++ and Objective-C++ only)} -Wshift-negative-value @r{(in C++11 to C++17 and in C99 and newer)} @@ -6469,7 +6868,7 @@ name is still supported, but the newer name is more descriptive.) -Wstring-compare -Wtype-limits -Wuninitialized --Wunterminated-string-initialization +-Wunterminated-string-initialization @r{(C/ObjC only)} -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}} @@ -6774,7 +7173,7 @@ Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and @option{-Wformat} also checks for null format arguments for several functions, @option{-Wformat} also implies @option{-Wnonnull}. Some aspects of this level of format checking can be disabled by the -options: @option{-Wno-format-contains-nul}, +options: @option{-Wno-format-contains-nul}, @option{-Wno-format-diag}, @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}. @option{-Wformat} is enabled by @option{-Wall}. @@ -6791,6 +7190,12 @@ equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security If @option{-Wformat} is specified, do not warn about format strings that contain NUL bytes. +@opindex Wno-format-diag +@opindex Wformat-diag +@item -Wno-format-diag +If @option{-Wformat} is specified, do not warn about format strings that +are unsuitable for GCC diagnostics. + @opindex Wno-format-extra-args @opindex Wformat-extra-args @item -Wno-format-extra-args @@ -6980,14 +7385,14 @@ which is enabled by optimizations in most targets. The precision of the warnings depends on the optimization options used. @opindex Wno-musttail-local-addr -@opindex -Wmusttail-local-addr +@opindex Wmusttail-local-addr @item -Wno-musttail-local-addr Do not warn about passing a pointer (or in C++, a reference) to a local variable or label to argument of a @code{musttail} call. Those variables go out of scope before the tail call instruction. @opindex Wmaybe-musttail-local-addr -@opindex -Wno-maybe-musttail-local-addr +@opindex Wno-maybe-musttail-local-addr @item -Wmaybe-musttail-local-addr Warn when address of a local variable can escape to a @code{musttail} call, unless it goes out of scope already before the @code{musttail} @@ -7189,7 +7594,7 @@ switch (cond) @end group @end smallexample -C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough} +C++17 and C23 provide a standard way to suppress the @option{-Wimplicit-fallthrough} warning using @code{[[fallthrough]];} instead of the GNU attribute. In C++11 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension. Instead of these attributes, it is also possible to add a fallthrough comment @@ -7781,27 +8186,89 @@ statement. @opindex Wunused-but-set-parameter @opindex Wno-unused-but-set-parameter @item -Wunused-but-set-parameter +@option{-Wunused-but-set-parameter} is the same as +@option{-Wunused-but-set-parameter=3} and +@option{-Wno-unused-but-set-parameter} is the same as +@option{-Wunused-but-set-parameter=0}. + +@opindex Wunused-but-set-parameter= +@item -Wunused-but-set-parameter=@var{n} Warn whenever a function parameter is assigned to, but otherwise unused (aside from its declaration). To suppress this warning use the @code{unused} attribute (@pxref{Variable Attributes}). -This warning is also enabled by @option{-Wunused} together with -@option{-Wextra}. +@option{-Wunused-but-set-parameter=0} disables the warning. +With @option{-Wunused-but-set-parameter=1} all uses except initialization +and left hand side of assignment which is not further used disable the +warning. +With @option{-Wunused-but-set-parameter=2} additionally uses of parameter +in @code{++} and @code{--} operators don't count as uses. +And finally with @option{-Wunused-but-set-parameter=3} additionally +uses in @var{parm} @code{@var{@@}=} @var{rhs} outside of @var{rhs} don't +count as uses. See @option{-Wunused-but-set-variable=@var{n}} option for +examples. + +This @option{-Wunused-but-set-parameter=3} warning is also enabled by +@option{-Wunused} together with @option{-Wextra}. @opindex Wunused-but-set-variable @opindex Wno-unused-but-set-variable @item -Wunused-but-set-variable +@option{-Wunused-but-set-variable} is the same as +@option{-Wunused-but-set-variable=3} and +@option{-Wno-unused-but-set-variable} is the same as +@option{-Wunused-but-set-variable=0}. + +@opindex Wunused-but-set-variable= +@item -Wunused-but-set-variable=@var{n} Warn whenever a local variable is assigned to, but otherwise unused (aside from its declaration). -This warning is enabled by @option{-Wall}. +This @option{-Wunused-but-set-variable=3} warning is enabled by @option{-Wall}. To suppress this warning use the @code{unused} attribute (@pxref{Variable Attributes}). -This warning is also enabled by @option{-Wunused}, which is enabled -by @option{-Wall}. +@option{-Wunused-but-set-variable=0} disables the warning. +With @option{-Wunused-but-set-variable=1} all uses except initialization +and left hand side of assignment which is not further used disable the +warning. +With @option{-Wunused-but-set-variable=2} additionally uses of variable +in @code{++} and @code{--} operators don't count as uses. +And finally with @option{-Wunused-but-set-variable=3} additionally +uses in @var{parm} @code{@var{@@}=} @var{rhs} outside of @var{rhs} don't +count as uses. + +This @option{-Wunused-but-set-variable=3} warning is also enabled by +@option{-Wunused}, which is enabled by @option{-Wall}. + +@smallexample +void foo (void) +@{ + int a = 1; // @option{-Wunused-variable} warning + int b = 0; // Warning for @var{n} >= 1 + b = 1; b = 2; + int c = 0; // Warning for @var{n} >= 2 + ++c; c--; --c; c++; + int d = 0; // Warning for @var{n} >= 3 + d += 4; + int e = 0; // No warning, cast to void + (void) e; + int f = 0; // No warning, f used + int g = f = 5; + (void) g; + int h = 0; // No warning, preincrement used + int i = ++h; + (void) i; + int j = 0; // No warning, postdecrement used + int k = j--; + (void) k; + int l = 0; // No warning, l used + int m = l |= 2; + (void) m; +@} +@end smallexample @opindex Wunused-function @opindex Wno-unused-function @@ -8062,7 +8529,10 @@ known to read the object.) Annotating the function with attribute the object and avoids the warning (@pxref{Common Function Attributes}). These warnings are only possible in optimizing compilation, because otherwise -GCC does not keep track of the state of variables. +GCC does not keep track of the state of variables. On the other hand, +@option{-Wmaybe-uninitialized} is known not to warn in many situations +(false negatives) due to optimizations taking advantage of undefinedness +of uninitialized uses like constant propagation. These warnings are made optional because GCC may not be able to determine when the code is correct in spite of appearing to have an error. Here is one @@ -8148,10 +8618,9 @@ It warns about code that might break the strict aliasing rules that the compiler is using for optimization. The warning does not catch all cases, but does attempt to catch the more common pitfalls. It is included in @option{-Wall}. -It is equivalent to @option{-Wstrict-aliasing=3} +It is equivalent to @option{-Wstrict-aliasing=3}. -@opindex Wstrict-aliasing=n -@item -Wstrict-aliasing=n +@item -Wstrict-aliasing=@var{n} This option is only active when @option{-fstrict-aliasing} is active. It warns about code that might break the strict aliasing rules that the compiler is using for optimization. @@ -8593,6 +9062,17 @@ larger. @item -Walloca This option warns on all uses of @code{alloca} in the source. +@opindex Wno-auto-profile +@opindex Wauto-profile +@item -Wauto-profile +Output warnings about auto-profile inconsistencies. + +@opindex Wcannot-profile +@opindex Wno-cannot-profile +@item -Wcannot-profile +Warn when profiling instrumentation was requested, but could not be applied to +a certain function. + @opindex Walloca-larger-than= @opindex Wno-alloca-larger-than @item -Walloca-larger-than=@var{byte-size} @@ -9486,6 +9966,8 @@ disabled in the expression that follows @code{__extension__}. @opindex Wc11-c23-compat @opindex Wno-c11-c23-compat +@opindex Wc11-c2x-compat +@opindex Wno-c11-c2x-compat @item -Wc11-c23-compat @r{(C and Objective-C only)} @itemx -Wc11-c2x-compat @r{(C and Objective-C only)} Warn about features not present in ISO C11, but present in ISO C23. @@ -9545,6 +10027,12 @@ and ISO C++ 2017. This warning is enabled by @option{-Wall}. Warn about C++ constructs whose meaning differs between ISO C++ 2017 and ISO C++ 2020. This warning is enabled by @option{-Wall}. +@opindex Wc++26-compat +@opindex Wno-c++26-compat +@item -Wc++26-compat @r{(C++ and Objective-C++ only)} +Warn about C++ constructs whose meaning differs between ISO C++ 2023 +and upcoming ISO C++ 2026. This warning is enabled by @option{-Wall}. + @opindex Wc++11-extensions @opindex Wno-c++11-extensions @item -Wno-c++11-extensions @r{(C++ and Objective-C++ only)} @@ -9841,7 +10329,7 @@ void h (char *s) @opindex Wno-date-time @item -Wdate-time Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__} -are encountered as they might prevent bit-wise-identical reproducible +are encountered as they might prevent bitwise-identical reproducible compilations. @opindex Wempty-body @@ -10081,7 +10569,7 @@ enabled by default. @item -Wlogical-op Warn about suspicious uses of logical operators in expressions. This includes using logical operators in contexts where a -bit-wise operator is likely to be expected. Also warns when +bitwise operator is likely to be expected. Also warns when the operands of a logical operator are the same: @smallexample extern int a; @@ -10184,6 +10672,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)} @@ -10233,6 +10729,13 @@ is not considered an old-style definition in C23 mode, because it is equivalent to @samp{(void)} in that case, but is considered an old-style definition for older standards. +@opindex Wmultiple-parameter-fwd-decl-lists +@opindex Wno-multiple-parameter-fwd-decl-lists +@item -Wmultiple-parameter-fwd-decl-lists @r{(C and Objective-C only)} +Warn if more than one list of forward declarations of parameters +appears in a function prototype. +This warning is also enabled by @option{-Wextra}. + @opindex Wdeprecated-non-prototype @opindex Wno-deprecated-non-prototype @item -Wdeprecated-non-prototype @r{(C and Objective-C only)} @@ -10814,6 +11317,7 @@ See also @option{-Walloca-larger-than=@var{byte-size}}. Disable @option{-Wvla-larger-than=} warnings. The option is equivalent to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger. +@opindex Wvla-parameter @opindex Wno-vla-parameter @item -Wvla-parameter Warn about redeclarations of functions involving arguments of Variable @@ -11008,6 +11512,7 @@ Enabling this option effectively enables the following warnings: -Wanalyzer-tainted-divisor -Wanalyzer-tainted-offset -Wanalyzer-tainted-size +-Wanalyzer-throw-of-unexpected-type -Wanalyzer-undefined-behavior-ptrdiff -Wanalyzer-undefined-behavior-strtok -Wanalyzer-unsafe-call-within-signal-handler @@ -11659,6 +12164,17 @@ attacker could inject an out-of-bounds access. See @uref{https://cwe.mitre.org/data/definitions/129.html, CWE-129: Improper Validation of Array Index}. +@opindex Wanalyzer-throw-of-unexpected-type +@opindex Wno-analyzer-throw-of-unexpected-type +@item -Wno-analyzer-throw-of-unexpected-type +This warning requires @option{-fanalyzer} which enables it; +use @option{-Wno-analyzer-throw-of-unexpected-type} to disable it. +Dynamic exception specifications are only available in C++14 and earlier. + +This diagnostic warns for paths through the code in which a an exception +is thrown from a function with a dynamic exception specification where +the exception does not comply with the specification. + @opindex Wanalyzer-undefined-behavior-ptrdiff @opindex Wno-analyzer-undefined-behavior-ptrdiff @item -Wno-analyzer-undefined-behavior-ptrdiff @@ -12041,16 +12557,21 @@ With @option{-fno-analyzer-undo-inlining} this attempt to reconstruct the original frame information can be disabled, which may be of help when debugging issues in the analyzer. +@opindex fanalyzer-verbose-edges +@opindex fno-analyzer-verbose-edges @item -fanalyzer-verbose-edges This option is intended for analyzer developers. It enables more verbose, lower-level detail in the descriptions of control flow within diagnostic paths. +@opindex fanalyzer-verbose-state-changes +@opindex fno-analyzer-verbose-state-changes @item -fanalyzer-verbose-state-changes This option is intended for analyzer developers. It enables more verbose, lower-level detail in the descriptions of events relating to state machines within diagnostic paths. +@opindex fanalyzer-verbosity @item -fanalyzer-verbosity=@var{level} This option controls the complexity of the control flow paths that are emitted for analyzer diagnostics. @@ -12108,17 +12629,17 @@ GraphViz to @file{@var{file}.eg.dot}. Nodes are color-coded based on state-machine states to emphasize state changes. -@opindex dump-analyzer-exploded-nodes +@opindex fdump-analyzer-exploded-nodes @item -fdump-analyzer-exploded-nodes Emit diagnostics showing where nodes in the ``exploded graph'' are in relation to the program source. -@opindex dump-analyzer-exploded-nodes-2 +@opindex fdump-analyzer-exploded-nodes-2 @item -fdump-analyzer-exploded-nodes-2 Dump a textual representation of the ``exploded graph'' to @file{@var{file}.eg.txt}. -@opindex dump-analyzer-exploded-nodes-3 +@opindex fdump-analyzer-exploded-nodes-3 @item -fdump-analyzer-exploded-nodes-3 Dump a textual representation of the ``exploded graph'' to one dump file per node, to @file{@var{file}.eg-@var{id}.txt}. @@ -12129,14 +12650,14 @@ This is typically a large number of dump files. Dump a textual representation of the ``exploded path'' for each diagnostic to @file{@var{file}.@var{idx}.@var{kind}.epath.txt}. -@opindex dump-analyzer-feasibility +@opindex fdump-analyzer-feasibility @item -fdump-analyzer-feasibility Dump internal details about the analyzer's search for feasible paths. The details are written in a form suitable for viewing with GraphViz to filenames of the form @file{@var{file}.*.fg.dot}, @file{@var{file}.*.tg.dot}, and @file{@var{file}.*.fpath.txt}. -@opindex dump-analyzer-infinite-loop +@opindex fdump-analyzer-infinite-loop @item -fdump-analyzer-infinite-loop Dump internal details about the analyzer's search for infinite loops. The details are written in a form suitable for viewing with GraphViz @@ -12198,7 +12719,9 @@ information useful for debugging do not run at all, so that @table @gcctabopt @opindex g +@opindex debug @item -g +@itemx --debug Produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or DWARF)@. GDB can work with this debugging information. @@ -12382,6 +12905,17 @@ annotations are created and maintained, but discarded at the end. By default, this flag is enabled together with @option{-fvar-tracking}, except when selective scheduling is enabled. +@opindex fvar-tracking-uninit +@opindex fno-var-tracking-uninit +@item -fvar-tracking-uninit +@itemx -fno-var-tracking-uninit +Perform variable tracking and also mark uninitialized variables in the +debug information. +This flag is enabled by default by @option{-fvar-tracking}; it +also implies @option{-fvar-tracking}. +To do variable tracking without marking uninitialized variables, use +@option{-fvar-tracking} @option{-fno-var-tracking-uninit}. + @opindex gsplit-dwarf @item -gsplit-dwarf If DWARF debugging information is enabled, separate as much debugging @@ -12418,6 +12952,10 @@ Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format suitable for conversion into a GDB@ index. This option is only useful with a linker that can produce GDB@ index version 7. +@opindex gno-pubnames +@item -gno-pubnames +Don't generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections. + @opindex fdebug-types-section @opindex fno-debug-types-section @item -fdebug-types-section @@ -12565,7 +13103,8 @@ location views are enabled. Produce compressed debug sections in DWARF format, if that is supported. If @var{type} is not given, the default type depends on the capabilities of the assembler and linker used. @var{type} may be one of -@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib +@samp{none} (don't compress debug sections), @samp{zlib} (use zlib +compression in ELF gABI format), or @samp{zstd} (use zstd compression in ELF gABI format). If the linker doesn't support writing compressed debug sections, the option is rejected. Otherwise, if the assembler does not support them, @option{-gz} is silently ignored when @@ -12707,8 +13246,10 @@ to find out the exact set of optimizations that are enabled at each level. @table @gcctabopt @opindex O @opindex O1 +@opindex optimize @item -O @itemx -O1 +@itemx --optimize Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function. @@ -12794,7 +13335,7 @@ also turns on the following optimization flags: -fcode-hoisting -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks --fdelete-null-pointer-checks +-fdelete-null-pointer-checks -fdep-fusion -fdevirtualize -fdevirtualize-speculatively -fexpensive-optimizations -ffinite-loops @@ -12888,17 +13429,19 @@ It turns off @option{-fsemantic-interposition}. @opindex Og @item -Og -Optimize debugging experience. @option{-Og} should be the optimization +Optimize while keeping in mind debugging experience. +@option{-Og} should be the optimization level of choice for the standard edit-compile-debug cycle, offering -a reasonable level of optimization while maintaining fast compilation -and a good debugging experience. It is a better choice than @option{-O0} -for producing debuggable code because some compiler passes -that collect debug information are disabled at @option{-O0}. +a reasonable blend of optimization, fast compilation and debugging experience +especially for code with a high abstraction penalty. In contrast to +@option{-O0}, this enables @option{-fvar-tracking-assignments} and +@option{-fvar-tracking} which handle debug information in the prologue +and epilogue of functions better than @option{-O0}. -Like @option{-O0}, @option{-Og} completely disables a number of +Like @option{-O0}, @option{-Og} completely skips a number of optimization passes so that individual options controlling them have no effect. Otherwise @option{-Og} enables all @option{-O1} -optimization flags except for those that may interfere with debugging: +optimization flags except for those known to greatly interfere with debugging: @gccoptlist{-fbranch-count-reg -fdelayed-branch -fdse -fif-conversion -fif-conversion2 @@ -12973,6 +13516,24 @@ different statements. The default is @option{-ffp-contract=off} for C in a standards compliant mode (@option{-std=c11} or similar), @option{-ffp-contract=fast} otherwise. +@opindex ffp-int-builtin-inexact +@item -ffp-int-builtin-inexact +Allow the built-in functions @code{ceil}, @code{floor}, +@code{round} and @code{trunc}, and their @code{float} and @code{long +double} variants, to generate code that raises the ``inexact'' +floating-point exception for noninteger arguments. ISO C99 and C11 +allow these functions to raise the ``inexact'' exception, but ISO/IEC +TS 18661-1:2014, the C bindings to IEEE 754-2008, as integrated into +ISO C23, does not allow these functions to do so. + +The default is @option{-fno-fp-int-builtin-inexact}, disallowing the +exception to be raised, unless C17 or an earlier C standard is selected. +This option does nothing unless @option{-ftrapping-math} is in effect. + +Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions +generate a call to a library function then the ``inexact'' exception +may be raised if the library implementation does not follow TS 18661. + @opindex fomit-frame-pointer @item -fomit-frame-pointer Omit the frame pointer in functions that don't need one. This avoids the @@ -13015,8 +13576,15 @@ their @code{_FORTIFY_SOURCE} counterparts into faster alternatives. Enabled at levels @option{-O2}, @option{-O3}. +@opindex finline-atomics +@opindex fno-inline-atomics +@item -finline-atomics +@itemx -fno-inline-atomics +Inline @samp{__atomic} operations when a lock-free instruction sequence +is available. This optimization is enabled by default. + @opindex finline-stringops -@item -finline-stringops[=@var{fn}] +@item -finline-stringops@r{[}=@var{fn}@r{]} Expand memory and string operations (for now, only @code{memset}) inline, even when the length is variable or big enough as to require looping. This is most useful along with @option{-ffreestanding} and @@ -13222,6 +13790,15 @@ performed when this option is not used. The default is @option{-ffunction-cse} +@opindex ffuse-ops-with-volatile-access +@opindex fno-fuse-ops-with-volatile-access +@item -ffuse-ops-with-volatile-access +Allow limited optimization of operations with volatile memory access +when doing so does not change the semantics outlined in +@xref{Volatiles,,When is a Volatile Object Accessed?}. + +The default is @option{-ffuse-ops-with-volatile-access} + @opindex fno-zero-initialized-in-bss @opindex fzero-initialized-in-bss @item -fno-zero-initialized-in-bss @@ -13461,6 +14038,13 @@ Perform a number of minor optimizations that are relatively expensive. Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. +@opindex fext-dce +@opindex fno-ext-dce +@item -fext-dce +@itemx -fno-ext-dce +Perform dead code elimination on zero and sign extensions, with special +dataflow analysis. + @opindex free @item -free Attempt to remove redundant extension instructions. This is especially @@ -13958,17 +14542,26 @@ ranges. This flag is enabled by default at @option{-O2}. It requires that @option{-fipa-cp} is enabled. @opindex fipa-icf -@item -fipa-icf -Perform Identical Code Folding for functions and read-only variables. +@opindex fipa-icf-functions +@opindex fipa-icf-variables +@opindex fno-ipa-icf +@opindex fno-ipa-icf-functions +@opindex fno-ipa-icf-variables +@item -fipa-icf-functions +@itemx -fipa-icf-variables +@itemx -fipa-icf +Perform Identical Code Folding for functions (@option{-fipa-icf-functions}), +read-only variables (@option{-fipa-icf-variables}), or both +(@option{-fipa-icf}). The optimization reduces code size and may disturb unwind stacks by replacing -a function by equivalent one with a different name. The optimization works +a function by an equivalent one with a different name. The optimization works more effectively with link-time optimization enabled. Although the behavior is similar to the Gold Linker's ICF optimization, GCC ICF works on different levels and thus the optimizations are not same - there are equivalences that are found only by GCC and equivalences found only by Gold. -This flag is enabled by default at @option{-O2} and @option{-Os}. +@option{-fipa-icf} is enabled by default at @option{-O2} and @option{-Os}. @opindex flate-combine-instructions @item -flate-combine-instructions @@ -14043,10 +14636,10 @@ Note that @option{-flive-patching} is not supported with link-time optimization @opindex fisolate-erroneous-paths-dereference @item -fisolate-erroneous-paths-dereference Detect paths that trigger erroneous or undefined behavior due to -dereferencing a null pointer. Isolate those paths from the main control -flow and turn the statement with erroneous or undefined behavior into a trap. -This flag is enabled by default at @option{-O2} and higher and depends on -@option{-fdelete-null-pointer-checks} also being enabled. +dereferencing a null pointer (with @option{-fdelete-null-pointer-checks} +enabled) or a division by zero. Isolate those paths from the main control +flow and turn the statement with erroneous or undefined behavior into a +trap. This flag is enabled by default at @option{-O2} and higher. @opindex fisolate-erroneous-paths-attribute @item -fisolate-erroneous-paths-attribute @@ -14318,8 +14911,9 @@ variable merging and induction variable elimination) on trees. Enabled by default at @option{-O1} and higher. @opindex ftree-parallelize-loops -@item -ftree-parallelize-loops=n -Parallelize loops, i.e., split their iteration space to run in n threads. +@item -ftree-parallelize-loops +@itemx -ftree-parallelize-loops=@var{n} +Parallelize loops, i.e., split their iteration space to run in multiple threads. This is only possible for loops whose iterations are independent and can be arbitrarily reordered. The optimization is only profitable on multiprocessor machines, for loops that are CPU-intensive, @@ -14327,6 +14921,17 @@ rather than constrained e.g.@: by memory bandwidth. This option implies @option{-pthread}, and thus is only supported on targets that have support for @option{-pthread}. +When a positive value @var{n} is specified, the number of threads is fixed +at compile time and cannot be changed after compilation. The compiler +generates ``#pragma omp parallel num_threads(@var{n})''. + +When used without @code{=@var{n}} (i.e., @option{-ftree-parallelize-loops}), +the number of threads is determined at program execution time via the +@env{OMP_NUM_THREADS} environment variable. If @env{OMP_NUM_THREADS} is not +set, the OpenMP runtime automatically detects the number of available +processors and uses that value. This enables creating binaries that +adapt to different hardware configurations without recompilation. + @opindex ftree-pta @item -ftree-pta Perform function-local points-to analysis on trees. This flag is @@ -14380,27 +14985,25 @@ and @option{-fauto-profile}. @opindex ftrivial-auto-var-init @item -ftrivial-auto-var-init=@var{choice} -Initialize automatic variables with either a pattern or with zeroes to increase -the security and predictability of a program by preventing uninitialized memory -disclosure and use. +Initialize automatic variables or temporary objects with either a pattern or with +zeroes to increase the security and predictability of a program by preventing +uninitialized memory disclosure and use. GCC still considers an automatic variable that doesn't have an explicit initializer as uninitialized, @option{-Wuninitialized} and @option{-Wanalyzer-use-of-uninitialized-value} will still report -warning messages on such automatic variables and the compiler will -perform optimization as if the variable were uninitialized. +warning messages on such automatic variables or temporary objects and the +compiler will perform optimization as if the variable were uninitialized. With this option, GCC will also initialize any padding of automatic variables -that have structure or union types to zeroes. -However, the current implementation cannot initialize automatic variables that -are declared between the controlling expression and the first case of a -@code{switch} statement. Using @option{-Wtrivial-auto-var-init} to report all -such cases. +or temporary objects that have structure or union types to zeroes. +However, the current implementation cannot initialize automatic variables +whose initialization is bypassed through @code{switch} or @code{goto} +statement. Using @option{-Wtrivial-auto-var-init} to report all such cases. The three values of @var{choice} are: @itemize @bullet @item @samp{uninitialized} doesn't initialize any automatic variables. -This is C and C++'s default. @item @samp{pattern} Initialize automatic variables with values which will likely @@ -14414,7 +15017,10 @@ The values used for pattern initialization might be changed in the future. @samp{zero} Initialize automatic variables with zeroes. @end itemize -The default is @samp{uninitialized}. +The default is @samp{uninitialized} except for C++26, in which case +if @option{-ftrivial-auto-var-init=} is not specified at all automatic +variables or temporary objects are zero initialized, but zero initialization +of padding bits does not happen. Note that the initializer values, whether @samp{zero} or @samp{pattern}, refer to data representation (in memory or machine registers), rather @@ -14427,7 +15033,7 @@ with the bit patterns @code{0x00} or @code{0xFE}, depending on @var{choice}, whether or not these representations stand for values in that range, and even if they do, the interpretation of the value held by the variable will depend on the bias. A @samp{hardbool} variable that -uses say @code{0X5A} and @code{0xA5} for @code{false} and @code{true}, +uses say @code{0x5A} and @code{0xA5} for @code{false} and @code{true}, respectively, will trap with either @samp{choice} of trivial initializer, i.e., @samp{zero} initialization will not convert to the representation for @code{false}, even if it would for a @code{static} @@ -14438,7 +15044,8 @@ are initialized with @code{false} (zero), even when @samp{pattern} is requested. You can control this behavior for a specific variable by using the variable -attribute @code{uninitialized} (@pxref{Variable Attributes}). +attribute @code{uninitialized} standard attribute (@pxref{Variable Attributes}) +or the C++26 @code{[[indeterminate]]}. @opindex fvect-cost-model @item -fvect-cost-model=@var{model} @@ -14673,10 +15280,11 @@ int f() @{ @end smallexample The practice of reading from a different union member than the one most recently written to (called ``type-punning'') is common. Even with -@option{-fstrict-aliasing}, type-punning is allowed, provided the memory -is accessed through the union type. So, the code above works as -expected. @xref{Structures unions enumerations and bit-fields -implementation}. However, this code might not: +@option{-fstrict-aliasing}, type-punning is allowed in C, provided the memory +is accessed through the union type. In ISO C++, type-punning through a union +type is undefined behavior, but GCC supports it as an extension. So, the code +above works as expected. @xref{Structures unions enumerations and +bit-fields implementation}. However, this code might not: @smallexample int f() @{ union a_union t; @@ -14750,6 +15358,8 @@ The maximum allowed @var{n} option value is 65536. Enabled at levels @option{-O2}, @option{-O3}. +@opindex flimit-function-alignment +@opindex fno-limit-function-alignment @item -flimit-function-alignment If this option is enabled, the compiler tries to avoid unnecessarily overaligning functions. It attempts to instruct the assembler to align @@ -14971,8 +15581,8 @@ You can always override the automatic decision to do link-time optimization by passing @option{-fno-lto} to the link command. -To make whole program optimization effective, it is necessary to make -certain whole program assumptions. The compiler needs to know +To make whole-program optimization effective, it is necessary to make +certain assumptions. The compiler needs to know what functions and variables can be accessed by libraries and runtime outside of the link-time optimized unit. When supported by the linker, the linker plugin (see @option{-fuse-linker-plugin}) passes information @@ -15276,16 +15886,16 @@ This option is enabled by @option{-fauto-profile}. @opindex fprofile-partial-training @item -fprofile-partial-training -With @code{-fprofile-use} all portions of programs not executed during train -run are optimized aggressively for size rather than speed. In some cases it is -not practical to train all possible hot paths in the program. (For -example, program may contain functions specific for a given hardware and -training may not cover all hardware configurations program is run on.) With -@code{-fprofile-partial-training} profile feedback is ignored for all -functions not executed during the train run, leading them to be optimized as if -they were compiled without profile feedback. This leads to better performance -when train run is not representative but also leads to significantly bigger -code. +With @code{-fprofile-use} all portions of programs not executed during +training runs are optimized aggressively for size rather than speed. +In some cases it is not practical to train all possible hot paths in +the program. (For example, it may contain functions specific to a +given hardware and training may not cover all hardware configurations +the program later runs on.) With @code{-fprofile-partial-training} +profile feedback is ignored for all functions not executed during the +training runs, causing them to be optimized as if they were compiled +without profile feedback. This leads to better performance when the +training is not representative at the cost of significantly bigger code. @opindex fprofile-use @item -fprofile-use @@ -15335,7 +15945,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 @@ -15353,6 +15963,12 @@ E.g. create_gcov --binary=your_program.unstripped --profile=perf.data \ --gcov=profile.afdo @end smallexample + +@opindex fauto-profile-inlining +@item -fauto-profile-inlining +When auto-profile is available inline all relevant functions which was +inlined in the tran run before reading the profile feedback. This improves +context sensitivity of the profile. Enabled by default. @end table The following options control compiler behavior regarding floating-point @@ -15573,25 +16189,6 @@ The default is @option{-fno-signaling-nans}. This option is experimental and does not currently guarantee to disable all GCC optimizations that affect signaling NaN behavior. -@opindex fno-fp-int-builtin-inexact -@opindex ffp-int-builtin-inexact -@item -fno-fp-int-builtin-inexact -Do not allow the built-in functions @code{ceil}, @code{floor}, -@code{round} and @code{trunc}, and their @code{float} and @code{long -double} variants, to generate code that raises the ``inexact'' -floating-point exception for noninteger arguments. ISO C99 and C11 -allow these functions to raise the ``inexact'' exception, but ISO/IEC -TS 18661-1:2014, the C bindings to IEEE 754-2008, as integrated into -ISO C23, does not allow these functions to do so. - -The default is @option{-ffp-int-builtin-inexact}, allowing the -exception to be raised, unless C23 or a later C standard is selected. -This option does nothing unless @option{-ftrapping-math} is in effect. - -Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions -generate a call to a library function then the ``inexact'' exception -may be raised if the library implementation does not follow TS 18661. - @opindex fsingle-precision-constant @item -fsingle-precision-constant Treat floating-point constants as single precision instead of @@ -15603,8 +16200,7 @@ When enabled, this option states that a range reduction step is not needed when performing complex division. Also, there is no checking whether the result of a complex multiplication or division is @code{NaN + I*NaN}, with an attempt to rescue the situation in that case. The -default is @option{-fno-cx-limited-range}, but is enabled by -@option{-ffast-math}. +option is enabled by @option{-ffast-math}. This option controls the default setting of the ISO C99 @code{CX_LIMITED_RANGE} pragma. Nevertheless, the option applies to @@ -15617,7 +16213,14 @@ reduction is done as part of complex division, but there is no checking whether the result of a complex multiplication or division is @code{NaN + I*NaN}, with an attempt to rescue the situation in that case. -The default is @option{-fno-cx-fortran-rules}. +@opindex fcx-method +@item -fcx-method=@var{method} +Complex multiplication and division follow the stated @var{method}. The +@var{method} argument should be one of @samp{limited-range}, @samp{fortran} +or @samp{stdc}. + +The default is to honor language specific constraints which means +@samp{fortran} for Fortran and @samp{stdc} otherwise. @end table @@ -15700,6 +16303,15 @@ more efficiently if they are adjacent to each other in the instruction flow. Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. +@opindex fdep-fusion +@item -fdep-fusion +Detect macro-op fusible pairs consisting of single-use instructions and their +uses, and place such pairs together in the instruction stream to increase +fusion opportunities in hardware. This pass is executed once before register +allocation, and another time before register renaming. + +Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. + @opindex ftracer @item -ftracer Perform tail duplication to enlarge superblock size. This transformation @@ -15745,7 +16357,7 @@ as a parameter of @code{free} call or compared with @code{NULL}. If with @option{-fmalloc-dce=2} also comparisons with @code{NULL} pointer are considered safe to remove. -The default is @option{-fmalloc-dce=2}. See also @option{-fallocation-dce}. +The default is @option{-fmalloc-dce=2}. See also @option{-fallocation-dce}. @opindex fmove-loop-invariants @item -fmove-loop-invariants @@ -15881,6 +16493,7 @@ attribute @code{zero_call_used_regs} (@pxref{Function Attributes}). @opindex param @item --param @var{name}=@var{value} +@itemx --param=@var{name}=@var{value} In some places, GCC uses various constants to control the amount of optimization that is done. For example, GCC does not inline functions that contain more than a certain number of instructions. You can @@ -15898,6 +16511,11 @@ In each case, the @var{value} is an integer. The following choices of @var{name} are recognized for all targets: @table @gcctabopt +@item auto-profile-bbs +If non-zero and used together with @option{-fauto-profile}, the auto-profile +will be used to determine basic block profile. If zero, then only function +level profile will be read. + @item phiopt-factor-max-stmts-live When factoring statements out of if/then/else, this is the max # of statements after the defining statement to be allow to extend the lifetime of a name @@ -15975,6 +16593,10 @@ aggressive optimization, increasing the compilation time. This parameter should be removed when the delay slot code is rewritten to maintain the control-flow graph. +@item max-devirt-targets +This limits number of function a virtual call may be speculatively +devirtualized to using static analysis (without profile feedback). + @item max-gcse-memory The approximate maximum amount of memory in @code{kB} that can be allocated in order to perform the global common subexpression elimination @@ -16697,9 +17319,6 @@ Switch initialization conversion refuses to create arrays that are bigger than @option{switch-conversion-max-branch-ratio} times the number of branches in the switch. -@item switch-lower-slow-alg-max-cases -Maximum number of cases for slow switch lowering algorithms to be used. - @item max-partial-antic-length Maximum length of the partial antic set computed during the tree partial redundancy elimination optimization (@option{-ftree-pre}) when @@ -16897,11 +17516,6 @@ Maximum depth of recursive cloning for self-recursive function. Recursive cloning only when the probability of call being executed exceeds the parameter. -@item ipa-cp-profile-count-base -When using @option{-fprofile-use} option, IPA-CP will consider the measured -execution count of a call graph edge at this percentage position in their -histogram as the basis for its heuristics calculation. - @item ipa-cp-recursive-freq-factor The number of times interprocedural copy propagation expects recursive functions to call themselves. @@ -16963,6 +17577,19 @@ Size of max partition for WHOPR (in estimated instructions). to provide an upper bound for individual size of partition. Meant to be used only with balanced partitioning. +@item lto-partition-locality-frequency-cutoff +The denominator n of fraction 1/n of the execution frequency of callee to be +cloned for a particular caller. Special value of 0 dictates to always clone +without a cut-off. + +@item lto-partition-locality-size-cutoff +Size cut-off for callee including inlined calls to be cloned for a particular +caller. + +@item lto-max-locality-partition +Maximal size of a locality partition for LTO (in estimated instructions). +Value of 0 results in default value being used. + @item lto-max-streaming-parallelism Maximal number of parallel processes used for LTO streaming. @@ -17217,12 +17844,16 @@ this parameter. The default value of this parameter is 50. @item vect-induction-float Enable loop vectorization of floating point inductions. -@item vect-force-slp -Force the use of SLP when vectorizing, fail if not possible. +@item vect-scalar-cost-multiplier +Apply the given multiplier % to scalar loop costing during vectorization. +Increasing the cost multiplier will make vector loops more profitable. @item vrp-block-limit Maximum number of basic blocks before VRP switches to a lower memory algorithm. +@item vrp-cstload-limit +Maximum number of steps when inferring a value range from a load from a constant aggregate. + @item vrp-sparse-threshold Maximum number of basic blocks before VRP uses a sparse bitmap cache. @@ -17259,6 +17890,14 @@ uses for scheduling a loop. The max number of reload pseudos which are considered during spilling a non-reload pseudo. +@item lra-max-pseudos-points-log2-considered-for-preferences +The maximum @code{log2(number of reload pseudos * number of +program points)} threshold when preferences for other reload pseudos +are still considered. Taking these preferences into account helps to +improve register allocation. However, for very large functions, a +large value can result in significant compilation time and memory +consumption. The default value is 30. + @item max-pow-sqrt-depth Maximum depth of sqrt chains to use when synthesizing exponentiation by a real constant. @@ -17297,6 +17936,9 @@ predicate chain. @item uninit-max-num-chains Maximum number of predicates ored in the normalized predicate chain. +@item uninit-max-prune-work +Maximum amount of work done to prune paths where the variable is always initialized. + @item sched-autopref-queue-depth Hardware autoprefetcher scheduler model control flag. Number of lookahead cycles the model looks into; at ' @@ -17460,20 +18102,9 @@ The precision of division is proportional to this param when division approximation is enabled. The default value is 2. @item aarch64-autovec-preference -Force an ISA selection strategy for auto-vectorization. -@table @samp -@item default -Use the default heuristics. -@item asimd-only -Use only Advanced SIMD for auto-vectorization. -@item sve-only -Use only SVE for auto-vectorization. -@item prefer-asimd -Use both Advanced SIMD and SVE. Prefer Advanced SIMD when the costs are -deemed equal. -@item prefer-sve -Use both Advanced SIMD and SVE. Prefer SVE when the costs are deemed equal. -@end table +An old alias for @option{-mautovec-preference}. If both +@option{-mautovec-preference} and @option{--param=aarch64-autovec-preference} +are passed, the @option{--param} value will be used. @item aarch64-ldp-policy Fine-grained policy for load pairs. @@ -17543,6 +18174,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 @@ -17574,11 +18208,17 @@ program analysis purposes. @cindex @command{prof} @cindex @command{gprof} @opindex p +@opindex profile +@opindex fprofile @opindex pg @item -p +@itemx --profile +@itemx -fprofile @itemx -pg Generate extra code to write profile information suitable for the -analysis program @command{prof} (for @option{-p}) or @command{gprof} +analysis program @command{prof} (for @option{-p}, @option{--profile}, +and @option{-fprofile}) +or @command{gprof} (for @option{-pg}). You must use this option when compiling the source files you want data about, and you must also use it when linking. @@ -17646,9 +18286,11 @@ is @var{250000}. @cindex @command{gcov} @opindex coverage @item --coverage +@itemx -coverage This option is used to compile and link code instrumented for coverage -analysis. The option is a synonym for @option{-fprofile-arcs} +analysis. The options @option{-coverage} and @option{--coverage} are +equivalent; both are a synonym for @option{-fprofile-arcs} @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when linking). See the documentation for those options for more details. @@ -18728,7 +19370,7 @@ available for the latter code to run. If compiling all code, including library code, with @option{-fsplit-stack} is not an option, then the linker can fix up these calls so that the code compiled without @option{-fsplit-stack} always has a large stack. Support for -this is implemented in the gold linker in GNU binutils release 2.21 +this is implemented in the gold linker in GNU Binutils release 2.21 and later. @opindex fstrub=disable @@ -19012,6 +19654,7 @@ If you want to pass an option that takes an argument, you must use @opindex no-integrated-cpp @item -no-integrated-cpp +@itemx --no-integrated-cpp Perform preprocessing as a separate pass before compilation. By default, GCC performs preprocessing as an integrated part of input tokenization and parsing. @@ -19040,7 +19683,10 @@ Pass @var{option} as an option to the assembler. If @var{option} contains commas, it is split into multiple options at the commas. @opindex Xassembler +@opindex for-assembler @item -Xassembler @var{option} +@itemx --for-assembler=@var{option} +@itemx --for-assembler @var{option} Pass @var{option} as an option to the assembler. You can use this to supply system-specific assembler options that GCC does not recognize. @@ -19078,6 +19724,12 @@ If any of these options is used, then the linker is not run, and object file names should not be used as arguments. @xref{Overall Options}. +@opindex flink-libatomic +@item -flink-libatomic +Enable linking of libatomic if it's supported by target, and is enabled by +default. The negative form @option{-fno-link-libatomic} can be used to +explicitly disable linking of libatomic. + @opindex flinker-output @item -flinker-output=@var{type} This option controls code generation of the link-time optimizer. By @@ -19115,16 +19767,15 @@ code generation is forced, a final binary is produced, and the intermediate code for later link-time optimization is stripped. When multiple object files are linked together the resulting code is better optimized than with link-time optimizations disabled (for example, cross-module inlining -happens), but most of benefits of whole program optimizations are lost. +happens), but most of the benefits of whole-program optimizations are lost. During the incremental link (by @option{-r}) the linker plugin defaults to -@option{rel}. With current interfaces to GNU Binutils it is however not -possible to incrementally link LTO objects and non-LTO objects into a single -mixed object file. If any of object files in incremental link cannot -be used for link-time optimization, the linker plugin issues a warning and -uses @samp{nolto-rel}. To maintain whole program optimization, it is -recommended to link such objects into static library instead. Alternatively it -is possible to use H.J. Lu's binutils with support for mixed objects. +@option{rel}. GNU Binutils 2.44 or later is needed to incrementally link +LTO objects and non-LTO objects into a single mixed object file. If any +of the object files in an incremental link cannot be used for link-time +optimization, the linker plugin issues a warning and uses @samp{nolto-rel}. +To maintain whole-program optimization, link such objects into a static +library instead. @opindex fuse-ld=bfd @item -fuse-ld=bfd @@ -19142,6 +19793,10 @@ Use the LLVM @command{lld} linker instead of the default linker. @item -fuse-ld=mold Use the Modern Linker (@command{mold}) instead of the default linker. +@opindex fuse-ld=wild +@item -fuse-ld=wild +Use the Wild linker (@command{wild}) instead of the default linker. + @cindex Libraries @opindex l @item -l@var{library} @@ -19210,7 +19865,9 @@ absence of a C library is assumed, for example @option{-lpthread} or targets when there is indeed no C library available. @opindex nostdlib +@opindex no-standard-libraries @item -nostdlib +@itemx --no-standard-libraries Do not use the standard system startup files or libraries when linking. No startup files and only the libraries you specify are passed to the linker, and options specifying linkage of the system libraries, such as @@ -19252,6 +19909,7 @@ Do not implicitly link with standard C++ libraries. @opindex entry @item -e @var{entry} @itemx --entry=@var{entry} +@itemx --entry @var{entry} Specify that the program entry point is @var{entry}. The argument is interpreted by the linker; the GNU linker accepts either a symbol name @@ -19259,6 +19917,7 @@ or an address. @opindex pie @item -pie +@itemx --pie Produce a dynamically linked position independent executable on targets that support it. For predictable results, you must also specify the same set of options used for compilation (@option{-fpie}, @option{-fPIE}, @@ -19270,6 +19929,7 @@ Don't produce a dynamically linked position independent executable. @opindex static-pie @item -static-pie +@itemx --static-pie Produce a static position independent executable on targets that support it. A static position independent executable is similar to a static executable, but can be loaded at any address without a dynamic linker. @@ -19304,12 +19964,14 @@ Remove all symbol table and relocation information from the executable. @opindex static @item -static +@itemx --static On systems that support dynamic linking, this overrides @option{-pie} and prevents linking with the shared libraries. On other systems, this option has no effect. @opindex shared @item -shared +@itemx --shared Produce a shared object which can then be linked with other objects to form an executable. Not all systems support this option. For predictable results, you must also specify the same set of options used for compilation @@ -19413,6 +20075,7 @@ libraries statically. @opindex symbolic @item -symbolic +@itemx --symbolic Bind references to global symbols when building a shared object. Warn about any unresolved references (unless overridden by the link editor option @option{-Xlinker -z -Xlinker defs}). Only a few systems support @@ -19446,7 +20109,10 @@ syntax than as separate arguments. For example, you can specify this syntax for command-line options. @opindex Wl +@opindex for-linker @item -Wl,@var{option} +@itemx --for-linker=@var{option} +@itemx --for-linker @var{option} Pass @var{option} as an option to the linker. If @var{option} contains commas, it is split into multiple options at the commas. You can use this syntax to pass an argument to the option. @@ -19455,16 +20121,32 @@ linker. When using the GNU linker, you can also get the same effect with @option{-Wl,-Map=output.map}. @opindex u +@opindex force-link @item -u @var{symbol} +@itemx --force-link=@var{symbol} +@itemx --force-link @var{symbol} Pretend the symbol @var{symbol} is undefined, to force linking of library modules to define it. You can use @option{-u} multiple times with different symbols to force loading of additional library modules. +@opindex Tbss +@opindex Tdata +@opindex Ttext +@opindex N +@opindex n +@opindex t +@opindex Z @opindex z -@item -z @var{keyword} -@option{-z} is passed directly on to the linker along with the keyword -@var{keyword}. See the section in the documentation of your linker for -permitted values and their meanings. +@item -Tbss=@var{addr} +@itemx -Tdata=@var{addr} +@itemx -Ttext=@var{addr} +@itemx -N +@itemx -n +@itemx -t +@itemx -Z +@itemx -z @var{keyword} +These options are passed through to the linker without interpretation by GCC. +Refer to your linker documentation for the meanings of these options. @end table @node Directory Options @@ -19487,12 +20169,18 @@ by @option{-fplugin=@var{name}} instead of to be used by the user, but only passed by the driver. @opindex L +@opindex library-directory @item -L@var{dir} +@itemx --library-directory=@var{dir} +@itemx --library-directory @var{dir} Add directory @var{dir} to the list of directories to be searched for @option{-l}. @opindex B +@opindex prefix @item -B@var{prefix} +@itemx --prefix=@var{prefix} +@itemx --prefix @var{prefix} This option specifies where to find the executables, libraries, include files, and data files of the compiler itself. @@ -19537,12 +20225,14 @@ with boot-strapping the compiler. @opindex no-canonical-prefixes @item -no-canonical-prefixes +@itemx --no-canonical-prefixes Do not expand any symbolic links, resolve references to @samp{/../} or @samp{/./}, or make the path absolute when generating a relative prefix. @opindex sysroot @item --sysroot=@var{dir} +@itemx --sysroot @var{dir} Use @var{dir} as the logical root directory for headers and libraries. For example, if the compiler normally searches for headers in @file{/usr/include} and libraries in @file{/usr/lib}, it instead @@ -19584,7 +20274,7 @@ can figure out the other form by either removing @samp{no-} or adding it. @table @gcctabopt -@opindex fstack_reuse +@opindex fstack-reuse @item -fstack-reuse=@var{reuse-level} This option controls stack space reuse for user declared local/auto variables and compiler generated temporaries. @var{reuse_level} can be @samp{all}, @@ -19841,8 +20531,15 @@ useful to enable legacy code to link without errors. @opindex fno-ident @opindex fident +@opindex Qy +@opindex Qn @item -fno-ident -Ignore the @code{#ident} directive. +@itemx -Qy +@itemx -Qn +@option{-fno-ident} suppresses emission of @code{.ident} assembler +directives and causes the @code{#ident} preprocessor directive to be ignored. +@option{-Qy} and @option{-Qn} are obsolete synonyms for @option{-fident} +and @option{-fno-ident}, respectively. @opindex finhibit-size-directive @item -finhibit-size-directive @@ -20368,21 +21065,28 @@ may generate multiple callgraph information files next to intermediate LTO output files. @opindex d +@opindex dump @opindex fdump-rtl-@var{pass} @item -d@var{letters} +@itemx --dump=@var{letters} +@itemx --dump @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 @@ -20627,35 +21331,42 @@ These dumps are defined but always produce empty files. @opindex da @opindex fdump-rtl-all @item -da +@itemx --dump=a @itemx -fdump-rtl-all Produce all the dumps listed above. @opindex dA @item -dA +@itemx --dump=A Annotate the assembler output with miscellaneous debugging information. @opindex dD @item -dD +@itemx --dump=D Dump all macro definitions, at the end of preprocessing, in addition to normal output. @opindex dH @item -dH +@itemx --dump=H Produce a core dump whenever an error occurs. @opindex dp @item -dp +@itemx --dump=p Annotate the assembler output with a comment indicating which pattern and alternative is used. The length and cost of each instruction are also printed. @opindex dP @item -dP +@itemx --dump=P Dump the RTL in the assembler output as a comment before each instruction. Also turns on @option{-dp} annotation. @opindex dx @item -dx +@itemx --dump=x Just generate RTL for a function instead of compiling it. Usually used with @option{-fdump-rtl-expand}. @end table @@ -20695,6 +21406,11 @@ When doing debugging dumps (see @option{-d} option above), suppress instruction numbers for the links to the previous and next instructions in a sequence. +@opindex fdump-internal-locations +@item -fdump-internal-locations +Dump detailed information about GCC's internal representation of source code +locations. + @opindex fdump-ipa @item -fdump-ipa-@var{switch} @itemx -fdump-ipa-@var{switch}-@var{options} @@ -20737,6 +21453,93 @@ By default, the dump will contain messages about successful optimizations (equivalent to @option{-optimized}) together with low-level details about the analysis. +@opindex fdump-ipa-clones +@item -fdump-ipa-clones + +Create a dump file containing information about creation of call graph +node clones and removals of call graph nodes during inter-procedural +optimizations and transformations. Its main intended use is that tools +that create live-patches can determine the set of functions that need to +be live-patched to completely replace a particular function (see +@option{-flive-patching}). The file name is generated by appending +suffix @code{ipa-clones} to the source file name, and the file is +created in the same directory as the output file. Each entry in the +file is on a separate line containing semicolon separated fields. + +In the case of call graph clone creation, the individual fields are: + +@enumerate +@item +String @code{Callgraph clone}. + +@item +Name of the function being cloned as it is presented to the assembler. + +@item +A number that uniquely represents the function being cloned in the call +graph. Note that the number is unique only within a compilation unit or +within whole-program analysis but is likely to be different in the two +phases. + +@item +The file name of the source file where the function is defined. + +@item +The line on which the function definition is located. + +@item +The column where the function definition is located. + +@item +Name of the new function clone as it is presented to the assembler. + +@item +A number that uniquely represents the new function clone in the call +graph. Note that the number is unique only within a compilation unit or +within whole-program analysis but is likely to be different in the two +phases. + +@item +The file name of the source file where the source code location of the +new clone points to. + +@item +The line to which the source code location of the new clone points to. + +@item +The column to which the source code location of the new clone points to. + +@item +A string that determines the reason for cloning. + +@end enumerate + +In the case of call graph clone removal, the individual fields are: + +@enumerate +@item +String @code{Callgraph removal}. + +@item +Name of the function being removed as it would be presented to the assembler. + +@item +A number that uniquely represents the function being cloned in the call +graph. Note that the number is unique only within a compilation unit or +within whole-program analysis but is likely to be different in the two +phases. + +@item +The file name of the source file where the function is defined. + +@item +The line on which the function definition is located. + +@item +The column where the function definition is located. + +@end enumerate + @opindex fdump-lang @item -fdump-lang Dump language-specific information. The file name is made by appending @@ -20750,30 +21553,10 @@ Dump language-specific information. The file name is made by appending @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename} Control the dumping of language-specific information. The @var{options} and @var{filename} portions behave as described in the -@option{-fdump-tree} option. The following @var{switch} values are -accepted: - -@table @samp -@item all - -Enable all language-specific dumps. - -@item class -Dump class hierarchy information. Virtual table information is emitted -unless '@option{slim}' is specified. This option is applicable to C++ only. - -@item module -Dump module information. Options @option{lineno} (locations), -@option{graph} (reachability), @option{blocks} (clusters), -@option{uid} (serialization), @option{alias} (mergeable), -@option{asmname} (Elrond), @option{eh} (mapper) & @option{vops} -(macros) may provide additional information. This option is -applicable to C++ only. - -@item raw -Dump the raw internal tree data. This option is applicable to C++ only. - -@end table +@option{-fdump-tree} option. @option{-fdump-tree-all} enables all +language-specific dumps; other options vary with the language. For +instance, see @xref{C++ Dialect Options} for the @option{-fdump-lang} +flags supported by the C++ front-end. @opindex fdump-passes @item -fdump-passes @@ -20842,8 +21625,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 @@ -20865,6 +21647,9 @@ passes). @item note Enable other detailed optimization information (only available in certain passes). +@item folding +Enable dumping information about match-and-simplify (match.pd) patterns, +when they are applied. @item all Turn on all options, except @option{raw}, @option{slim}, @option{verbose} and @option{lineno}. @@ -21196,6 +21981,7 @@ The @var{string} should be different for every file you compile. @opindex save-temps @item -save-temps +@itemx --save-temps Store the usual ``temporary'' intermediate files permanently; name them as auxiliary output files, as specified described under @option{-dumpbase} and @option{-dumpdir}. @@ -21468,6 +22254,8 @@ For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations. @opindex print-file-name @item -print-file-name=@var{library} +@itemx --print-file-name=@var{library} +@itemx --print-file-name @var{library} Print the full absolute name of the library file @var{library} that would be used when linking---and don't do anything else. With this option, GCC does not compile or link anything; it just prints the @@ -21475,12 +22263,14 @@ file name. @opindex print-multi-directory @item -print-multi-directory +@itemx --print-multi-directory Print the directory name corresponding to the multilib selected by any other switches present in the command line. This directory is supposed to exist in @env{GCC_EXEC_PREFIX}. @opindex print-multi-lib @item -print-multi-lib +@itemx --print-multi-lib Print the mapping from multilib directory names to compiler switches that enable them. The directory name is separated from the switches by @samp{;}, and each switch starts with an @samp{@@} instead of the @@ -21489,6 +22279,7 @@ ease shell processing. @opindex print-multi-os-directory @item -print-multi-os-directory +@itemx --print-multi-os-directory Print the path to OS libraries for the selected multilib, relative to some @file{lib} subdirectory. If OS libraries are present in the @file{lib} subdirectory and no multilibs are used, this is @@ -21499,15 +22290,19 @@ subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}. @opindex print-multiarch @item -print-multiarch +@itemx --print-multiarch Print the path to OS libraries for the selected multiarch, relative to some @file{lib} subdirectory. @opindex print-prog-name @item -print-prog-name=@var{program} +@itemx --print-prog-name=@var{program} +@itemx --print-prog-name @var{program} Like @option{-print-file-name}, but searches for a program such as @command{cpp}. @opindex print-libgcc-file-name @item -print-libgcc-file-name +@itemx --print-libgcc-file-name Same as @option{-print-file-name=libgcc.a}. This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs} @@ -21519,6 +22314,7 @@ gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name` @opindex print-search-dirs @item -print-search-dirs +@itemx --print-search-dirs Print the name of the configured installation directory and a list of program and library directories @command{gcc} searches---and don't do anything else. @@ -21532,6 +22328,7 @@ Don't forget the trailing @samp{/}. @opindex print-sysroot @item -print-sysroot +@itemx --print-sysroot Print the target sysroot directory that is used during compilation. This is the target sysroot specified either at configure time or using the @option{--sysroot} option, possibly with an extra @@ -21540,6 +22337,7 @@ specified, the option prints nothing. @opindex print-sysroot-headers-suffix @item -print-sysroot-headers-suffix +@itemx --print-sysroot-headers-suffix Print the suffix added to the target sysroot when searching for headers, or give an error if the compiler is not configured with such a suffix---and don't do anything else. @@ -21607,8 +22405,8 @@ platform. * DEC Alpha Options:: * eBPF Options:: * FR30 Options:: -* FT32 Options:: * FRV Options:: +* FT32 Options:: * GNU/Linux Options:: * H8/300 Options:: * HPPA Options:: @@ -21678,17 +22476,22 @@ The @samp{ilp32} model is deprecated. Generate big-endian code. This is the default when GCC is configured for an @samp{aarch64_be-*-*} target. -@opindex mgeneral-regs-only -@item -mgeneral-regs-only -Generate code which uses only the general-purpose registers. This will prevent -the compiler from using floating-point and Advanced SIMD registers but will not -impose any restrictions on the assembler. - @opindex mlittle-endian @item -mlittle-endian Generate little-endian code. This is the default when GCC is configured for an @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target. +@opindex menable-sysreg-checking +@item -menable-sysreg-checking +Generates an error message if an attempt is made to access a system register +which is not available on the target architecture. + +@opindex mgeneral-regs-only +@item -mgeneral-regs-only +Generate code that uses only the general-purpose registers. This prevents +the compiler from using floating-point and Advanced SIMD registers but does not +impose any restrictions on the assembler. + @opindex mcmodel= @opindex mcmodel=tiny @item -mcmodel=tiny @@ -21818,6 +22621,8 @@ This option only has an effect if @option{-ffast-math} or precision of division results to about 16 bits for single precision and to 32 bits for double precision. +@opindex mtrack-speculation +@opindex mno-track-speculation @item -mtrack-speculation @itemx -mno-track-speculation Enable or disable generation of additional code to track speculative @@ -21826,6 +22631,8 @@ be used by the compiler when expanding calls to @code{__builtin_speculation_safe_copy} to permit a more efficient code sequence to be generated. +@opindex moutline-atomics +@opindex mno-outline-atomics @item -moutline-atomics @itemx -mno-outline-atomics Enable or disable calls to out-of-line helpers to implement atomic operations. @@ -21840,6 +22647,39 @@ used directly. The same applies when using @option{-mcpu=} when the selected cpu supports the @samp{lse} feature. This option is on by default. +@opindex mmax-vectorization +@opindex mno-max-vectorization +@item -mmax-vectorization +@itemx -mno-max-vectorization +Enable or disable an override to vectorizer cost model making vectorization +always appear profitable. This option can be combined with +@option{-mautovec-preference} allowing precise control over which ISA will be +used for auto-vectorization. Unlike @option{-fno-vect-cost-model} or +@option{-fvect-cost-model=unlimited} this option does not turn off cost +comparison between different vector modes. + +@opindex mautovec-preference +@item -mautovec-preference=@var{name} +Force an ISA selection strategy for auto-vectorization. The possible +values of @var{name} are: +@table @samp +@item default +Use the default heuristics. +@item asimd-only +Use only Advanced SIMD for auto-vectorization. +@item sve-only +Use only SVE for auto-vectorization. +@item prefer-asimd +Use both Advanced SIMD and SVE. Prefer Advanced SIMD when the costs are +deemed equal. +@item prefer-sve +Use both Advanced SIMD and SVE. Prefer SVE when the costs are deemed equal. +@end table + +For best performance it is highly recommended to use @option{-mcpu} or +@option{-mtune} instead. This parameter should only be used for code +exploration. + @opindex march @item -march=@var{name} Specify the name of the target architecture and, optionally, one or @@ -21866,7 +22706,7 @@ and the features that they enable by default: @item @samp{armv9.2-a} @tab Armv9.2-A @tab @samp{armv9.1-a}, @samp{+wfxt}, @samp{+xs} @item @samp{armv9.3-a} @tab Armv9.3-A @tab @samp{armv9.2-a}, @samp{+mops} @item @samp{armv9.4-a} @tab Armv9.4-A @tab @samp{armv9.3-a}, @samp{+sve2p1} -@item @samp{armv9.5-a} @tab Armv9.4-A @tab @samp{armv9.4-a}, @samp{cpa}, @samp{+faminmax}, @samp{+lut} +@item @samp{armv9.5-a} @tab Armv9.5-A @tab @samp{armv9.4-a}, @samp{cpa}, @samp{+faminmax}, @samp{+lut} @item @samp{armv8-r} @tab Armv8-R @tab @samp{armv8-r} @end multitable @@ -21920,13 +22760,14 @@ performance of the code. Permissible values for this option are: @samp{cortex-x2}, @samp{cortex-x3}, @samp{cortex-x4}, @samp{cortex-a510}, @samp{cortex-a520}, @samp{cortex-a520ae}, @samp{cortex-a710}, @samp{cortex-a715}, @samp{cortex-a720}, @samp{cortex-a720ae}, @samp{ampere1}, @samp{ampere1a}, -@samp{ampere1b}, @samp{cobalt-100}, @samp{apple-m1}, @samp{apple-m2}, -@samp{apple-m3} and @samp{native}. +@samp{ampere1b}, @samp{ampere1c}, @samp{cobalt-100}, @samp{apple-m1}, +@samp{apple-m2}, @samp{apple-m3}, @samp{apple-m4}, @samp{c1-nano}, +@samp{c1-pro}, @samp{c1-premium} @samp{c1-ultra} and @samp{native}. The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53}, @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}, -@samp{apple-m1}, @samp{apple-m2}, @samp{apple-m3} specify that GCC +@samp{apple-m1}, @samp{apple-m2}, @samp{apple-m3}, @samp{gb10} specify that GCC should tune for a big.LITTLE system. The value @samp{neoverse-512tvb} specifies that GCC should tune @@ -21986,11 +22827,6 @@ across releases. This option is only intended to be useful when developing GCC. -@opindex mverbose-cost-dump -@item -mverbose-cost-dump -Enable verbose cost model dumping in the debug dump files. This option is -provided for use in debugging the compiler. - @opindex mpc-relative-literal-loads @opindex mno-pc-relative-literal-loads @item -mpc-relative-literal-loads @@ -22007,22 +22843,31 @@ Permissible values are @samp{none}, which disables return address signing, @samp{non-leaf}, which enables pointer signing for functions which are not leaf functions, and @samp{all}, which enables pointer signing for all functions. The default value is @samp{none}. This option has been deprecated by --mbranch-protection. +@option{-mbranch-protection}. @opindex mbranch-protection -@item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}+@var{b-key}]|@var{bti}|@var{gcs} +@item -mbranch-protection=@var{features} Select the branch protection features to use. +@var{features} can have one of the following forms: + @samp{none} is the default and turns off all types of branch protection. + @samp{standard} turns on all types of branch protection features. If a feature has additional tuning options, then @samp{standard} sets it to its standard level. -@samp{pac-ret[+@var{leaf}]} turns on return address signing to its standard + +@samp{pac-ret} turns on return address signing to its standard level: signing functions that save the return address to memory (non-leaf -functions will practically always do this) using the a-key. The optional -argument @samp{leaf} can be used to extend the signing to include leaf -functions. The optional argument @samp{b-key} can be used to sign the functions -with the B-key instead of the A-key. +functions practically always do this) using the A-key. + +@samp{pac-ret+leaf} extends the @samp{pac-ret} signing to include leaf +functions. + +@samp{pac-ret+b-key} or @samp{pac-ret+leaf+b-key} can be used to +sign the functions with the B-key instead of the A-key. + @samp{bti} turns on branch target identification mechanism. + @samp{gcs} turns on guarded control stack compatible code generation. @opindex mharden-sls @@ -22052,12 +22897,16 @@ disables the pass. @option{-Os}. @option{-mearly-ra=none} is the default otherwise. @opindex mearly-ldp-fusion +@opindex mno-early-ldp-fusion @item -mearly-ldp-fusion +@itemx -mno-early-ldp-fusion Enable the copy of the AArch64 load/store pair fusion pass that runs before register allocation. Enabled by default at @samp{-O} and above. @opindex mlate-ldp-fusion +@opindex mno-late-ldp-fusion @item -mlate-ldp-fusion +@itemx -mno-late-ldp-fusion Enable the copy of the AArch64 load/store pair fusion pass that runs after register allocation. Enabled by default at @samp{-O} and above. @@ -22083,13 +22932,6 @@ hardware SVE vector lengths. The default is @samp{-msve-vector-bits=scalable}, which produces vector-length agnostic code. -@opindex Wexperimental-fmv-target -@opindex Wno-experimental-fmv-target -@item -Wexperimental-fmv-target -Warn about use of experimental Function Multi Versioning. -The Arm C Language Extension specification for Function Multi Versioning -is beta and subject to change. Any usage of FMV is caveated that future -behavior change and incompatibility is likely. @end table @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers @@ -22215,6 +23057,9 @@ Enable the FlagM2 flag conversion instructions. Enable the Pointer Authentication Extension. @item cssc Enable the Common Short Sequence Compression instructions. +@item cmpbr +Enable the shorter compare and branch instructions, @code{cbb}, @code{cbh} and +@code{cb}. @item sme Enable the Scalable Matrix Extension. This is only supported when SVE2 is also enabled. @@ -22282,6 +23127,8 @@ extension in streaming mode. Enable the Floating Point Absolute Maximum/Minimum extension. @item lut Enable the Lookup Table extension. +@item sme-lutv2 +Enable the SME Lookup Table v2 (LUTv2) extension. @item cpa Enable the Checked Pointer Arithmetic instructions. @item sve-b16b16 @@ -22302,12 +23149,16 @@ These @samp{-m} options are defined for Adapteva Epiphany: @table @gcctabopt @opindex mhalf-reg-file +@opindex mno-half-reg-file @item -mhalf-reg-file +@itemx -mno-half-reg-file Don't allocate any register in the range @code{r32}@dots{}@code{r63}. That allows code to run on hardware variants that lack these registers. @opindex mprefer-short-insn-regs +@opindex mno-prefer-short-insn-regs @item -mprefer-short-insn-regs +@itemx -mno-prefer-short-insn-regs Preferentially allocate registers that allow short instruction generation. This can result in increased instruction count, so this may either reduce or increase overall code size. @@ -22319,7 +23170,9 @@ This cost is only a heuristic and is not guaranteed to produce consistent results across releases. @opindex mcmove +@opindex mno-cmove @item -mcmove +@itemx -mno-cmove Enable the generation of conditional moves. @opindex mnops @@ -22329,6 +23182,7 @@ Emit @var{num} NOPs before every other generated instruction. @opindex mno-soft-cmpsf @opindex msoft-cmpsf @item -mno-soft-cmpsf +@itemx -msoft-cmpsf For single-precision floating-point comparisons, emit an @code{fsub} instruction and test the flags. This is faster than a software comparison, but can get incorrect results in the presence of NaNs, or when two different small @@ -22353,24 +23207,34 @@ toolchain with the appropriate @option{--with-stack-offset=@var{num}} option. @opindex mno-round-nearest @opindex mround-nearest @item -mno-round-nearest -Make the scheduler assume that the rounding mode has been set to +@itemx -mround-nearest +@option{-mno-round-nearest} +makes the scheduler assume that the rounding mode has been set to truncating. The default is @option{-mround-nearest}. @opindex mlong-calls +@opindex mno-long-calls @item -mlong-calls If not otherwise specified by an attribute, assume all calls might be beyond the offset range of the @code{b} / @code{bl} instructions, and therefore load the function address into a register before performing a (otherwise direct) call. This is the default. -@opindex short-calls +@opindex mshort-calls +@opindex mno-short-calls @item -mshort-calls If not otherwise specified by an attribute, assume all direct calls are in the range of the @code{b} / @code{bl} instructions, so use these instructions -for direct calls. The default is @option{-mlong-calls}. +for direct calls. + +The default is @option{-mlong-calls}. Note that @option{-mlong-calls} +is equivalent to @option{-mno-short-calls}, and similarly +@option{-mno-long-calls} is equivalent to @option{-mshort-calls}. @opindex msmall16 +@opindex mno-small16 @item -msmall16 +@itemx -mno-small16 Assume addresses can be loaded as 16-bit unsigned values. This does not apply to function addresses for which @option{-mlong-calls} semantics are in effect. @@ -22412,23 +23276,40 @@ integer multiply, or integer multiply-and-accumulate. The default is @option{-mfp-mode=caller} +@opindex mmay-round-for-trunc +@opindex mno-may-round-for-trunc +@item -mmay-round-for-trunc +@itemx -mno-may-round-for-trunc +This option allows floating point to integer truncation to be replaced +with rounding to save mode switching. It's disabled by default. + +@opindex mfp-iarith +@opindex mno-fp-iarith +@item -mfp-iarith +@itemx -mno-fp-iarith +This option enables use of the floating-point unit for integer add and +subtract. It's disabled by default. + @opindex mno-split-lohi @opindex msplit-lohi -@opindex mno-postinc -@opindex mpostinc +@opindex mno-post-inc +@opindex mpost-inc @opindex mno-postmodify -@opindex mpostmodify -@item -mno-split-lohi -@itemx -mno-postinc -@itemx -mno-postmodify -Code generation tweaks that disable, respectively, splitting of 32-bit +@opindex mpost-modify +@item -msplit-lohi +@itemx -mno-split-lohi +@itemx -mpost-inc +@itemx -mno-post-inc +@itemx -mpost-modify +@itemx -mno-post-modify +Code generation tweaks that control, respectively, splitting of 32-bit loads, generation of post-increment addresses, and generation of post-modify addresses. The defaults are @option{msplit-lohi}, @option{-mpost-inc}, and @option{-mpost-modify}. @opindex mno-vect-double @opindex mvect-double -@item -mnovect-double +@item -mno-vect-double Change the preferred SIMD mode to SImode. The default is @option{-mvect-double}, which uses DImode as preferred SIMD mode. @@ -22441,7 +23322,9 @@ interfaces are unaffected if they don't use SIMD vector modes in places that affect size and/or alignment of relevant types. @opindex msplit-vecmove-early +@opindex mno-split-vecmove-early @item -msplit-vecmove-early +@itemx -mno-split-vecmove-early Split vector moves into single word moves before reload. In theory this can give better register allocation, but so far the reverse seems to be generally the case. @@ -22497,9 +23380,19 @@ Compile for CDNA2 Instinct MI200 series devices (gfx90a). @item gfx90c Compile for GCN5 Vega 7 devices (gfx90c). +@item gfx942 +Compile for CDNA3 Instinct MI300 series devices (gfx942). (Experimental) + +@item gfx950 +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 +GFX9 devices: gfx942 and gfx950. (Experimental) @item gfx1030 Compile for RDNA2 gfx1030 devices (GFX10 series). @@ -22524,7 +23417,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). @@ -22552,9 +23445,14 @@ 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 mgang-private-size +@item -mgang-private-size=@var{bytes} +Set the amount of local data-share (LDS) memory to reserve for +gang-private variables. The default is 512. + @opindex msram-ecc @item -msram-ecc=on @itemx -msram-ecc=off @@ -22564,14 +23462,6 @@ disabled, or either mode. This feature can be enabled per-process on some devices. The compiled code must match the device mode. The default is @samp{any}, for devices that support it. -@opindex mstack-size -@item -mstack-size=@var{bytes} -Specify how many @var{bytes} of stack space will be requested for each GPU -thread (wave-front). Beware that there may be many threads and limited memory -available. The size of the stack allocation may also have an impact on -run-time performance. The default is 32KB when using OpenACC or OpenMP, and -1MB otherwise. - @opindex mxnack @item -mxnack=on @itemx -mxnack=off @@ -22582,6 +23472,12 @@ configure XNACK. The compiled code must match the device mode. The default is @samp{-mxnack=any} on devices that support Unified Shared Memory, and @samp{-mxnack=no} otherwise. +@opindex Wopenacc-dims +@opindex Wno-openacc-dims +@item -Wopenacc-dims +@itemx -Wno-openacc-dims +Control warnings about invalid OpenACC dimensions. + @end table @node ARC Options @@ -23380,9 +24276,10 @@ These @samp{-m} options are defined for the ARM port: @opindex mabi @item -mabi=@var{name} Generate code for the specified ABI@. Permissible values are: @samp{apcs-gnu}, -@samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}. +@samp{atpcs}, @samp{aapcs} and @samp{aapcs-linux}. @opindex mapcs-frame +@opindex mno-apcs-frame @item -mapcs-frame Generate a stack frame that is compliant with the ARM Procedure Call Standard for all functions, even if this is not strictly necessary for @@ -23395,26 +24292,8 @@ This option is deprecated. @item -mapcs This is a synonym for @option{-mapcs-frame} and is deprecated. -@ignore -@c not currently implemented -@opindex mapcs-stack-check -@item -mapcs-stack-check -Generate code to check the amount of stack space available upon entry to -every function (that actually uses some stack space). If there is -insufficient space available then either the function -@code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is -called, depending upon the amount of stack space required. The runtime -system is required to provide these functions. The default is -@option{-mno-apcs-stack-check}, since this produces smaller code. - -@c not currently implemented -@opindex mapcs-reentrant -@item -mapcs-reentrant -Generate reentrant, position-independent code. The default is -@option{-mno-apcs-reentrant}. -@end ignore - @opindex mthumb-interwork +@opindex mno-thumb-interwork @item -mthumb-interwork Generate code that supports calling between the ARM and Thumb instruction sets. Without this option, on pre-v5 architectures, the @@ -23423,12 +24302,14 @@ default is @option{-mno-thumb-interwork}, since slightly larger code is generated when @option{-mthumb-interwork} is specified. In AAPCS configurations this option is meaningless. -@opindex mno-sched-prolog @opindex msched-prolog -@item -mno-sched-prolog -Prevent the reordering of instructions in the function prologue, or the +@opindex mno-sched-prolog +@item -msched-prolog +@itemx -mno-sched-prolog +Allow or prevent the reordering of instructions in the function prologue, or the merging of those instruction with the instructions in the function's -body. This means that all functions start with a recognizable set +body. With @option{-mno-sched-prolog}, +this means that all functions start with a recognizable set of instructions (or in fact one of a choice from a small set of different function prologues), and this information can be used to locate the start of functions inside an executable piece of code. The @@ -24192,6 +25073,7 @@ information using structures or unions. This option is deprecated. @opindex mabort-on-noreturn +@opindex mno-abort-on-noreturn @item -mabort-on-noreturn Generate a call to the function @code{abort} at the end of a @code{noreturn} function. It is executed if the function tries to @@ -24226,6 +25108,7 @@ the compiler generates code to handle function calls via function pointers. @opindex msingle-pic-base +@opindex mno-single-pic-base @item -msingle-pic-base Treat the register used for PIC addressing as read-only, rather than loading it in the prologue for each function. The runtime system is @@ -24241,6 +25124,7 @@ determined by compiler. For single PIC base case, the default is otherwise the default is @samp{R10}. @opindex mpic-data-is-text-relative +@opindex mno-pic-data-is-text-relative @item -mpic-data-is-text-relative Assume that the displacement between the text and data segments is fixed at static link time. This permits using PC-relative addressing @@ -24250,6 +25134,7 @@ disabled on such targets, it will enable @option{-msingle-pic-base} by default. @opindex mpoke-function-name +@opindex mno-poke-function-name @item -mpoke-function-name Write the name of each function into the text section, directly preceding the function prologue. The generated code is similar to this: @@ -24287,25 +25172,22 @@ You can also override the ARM and Thumb mode for each function by using the @code{target("thumb")} and @code{target("arm")} function attributes (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}). -@opindex mflip-thumb -@item -mflip-thumb -Switch ARM/Thumb modes on alternating functions. -This option is provided for regression testing of mixed Thumb/ARM code -generation, and is not intended for ordinary use in compiling code. - @opindex mtpcs-frame +@opindex mno-tpcs-frame @item -mtpcs-frame Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all non-leaf functions. (A leaf function is one that does not call any other functions.) The default is @option{-mno-tpcs-frame}. @opindex mtpcs-leaf-frame +@opindex mno-tpcs-leaf-frame @item -mtpcs-leaf-frame Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all leaf functions. (A leaf function is one that does not call any other functions.) The default is @option{-mno-apcs-leaf-frame}. @opindex mcallee-super-interworking +@opindex mno-callee-super-interworking @item -mcallee-super-interworking Gives all externally visible functions in the file being compiled an ARM instruction set header which switches to Thumb mode before executing the @@ -24314,6 +25196,7 @@ non-interworking code. This option is not valid in AAPCS configurations because interworking is enabled by default. @opindex mcaller-super-interworking +@opindex mno-caller-super-interworking @item -mcaller-super-interworking Allows calls via function pointers (including virtual functions) to execute correctly regardless of whether the target code has been @@ -24347,6 +25230,7 @@ library support. Initial and local exec TLS models are unaffected by this option and always use the original scheme. @opindex mword-relocations +@opindex mno-word-relocations @item -mword-relocations Only generate absolute relocations on word-sized values (i.e.@: R_ARM_ABS32). This is enabled by default on targets (uClinux, SymbianOS) where the runtime @@ -24354,6 +25238,7 @@ loader imposes this restriction, and when @option{-fpic} or @option{-fPIC} is specified. This option conflicts with @option{-mslow-flash-data}. @opindex mfix-cortex-m3-ldrd +@opindex mno-fix-cortex-m3-ldrd @item -mfix-cortex-m3-ldrd Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions with overlapping destination and base registers are used. This option avoids @@ -24386,11 +25271,8 @@ setting of this option. If unaligned access is enabled then the preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also defined. -@opindex mneon-for-64bits -@item -mneon-for-64bits -This option is deprecated and has no effect. - @opindex mslow-flash-data +@opindex mno-slow-flash-data @item -mslow-flash-data Assume loading data from flash is slower than fetching instruction. Therefore literal load is minimized for better performance. @@ -24398,6 +25280,7 @@ This option is only supported when compiling for ARMv7 M-profile and off by default. It conflicts with @option{-mword-relocations}. @opindex masm-syntax-unified +@opindex mno-asm-syntax-unified @item -masm-syntax-unified Assume inline assembler is using unified asm syntax. The default is currently off which implies divided syntax. This option has no impact @@ -24405,24 +25288,14 @@ on Thumb2. However, this may change in future releases of GCC. Divided syntax should be considered deprecated. @opindex mrestrict-it +@opindex mno-restrict-it @item -mrestrict-it Restricts generation of IT blocks to conform to the rules of ARMv8-A. IT blocks can only contain a single 16-bit instruction from a select set of instructions. This option is on by default for ARMv8-A Thumb mode. -@opindex mprint-tune-info -@item -mprint-tune-info -Print CPU tuning information as comment in assembler file. This is -an option used only for regression testing of the compiler and not -intended for ordinary use in compiling code. This option is disabled -by default. - -@opindex mverbose-cost-dump -@item -mverbose-cost-dump -Enable verbose cost model dumping in the debug dump files. This option is -provided for use in debugging the compiler. - @opindex mpure-code +@opindex mno-pure-code @item -mpure-code Do not allow constant data to be placed in code sections. Additionally, when compiling for ELF object format give all text sections the @@ -24436,6 +25309,7 @@ Development Tools Engineering Specification", which can be found on @url{https://developer.arm.com/documentation/ecm0359818/latest/}. @opindex mfix-cmse-cve-2021-35465 +@opindex mno-fix-cmse-cve-2021-35465 @item -mfix-cmse-cve-2021-35465 Mitigate against a potential security issue with the @code{VLLDM} instruction in some M-profile devices when using CMSE (CVE-2021-365465). This option is @@ -24475,24 +25349,33 @@ build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi}) toolchain as the one used to build the userland programs. @opindex mbranch-protection -@item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}][+@var{bti}]|@var{bti}[+@var{pac-ret}[+@var{leaf}]] +@item -mbranch-protection=@var{features} + Enable branch protection features (armv8.1-m.main only). -@samp{none} generate code without branch protection or return address + +@var{features} can have one of the following forms: + +@samp{none} generates code without branch protection or return address signing. -@samp{standard[+@var{leaf}]} generate code with all branch protection + +@samp{standard} generates code with all branch protection features enabled at their standard level. -@samp{pac-ret[+@var{leaf}]} generate code with return address signing + +@samp{pac-ret} generates code with return address signing set to its standard level, which is to sign all functions that save the return address to memory. -@samp{leaf} When return address signing is enabled, also sign leaf + +@samp{pac-ret+leaf} extends the @samp{pac-ret} signing to include leaf functions even if they do not write the return address to memory. -+@samp{bti} Add landing-pad instructions at the permitted targets of + +@samp{bti} adds landing-pad instructions at the permitted targets of indirect branch instructions. -If the @samp{+pacbti} architecture extension is not enabled, then all +If support for the @samp{+pacbti} architecture extension is not enabled +(e.g. via @option{-march=}), then all branch protection and return address signing operations are constrained to use only the instructions defined in the -architectural-NOP space. The generated code will remain +architectural-NOP space. The generated code remains backwards-compatible with earlier versions of the architecture, but the additional security can be enabled at run time on processors that support the @samp{PACBTI} extension. @@ -24759,6 +25642,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 @@ -25298,73 +26185,66 @@ Certain other options, such as @option{-mid-shared-library} and @option{-mfdpic}, imply @option{-msim}. @opindex momit-leaf-frame-pointer +@opindex mno-omit-leaf-frame-pointer @item -momit-leaf-frame-pointer Don't keep the frame pointer in a register for leaf functions. This avoids the instructions to save, set up and restore frame pointers and makes an extra register available in leaf functions. @opindex mspecld-anomaly +@opindex mno-specld-anomaly @item -mspecld-anomaly +@itemx -mno-specld-anomaly When enabled, the compiler ensures that the generated code does not contain speculative loads after jump instructions. If this option is used, @code{__WORKAROUND_SPECULATIVE_LOADS} is defined. -@opindex mno-specld-anomaly -@opindex mspecld-anomaly -@item -mno-specld-anomaly -Don't generate extra code to prevent speculative loads from occurring. - @opindex mcsync-anomaly +@opindex mno-csync-anomaly @item -mcsync-anomaly +@itemx -mno-csync-anomaly When enabled, the compiler ensures that the generated code does not contain CSYNC or SSYNC instructions too soon after conditional branches. If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined. -@opindex mno-csync-anomaly -@opindex mcsync-anomaly -@item -mno-csync-anomaly -Don't generate extra code to prevent CSYNC or SSYNC instructions from -occurring too soon after a conditional branch. - @opindex mlow64k +@opindex mno-low64k @item -mlow64k +@itemx -mno-low64k When enabled, the compiler is free to take advantage of the knowledge that -the entire program fits into the low 64k of memory. - -@opindex mno-low64k -@item -mno-low64k -Assume that the program is arbitrarily large. This is the default. +the entire program fits into the low 64k of memory. The default behavior +is to assume that the program is arbitrarily large (@option{-mno-low64k}). @opindex mstack-check-l1 +@opindex mno-stack-check-l1 @item -mstack-check-l1 Do stack checking using information placed into L1 scratchpad memory by the uClinux kernel. @opindex mid-shared-library +@opindex mno-id-shared-library @item -mid-shared-library +@itemx -mno-id-shared-library Generate code that supports shared libraries via the library ID method. This allows for execute in place and shared libraries in an environment without virtual memory management. This option implies @option{-fPIC}. With a @samp{bfin-elf} target, this option implies @option{-msim}. - -@opindex mno-id-shared-library -@opindex mid-shared-library -@item -mno-id-shared-library -Generate code that doesn't assume ID-based shared libraries are being used. -This is the default. +The default is @option{-mno-id-shared-library}, to generate +code that doesn't assume ID-based shared libraries are being used. @opindex mleaf-id-shared-library +@opindex mno-leaf-id-shared-library @item -mleaf-id-shared-library +@itemx -mno-leaf-id-shared-library Generate code that supports shared libraries via the library ID method, but assumes that this library or executable won't link against any other ID shared libraries. That allows the compiler to use faster code for jumps and calls. -@opindex mno-leaf-id-shared-library -@opindex mleaf-id-shared-library -@item -mno-leaf-id-shared-library -Do not assume that the code being compiled won't link against any ID shared -libraries. Slower code is generated for jump and call insns. +The default is @option{-mno-leaf-id-shared-library}, in which the +no assumption is made that the code being compiled won't link +against any ID shared libraries. Slower code is generated for jump +and call insns. @opindex mshared-library-id @item -mshared-library-id=n @@ -25374,17 +26254,15 @@ other values forces the allocation of that number to the current library but is no more space- or time-efficient than omitting this option. @opindex msep-data +@opindex mno-sep-data @item -msep-data +@itemx -mno-sep-data Generate code that allows the data segment to be located in a different area of memory from the text segment. This allows for execute in place in an environment without virtual memory management by eliminating relocations -against the text section. - -@opindex mno-sep-data -@opindex msep-data -@item -mno-sep-data -Generate code that assumes that the data segment follows the text segment. -This is the default. +against the text section. The default is @option{-mno-sep-data}, which +tells GCC to generate code that assumes that the data segment follows +the text segment. @opindex mlong-calls @opindex mno-long-calls @@ -25402,17 +26280,20 @@ switches have no effect on how the compiler generates code to handle function calls via function pointers. @opindex mfast-fp +@opindex mno-fast-fp @item -mfast-fp Link with the fast floating-point library. This library relaxes some of the IEEE floating-point standard's rules for checking inputs against Not-a-Number (NAN), in the interest of performance. @opindex minline-plt +@opindex mno-inline-plt @item -minline-plt Enable inlining of PLT entries in function calls to functions that are not known to bind locally. It has no effect without @option{-mfdpic}. @opindex mmulticore +@opindex mno-multicore @item -mmulticore Build a standalone application for multicore Blackfin processors. This option causes proper start files and link scripts supporting @@ -25429,6 +26310,7 @@ If this option is not used, the single-core application programming model is used. @opindex mcorea +@opindex mno-corea @item -mcorea Build a standalone application for Core A of BF561 when using the one-application-per-core programming model. Proper start files @@ -25437,6 +26319,7 @@ and link scripts are used to support Core A, and the macro This option can only be used in conjunction with @option{-mmulticore}. @opindex mcoreb +@opindex mno-coreb @item -mcoreb Build a standalone application for Core B of BF561 when using the one-application-per-core programming model. Proper start files @@ -25446,6 +26329,7 @@ should be used instead of @code{main}. This option can only be used in conjunction with @option{-mmulticore}. @opindex msdram +@opindex mno-sdram @item -msdram Build a standalone application for SDRAM. Proper start files and link scripts are used to put the application into SDRAM, and the macro @@ -25453,6 +26337,7 @@ link scripts are used to put the application into SDRAM, and the macro The loader should initialize SDRAM before loading the application. @opindex micplb +@opindex mno-icplb @item -micplb Assume that ICPLBs are enabled at run time. This has an effect on certain anomaly workarounds. For Linux targets, the default is to assume ICPLBs @@ -25505,6 +26390,17 @@ addresses to access all data. Put all initialized global and static data in the @code{.fardata} section, and all uninitialized data in the @code{.far} section. Put all constant data into the @code{.const} section. + +@opindex mdsbt +@opindex mno-dsbt +@item -mdsbt +Compile for the DSBT shared library ABI. This option is required to +compile with @option{-fpic} or @option{-fPIC}, and implies @option{-fpic}. + +@opindex mlong-calls +@opindex mno-long-calls +@item -mlong-calls +Avoid generating PC-relative calls; use indirection instead. @end table @node CRIS Options @@ -25536,6 +26432,8 @@ Warn when the stack frame of a function exceeds @var{n} bytes. @opindex metrax4 @opindex metrax100 +@opindex mno-etrax4 +@opindex mno-etrax100 @item -metrax4 @itemx -metrax100 The options @option{-metrax4} and @option{-metrax100} are synonyms for @@ -25549,6 +26447,7 @@ Work around a bug in the @code{muls} and @code{mulu} instructions for CPU models where it applies. This option is disabled by default. @opindex mpdebug +@opindex mno-pddebug @item -mpdebug Enable CRIS-specific verbose debug-related information in the assembly code. This option also has the effect of turning off the @samp{#NO_APP} @@ -25556,6 +26455,7 @@ formatted-code indicator to the assembler at the beginning of the assembly file. @opindex mcc-init +@opindex mno-cc-init @item -mcc-init Do not use condition-code results from previous instruction; always emit compare and test instructions before use of condition codes. @@ -25605,9 +26505,32 @@ option only together with visual inspection of the compiled code: no warnings or errors are generated when call-saved registers must be saved, or storage for local variables needs to be allocated. -@opindex melf -@item -melf -Legacy no-op option. +@opindex mbest-lib-options +@opindex moverride-best-lib-options +@item -mbest-lib-options +@itemx -moverride-best-lib-options +@option{-mbest-lib-options} selects the most feature-enabling options +allowed by other options. This option has no @samp{no-} form, but +@option{-moverride-best-lib-options} disables it regardless of the relative +order of the two options on the command line. + +@opindex mtrap-using-break8 +@opindex mno-trap-using-break8 +@item -mtrap-using-break8 +Emit traps as @samp{break 8}. This is the default for CRIS v3 and up. If +disabled, calls to @code{abort} are used instead. + +@opindex mtrap-unaligned-atomic +@opindex mno-trap-unaligned-atomic +@item -mtrap-unaligned-atomic +Emit checks causing @samp{break 8} instructions to execute when +applying atomic builtins on misaligned memory. + +@opindex munaligned-atomic-may-use-library +@opindex mno-unaligned-atomic-may-use-library +@item -munaligned-atomic-may-use-library +Handle atomic builtins that may be applied to unaligned data by calling +library functions. This option overrides @option{-mtrap-unaligned-atomic}. @opindex sim @item -sim @@ -25656,13 +26579,9 @@ Specify the C-SKY target processor. Valid values for @var{cpu} are: @samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}. @opindex mbig-endian -@opindex EB @opindex mlittle-endian -@opindex EL @item -mbig-endian -@itemx -EB @itemx -mlittle-endian -@itemx -EL Select big- or little-endian code. The default is little-endian. @@ -25683,15 +26602,8 @@ the hard-float and soft-float ABIs are not link-compatible; you must compile your entire program with the same ABI, and link with a compatible set of libraries. -@opindex mhard-float -@opindex msoft-float -@item -mhard-float -@itemx -msoft-float - -Select hardware or software floating-point implementations. -The default is soft float. - @opindex mdouble-float +@opindex mno-double-float @item -mdouble-float @itemx -mno-double-float When @option{-mhard-float} is in effect, enable generation of @@ -25699,6 +26611,7 @@ double-precision float instructions. This is the default except when compiling for CK803. @opindex mfdivdu +@opindex mno-fdivdu @item -mfdivdu @itemx -mno-fdivdu When @option{-mhard-float} is in effect, enable generation of @@ -25715,12 +26628,14 @@ Values for @var{fpu} are @samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}). @opindex melrw +@opindex mno-elrw @item -melrw @itemx -mno-elrw Enable the extended @code{lrw} instruction. This option defaults to on for CK801 and off otherwise. @opindex mistack +@opindex mno-istack @item -mistack @itemx -mno-istack Enable interrupt stack instructions; the default is off. @@ -25730,40 +26645,58 @@ The @option{-mistack} option is required to handle the (@pxref{C-SKY Function Attributes}). @opindex mmp +@opindex mno-mp @item -mmp +@itemx -mno-mp Enable multiprocessor instructions; the default is off. @opindex mcp +@opindex mno-cp @item -mcp +@itemx -mno-cp Enable coprocessor instructions; the default is off. @opindex mcache +@opindex mno-cache @item -mcache +@itemx -mno-cache Enable coprocessor instructions; the default is off. @opindex msecurity +@opindex mno-security @item -msecurity +@itemx -mno-security Enable C-SKY security instructions; the default is off. @opindex mtrust +@opindex mno-trust @item -mtrust +@itemx -mno-trust Enable C-SKY trust instructions; the default is off. @opindex mdsp +@opindex mno-dsp @opindex medsp +@opindex mno-edsp @opindex mvdsp +@opindex mno-vdsp @item -mdsp +@itemx -mno-dsp @itemx -medsp +@itemx -mno-edsp @itemx -mvdsp +@itemx -mno-vdsp Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively. All of these options default to off. @opindex mdiv +@opindex mno-div @item -mdiv @itemx -mno-div Generate divide instructions. Default is off. @opindex msmart +@opindex mno-smart @item -msmart @itemx -mno-smart Generate code for Smart Mode, using only registers numbered 0-7 to allow @@ -25772,6 +26705,7 @@ is the required behavior, and it defaults to on for CK802. For other targets, the default is off. @opindex mhigh-registers +@opindex mno-high-registers @item -mhigh-registers @itemx -mno-high-registers Generate code using the high registers numbered 16-31. This option @@ -25779,25 +26713,27 @@ is not supported on CK801, CK802, or CK803, and is enabled by default for other processors. @opindex manchor +@opindex mno-anchor @item -manchor @itemx -mno-anchor Generate code using global anchor symbol addresses. @opindex mpushpop +@opindex mno-pushpop @item -mpushpop @itemx -mno-pushpop Generate code using @code{push} and @code{pop} instructions. This option defaults to on. @opindex mmultiple-stld +@opindex mno-multiple-stld @item -mmultiple-stld -@itemx -mstm @itemx -mno-multiple-stld -@itemx -mno-stm Generate code using @code{stm} and @code{ldm} instructions. This option isn't supported on CK801 but is enabled by default on other processors. @opindex mconstpool +@opindex mno-constpool @item -mconstpool @itemx -mno-constpool Create constant pools in the compiler instead of deferring it to the @@ -25805,12 +26741,14 @@ assembler. This option is the default and required for correct code generation on CK801 and CK802, and is optional on other processors. @opindex mstack-size +@opindex mno-stack-size @item -mstack-size -@item -mno-stack-size +@itemx -mno-stack-size Emit @code{.stack_size} directives for each function in the assembly output. This option defaults to off. @opindex mccrt +@opindex mno-ccrt @item -mccrt @itemx -mno-ccrt Generate code for the C-SKY compiler runtime instead of libgcc. This @@ -25829,7 +26767,9 @@ prologue requirements and that cannot be debugged or backtraced. It is disabled by default. @opindex msim +@opindex mno-sim @item -msim +@itemx -mno-sim Links the library libsemi.a which is in compatible with simulator. Applicable to ELF compiler only. @@ -25883,6 +26823,7 @@ generated, enabling the selection of the required runtime startup object and entry point. @opindex mnop-fun-dllimport +@opindex mno-nop-fun-dllimport @item -mnop-fun-dllimport This option is available for Cygwin and MinGW targets. It specifies that the @code{dllimport} attribute should be ignored. @@ -25893,12 +26834,14 @@ This option is available for MinGW targets. It specifies that MinGW-specific thread support is to be used. @opindex municode +@opindex mno-unicode @item -municode This option is available for MinGW-w64 targets. It causes the @code{UNICODE} preprocessor macro to be predefined, and chooses Unicode-capable runtime startup code. @opindex mwin32 +@opindex mno-win32 @item -mwin32 This option is available for Cygwin and MinGW targets. It specifies that the typical Microsoft Windows predefined macros are to @@ -25906,6 +26849,7 @@ be set in the pre-processor, but does not influence the choice of runtime library/startup code. @opindex mwindows +@opindex mno-windows @item -mwindows This option is available for Cygwin and MinGW targets. It specifies that a GUI application is to be generated by @@ -26008,6 +26952,24 @@ directory. The main difference between this @option{-iframework} and warn about constructs contained within header files found via @var{dir}. This option is valid only for the C family of languages. +@opindex arch +@item -arch @var{name} +Generate output for architecture @var{name}. As described above, GCC +generates output for the architecture it was configured for, using its +usual options to select subarchitecture variants. The @option{-arch} +option is accepted for compatibility, but an error is diagnosed if +@var{name} is inconsistent with GCC's own idea of the target architecture. + +@opindex dependency-file +@item -dependency-file @var{filename} +Alias for the preprocessor option @option{-MF @var{filename}}. +@xref{Preprocessor Options}. + +@opindex fapple-kext +@opindex fno-apple-kext +@item -fapple-kext +Generate code for Darwin loadable kernel extensions. + @opindex gused @item -gused Emit debugging information for symbols that are used. For stabs @@ -26018,28 +26980,45 @@ This is by default ON@. @item -gfull Emit debugging information for all symbols and types. -@opindex fconstant-cfstrings -@item -fconstant-cfstrings -The @option{-fconstant-cfstrings} is an alias for @option{-mconstant-cfstrings}. +@opindex matt-stubs +@opindex mno-att-stubs +@item -matt-stubs +@itemx -mno-att-stubs +Enable AT&T-style PIC stubs. This is the default when supported by +the target architecture (currently x86 only). @opindex mconstant-cfstrings +@opindex mno-constant-cfstrings +@opindex fconstant-cfstrings @item -mconstant-cfstrings +@itemx -fconstant-cfstrings When the NeXT runtime is being used (the default on these systems), override any @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals to be laid out as constant CoreFoundation strings. -@opindex mmacosx-version-min -@item -mmacosx-version-min=@var{version} -The earliest version of MacOS X that this executable will run on is -@var{version}. Typical values supported for @var{version} include @code{12}, -@code{10.12}, and @code{10.5.8}. +@option{-fconstant-cfstrings} is an alias for @option{-mconstant-cfstrings}. -If the compiler was built to use the system's headers by default, -then the default for this option is the system version on which the -compiler is running, otherwise the default is to make choices that -are compatible with as many systems and code bases as possible. +@opindex mdynamic-no-pic +@opindex mno-dynamic-no-pic +@item -mdynamic-no-pic +Generate code suitable for executables (not shared libraries). This +option is incompatible with @option{-fpic}, @option{-fPIC}, @option{-fpie}, +or @option{-fPIE}. + +@opindex mfix-and-continue +@opindex mno-fix-and-continue +@opindex ffix-and-continue +@opindex findirect-data +@item -mfix-and-continue +@itemx -ffix-and-continue +@itemx -findirect-data +Generate code suitable for fast turnaround development, such as to +allow GDB to dynamically load @file{.o} files into already-running +programs. @option{-findirect-data} and @option{-ffix-and-continue} +are provided for backwards compatibility. @opindex mkernel +@opindex mno-kernel @item -mkernel Enable kernel development mode. The @option{-mkernel} option sets @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit}, @@ -26049,6 +27028,23 @@ applicable. This mode also sets @option{-mno-altivec}, @option{-msoft-float}, @option{-fno-builtin} and @option{-mlong-branch} for PowerPC targets. +@opindex mmacosx-version-min +@opindex asm_macosx_version_min +@item -mmacosx-version-min=@var{version} +@itemx -asm_macosx_version_min=@var{version} +The @option{-mmacosx-version-min} option specifies +the earliest version of MacOS X that this executable will run on is +@var{version}. Typical values supported for @var{version} include @code{12}, +@code{10.12}, and @code{10.5.8}. + +If the compiler was built to use the system's headers by default, +then the default for this option is the system version on which the +compiler is running, otherwise the default is to make choices that +are compatible with as many systems and code bases as possible. + +@option{-asm_macosx_version_min=@var{version}} is similar, but the GCC +driver passes its @var{version} information only to the assembler. + @opindex mone-byte-bool @item -mone-byte-bool Override the defaults for @code{bool} so that @code{sizeof(bool)==1}. @@ -26062,16 +27058,37 @@ without that switch. Using this switch may require recompiling all other modules in a program, including system libraries. Use this switch to conform to a non-default data model. -@opindex mfix-and-continue -@opindex ffix-and-continue -@opindex findirect-data -@item -mfix-and-continue -@itemx -ffix-and-continue -@itemx -findirect-data -Generate code suitable for fast turnaround development, such as to -allow GDB to dynamically load @file{.o} files into already-running -programs. @option{-findirect-data} and @option{-ffix-and-continue} -are provided for backwards compatibility. +@opindex msymbol-stubs +@opindex mno-symbol-stubs +@item -msymbol-stubs +@itemx -mno-symbol-stubs +Force generation of external symbol indirection stubs for PIC references. +By default, this option is enabled automatically if the target linker +version (@option{-mtarget-linker}) is old enough to require them. + +@opindex mtarget-linker +@item -mtarget-linker=@var{version} +@item -mtarget-linker @var{version} +Specify the target @command{ld64} version, overriding any version specified +in the GCC configuration. Newer linker versions support improved code +generation in some cases, for example for PIC code. + +@opindex ObjC +@item -ObjC +Equivalent to @samp{-x objective-c}; specifies that the input is +is Objective-C source code. + +@opindex ObjC++ +@item -ObjC++ +Equivalent to @samp{-x objective-c++}; specifies that the input is +is Objective-C++ source code. + +@opindex Wnonportable-cfstrings +@opindex Wno-nonportable-cfstrings +@item -Wnonportable-cfstrings +@itemx -Wno-nonportable-cfstrings +Warn if constant CoreFoundation string objects contain non-portable +characters. This warning is enabled by default. @opindex all_load @item -all_load @@ -26116,127 +27133,96 @@ the embedded runpath is added by default unless the user adds @option{-nodefaultrpaths} to the link line. Run paths are needed (and therefore enforced) to build on macOS version 10.11 or later. -@item -allowable_client @var{client_name} -@itemx -client_name -@itemx -compatibility_version -@itemx -current_version -@itemx -dead_strip -@itemx -dependency-file -@itemx -dylib_file -@itemx -dylinker_install_name -@itemx -dynamic -@itemx -exported_symbols_list -@itemx -filelist -@need 800 -@itemx -flat_namespace -@itemx -force_flat_namespace -@itemx -headerpad_max_install_names -@itemx -image_base -@itemx -init -@itemx -install_name -@itemx -keep_private_externs -@itemx -multi_module -@itemx -multiply_defined -@itemx -multiply_defined_unused -@need 800 -@itemx -noall_load -@itemx -no_dead_strip_inits_and_terms -@itemx -nofixprebinding -@itemx -nomultidefs -@itemx -noprebind -@itemx -noseglinkedit -@itemx -pagezero_size -@itemx -prebind -@itemx -prebind_all_twolevel_modules -@itemx -private_bundle -@need 800 -@itemx -read_only_relocs -@itemx -sectalign -@itemx -sectobjectsymbols -@itemx -whyload -@itemx -seg1addr -@itemx -sectcreate -@itemx -sectobjectsymbols -@itemx -sectorder -@itemx -segaddr -@itemx -segs_read_only_addr -@need 800 -@itemx -segs_read_write_addr -@itemx -seg_addr_table -@itemx -seg_addr_table_filename -@itemx -seglinkedit -@itemx -segprot -@itemx -segs_read_only_addr -@itemx -segs_read_write_addr -@itemx -single_module -@itemx -static -@itemx -sub_library -@need 800 +@opindex nodefaultexport +@item -nodefaultexport +Do not add default symbol exports to modules or dynamic libraries. + @opindex allowable_client @opindex client_name @opindex compatibility_version @opindex current_version @opindex dead_strip -@opindex dependency-file @opindex dylib_file +@opindex dylinker @opindex dylinker_install_name @opindex dynamic @opindex exported_symbols_list @opindex filelist @opindex flat_namespace @opindex force_flat_namespace +@opindex framework @opindex headerpad_max_install_names @opindex image_base @opindex init @opindex install_name @opindex keep_private_externs -@opindex multi_module -@opindex multiply_defined -@opindex multiply_defined_unused -@opindex noall_load -@opindex no_dead_strip_inits_and_terms -@opindex nofixprebinding -@opindex nomultidefs -@opindex noprebind -@opindex noseglinkedit @opindex pagezero_size -@opindex prebind -@opindex prebind_all_twolevel_modules -@opindex private_bundle @opindex read_only_relocs @opindex sectalign -@opindex sectobjectsymbols -@opindex whyload -@opindex seg1addr @opindex sectcreate -@opindex sectobjectsymbols -@opindex sectorder -@opindex segaddr -@opindex segs_read_only_addr -@opindex segs_read_write_addr @opindex seg_addr_table -@opindex seg_addr_table_filename -@opindex seglinkedit +@opindex seg1addr +@opindex segaddr @opindex segprot @opindex segs_read_only_addr @opindex segs_read_write_addr -@opindex single_module -@opindex static @opindex sub_library @opindex sub_umbrella @opindex twolevel_namespace +@opindex twolevel_namespace_hints @opindex umbrella @opindex undefined @opindex unexported_symbols_list +@opindex weak_framework @opindex weak_reference_mismatches @opindex whatsloaded +@opindex whyload +@item -allowable_client @var{client_name} +@itemx -client_name +@itemx -compatibility_version +@itemx -current_version +@itemx -dead_strip +@itemx -dylib_file +@itemx -dylinker +@itemx -dylinker_install_name +@itemx -dynamic +@itemx -exported_symbols_list +@itemx -filelist +@need 800 +@itemx -flat_namespace +@itemx -force_flat_namespace +@itemx -framework +@itemx -headerpad_max_install_names +@itemx -image_base +@itemx -init @var{symbol-name} +@itemx -install_name +@itemx -keep_private_externs +@need 800 +@itemx -pagezero_size +@itemx -preload +@need 800 +@itemx -read_only_relocs +@itemx -sectalign +@itemx -sectcreate +@itemx -seg_addr_table +@itemx -seg1addr +@itemx -segaddr +@need 800 +@itemx -segprot +@itemx -segs_read_only_addr +@itemx -segs_read_write_addr +@itemx -sub_library +@need 800 @itemx -sub_umbrella @itemx -twolevel_namespace +@itemx -twolevel_namespace_hints @itemx -umbrella @itemx -undefined @itemx -unexported_symbols_list +@itemx -weak_framework @itemx -weak_reference_mismatches @itemx -whatsloaded +@itemx -whyload These options are passed to the Darwin linker. The Darwin linker man page describes them in detail. @end table @@ -26456,7 +27442,7 @@ arithmetic instead of IEEE single and double precision. @itemx -mno-explicit-relocs Older Alpha assemblers provided no way to generate symbol relocations except via assembler macros. Use of these macros does not allow -optimal instruction scheduling. GNU binutils as of version 2.12 +optimal instruction scheduling. GNU Binutils as of version 2.12 supports a new syntax that allows the compiler to explicitly mark which relocations should apply to which instructions. This option is mostly useful for debugging, as GCC detects the capabilities of @@ -26573,6 +27559,24 @@ The compiler contains estimates of the number of clock cycles for Note that L3 is only valid for EV5. @end table + +@opindex mtls-kernel +@opindex mno-tls-kernel +@item -mtls-kernel +Emit @code{rdval} instead of @code{rduniq} for thread pointer. + +@opindex mtls-size +@item -mtls-size=@var{bitsize} +Specify bit size of immediate TLS offsets. Valid values for @var{bitsize} +are 16, 32, and 64; it defaults to 32. + +@opindex mlong-double-128 +@opindex mlong-double-64 +@item -mlong-double-128 +@itemx -mlong-double-64 +Specify the size of the @code{long double} type. Note that +@option{-mlong-double-128} is incompatible with VAX floating point. + @end table @node eBPF Options @@ -26595,41 +27599,48 @@ Generate code for a big-endian target. Generate code for a little-endian target. This is the default. @opindex mjmpext +@opindex mno-jmpext @item -mjmpext @itemx -mno-jmpext Enable or disable generation of extra conditional-branch instructions. Enabled for CPU v2 and above. @opindex mjmp32 +@opindex mno-jmp32 @item -mjmp32 @itemx -mno-jmp32 Enable or disable generation of 32-bit jump instructions. Enabled for CPU v3 and above. @opindex malu32 +@opindex mno-alu32 @item -malu32 @itemx -mno-alu32 Enable or disable generation of 32-bit ALU instructions. Enabled for CPU v3 and above. @opindex mv3-atomics +@opindex mno-v3-atomics @item -mv3-atomics @itemx -mno-v3-atomics Enable or disable instructions for general atomic operations introduced in CPU v3. Enabled for CPU v3 and above. @opindex mbswap +@opindex mno-bswap @item -mbswap @itemx -mno-bswap Enable or disable byte swap instructions. Enabled for CPU v4 and above. @opindex msdiv +@opindex mno-sdiv @item -msdiv @itemx -mno-sdiv Enable or disable signed division and modulus instructions. Enabled for CPU v4 and above. @opindex msmov +@opindex mno-smov @item -msmov @itemx -mno-smov Enable or disable sign-extending move and memory load instructions. @@ -26667,16 +27678,15 @@ All features of v3, plus: @end table @opindex mco-re -@item -mco-re -Enable BPF Compile Once - Run Everywhere (CO-RE) support. Requires and -is implied by @option{-gbtf}. - @opindex mno-co-re -@item -mno-co-re -Disable BPF Compile Once - Run Everywhere (CO-RE) support. BPF CO-RE -support is enabled by default when generating BTF debug information for -the BPF target. +@item -mco-re +@itemx -mno-co-re +Enable or disable BPF Compile Once - Run Everywhere (CO-RE) support. +BPF CO-RE support is enabled by default when generating BTF debug +information for the BPF target (@option{-gbtf}). +@opindex mxbpf +@opindex mno-xbpf @item -mxbpf Generate code for an expanded version of BPF, which relaxes some of the restrictions imposed by the BPF architecture: @@ -26721,6 +27731,7 @@ These options are defined specifically for the FR30 port. @table @gcctabopt @opindex msmall-model +@opindex mno-small-model @item -msmall-model Use the small address space model. This can produce smaller code, but it does assume that all symbolic values and addresses fit into a @@ -26734,44 +27745,6 @@ command line. @end table -@node FT32 Options -@subsection FT32 Options -@cindex FT32 Options - -These options are defined specifically for the FT32 port. - -@table @gcctabopt - -@opindex msim -@item -msim -Specifies that the program will be run on the simulator. This causes -an alternate runtime startup and library to be linked. -You must not use this option when generating programs that will run on -real hardware; you must provide your own runtime library for whatever -I/O functions are needed. - -@opindex mlra -@item -mlra -Does nothing. Preserved for backward compatibility. - -@opindex mnodiv -@item -mnodiv -Do not use div and mod instructions. - -@opindex mft32b -@item -mft32b -Enable use of the extended instructions of the FT32B processor. - -@opindex mcompress -@item -mcompress -Compress all code using the Ft32B code compression scheme. - -@opindex mnopm -@item -mnopm -Do not generate code that reads program memory. - -@end table - @node FRV Options @subsection FRV Options @cindex FRV Options @@ -26819,47 +27792,35 @@ Do not try to dynamically allocate condition code registers, only use @code{icc0} and @code{fcc0}. @opindex mdword -@item -mdword - -Change ABI to use double word insns. - @opindex mno-dword -@opindex mdword -@item -mno-dword +@item -mdword +@itemx -mno-dword -Do not use double word instructions. +Control whether the ABI uses double-word instructions. @opindex mdouble -@item -mdouble - -Use floating-point double instructions. - @opindex mno-double -@item -mno-double +@item -mdouble +@itemx -mno-double -Do not use floating-point double instructions. +Enable or disable use of floating-point double instructions. @opindex mmedia -@item -mmedia - -Use media instructions. - @opindex mno-media -@item -mno-media +@item -mmedia +@itemx -mno-media -Do not use media instructions. +Enable or disable use of media instructions. @opindex mmuladd -@item -mmuladd - -Use multiply and add/subtract instructions. - @opindex mno-muladd -@item -mno-muladd +@item -mmuladd +@itemx -mno-muladd -Do not use multiply and add/subtract instructions. +Enable or disable use of multiply and add/subtract instructions. @opindex mfdpic +@opindex mno-fdpic @item -mfdpic Select the FDPIC ABI, which uses function descriptors to represent @@ -26871,6 +27832,7 @@ are computed with 32 bits. With a @samp{bfin-elf} target, this option implies @option{-msim}. @opindex minline-plt +@opindex mno-inline-plt @item -minline-plt Enable inlining of PLT entries in function calls to functions that are @@ -26891,6 +27853,7 @@ Assume a large TLS segment when generating thread-local code. Do not assume a large TLS segment when generating thread-local code. @opindex mgprel-ro +@opindex mno-gprel-ro @item -mgprel-ro Enable the use of @code{GPREL} relocations in the FDPIC ABI for data @@ -26911,6 +27874,7 @@ Link with the (library, not FD) pic libraries. It's implied by it explicitly. @opindex mlinked-fp +@opindex mno-linked-fp @item -mlinked-fp Follow the EABI requirement of always creating a frame pointer whenever @@ -26918,6 +27882,7 @@ a stack frame is allocated. This option is enabled by default and can be disabled with @option{-mno-linked-fp}. @opindex mlong-calls +@opindex mno-long-calls @item -mlong-calls Use indirect addressing to call functions outside the current @@ -26925,6 +27890,7 @@ compilation unit. This allows the functions to be placed anywhere within the 32-bit address space. @opindex malign-labels +@opindex mno-align-labels @item -malign-labels Try to align labels to an 8-byte boundary by inserting NOPs into the @@ -26933,6 +27899,7 @@ is enabled. It doesn't create new packets; it merely adds NOPs to existing ones. @opindex mlibrary-pic +@opindex mno-library-pic @item -mlibrary-pic Generate position-independent EABI code. @@ -26948,14 +27915,11 @@ Use only the first four media accumulator registers. Use all eight media accumulator registers. @opindex mpack -@item -mpack - -Pack VLIW instructions. - @opindex mno-pack +@item -mpack @item -mno-pack -Do not pack VLIW instructions. +Enable or disable packing VLIW instructions. @opindex mno-eflags @item -mno-eflags @@ -26963,116 +27927,80 @@ Do not pack VLIW instructions. Do not mark ABI switches in e_flags. @opindex mcond-move -@item -mcond-move - -Enable the use of conditional-move instructions (default). - -This switch is mainly for debugging the compiler and will likely be removed -in a future version. - @opindex mno-cond-move -@item -mno-cond-move +@item -mcond-move +@itemx -mno-cond-move -Disable the use of conditional-move instructions. +Enable or disable the use of conditional-move instructions; it is enabled +by default. This switch is mainly for debugging the compiler and will likely be removed in a future version. @opindex mscc -@item -mscc - -Enable the use of conditional set instructions (default). - -This switch is mainly for debugging the compiler and will likely be removed -in a future version. - @opindex mno-scc -@item -mno-scc +@item -mscc +@itemx -mno-scc -Disable the use of conditional set instructions. +Enable or disable the use of conditional set instructions; it is enabled +by default. This switch is mainly for debugging the compiler and will likely be removed in a future version. @opindex mcond-exec -@item -mcond-exec - -Enable the use of conditional execution (default). - -This switch is mainly for debugging the compiler and will likely be removed -in a future version. - @opindex mno-cond-exec -@item -mno-cond-exec +@item -mcond-exec +@itemx -mno-cond-exec -Disable the use of conditional execution. +Enable or disable the use of conditional execution; it is enabled by default. This switch is mainly for debugging the compiler and will likely be removed in a future version. @opindex mvliw-branch -@item -mvliw-branch - -Run a pass to pack branches into VLIW instructions (default). - -This switch is mainly for debugging the compiler and will likely be removed -in a future version. - @opindex mno-vliw-branch -@item -mno-vliw-branch +@item -mvliw-branch +@itemx -mno-vliw-branch -Do not run a pass to pack branches into VLIW instructions. +Enable or disable an optimization pass to pack branches into VLIW instructions; +it is enabled by default. This switch is mainly for debugging the compiler and will likely be removed in a future version. @opindex mmulti-cond-exec -@item -mmulti-cond-exec - -Enable optimization of @code{&&} and @code{||} in conditional execution -(default). - -This switch is mainly for debugging the compiler and will likely be removed -in a future version. - @opindex mno-multi-cond-exec -@item -mno-multi-cond-exec +@item -mmulti-cond-exec +@itemx -mno-multi-cond-exec -Disable optimization of @code{&&} and @code{||} in conditional execution. +Enable or disable optimization of @code{&&} and @code{||} in conditional +execution; it is enabled by default. This switch is mainly for debugging the compiler and will likely be removed in a future version. @opindex mnested-cond-exec -@item -mnested-cond-exec - -Enable nested conditional execution optimizations (default). - -This switch is mainly for debugging the compiler and will likely be removed -in a future version. - @opindex mno-nested-cond-exec -@item -mno-nested-cond-exec +@item -mnested-cond-exec +@itemx -mno-nested-cond-exec -Disable nested conditional execution optimizations. +Enable or disable nested conditional execution optimizations; it is enabled +by default. This switch is mainly for debugging the compiler and will likely be removed in a future version. @opindex moptimize-membar +@opindex mno-optimize-membar @item -moptimize-membar +@itemx -mno-optimize-membar This switch removes redundant @code{membar} instructions from the compiler-generated code. It is enabled by default. -@opindex mno-optimize-membar -@opindex moptimize-membar -@item -mno-optimize-membar - -This switch disables the automatic removal of redundant @code{membar} -instructions from the generated code. - @opindex mtomcat-stats +@opindex mno-tomcat-stats @item -mtomcat-stats Cause gas to print out tomcat statistics. @@ -27086,6 +28014,45 @@ Select the processor type for which to generate code. Possible values are @end table +@node FT32 Options +@subsection FT32 Options +@cindex FT32 Options + +These options are defined specifically for the FT32 port. + +@table @gcctabopt + +@opindex msim +@opindex mno-sim +@item -msim +Specifies that the program will be run on the simulator. This causes +an alternate runtime startup and library to be linked. +You must not use this option when generating programs that will run on +real hardware; you must provide your own runtime library for whatever +I/O functions are needed. + +@opindex mnodiv +@opindex mno-nodiv +@item -mnodiv +Do not use div and mod instructions. + +@opindex mft32b +@opindex mno-ft32b +@item -mft32b +Enable use of the extended instructions of the FT32B processor. + +@opindex mcompress +@opindex mno-compress +@item -mcompress +Compress all code using the Ft32B code compression scheme. + +@opindex mnopm +@opindex mno-nopm +@item -mnopm +Do not generate code that reads program memory. + +@end table + @node GNU/Linux Options @subsection GNU/Linux Options @@ -27114,7 +28081,9 @@ Use Bionic C library. This is the default on @samp{*-*-linux-*android*} targets. @opindex mandroid +@opindex mno-android @item -mandroid +@itemx -mno-android Compile code compatible with Android platform. This is the default on @samp{*-*-linux-*android*} targets. @@ -27124,6 +28093,8 @@ this option makes the GCC driver pass Android-specific options to the linker. Finally, this option causes the preprocessor macro @code{__ANDROID__} to be defined. +This option can be disabled completely with @option{-mno-android}. + @opindex tno-android-cc @item -tno-android-cc Disable compilation effects of @option{-mandroid}, i.e., do not enable @@ -27924,6 +28895,17 @@ Trap (do not trap) on integer division by zero. The default is @option{-mcheck-zero-division} for @option{-O0} or @option{-Og}, and @option{-mno-check-zero-division} for other optimization levels. +@opindex mbreak-code +@item -mbreak-code=@var{code} +Emit a @code{break} @var{code} instruction for irrecoverable traps +from @code{__builtin_trap} or inserted by the compiler (for example +an erroneous path isolated with +@option{-fisolate-erroneous-paths-dereference}), or an +@code{amswap.w $r0, $r1, $r0} instruction which will cause the hardware +to trigger an Instruction Not-defined Exception if @var{code} is negative +or greater than 32767. The default is -1, meaning to use the +@code{amswap.w} instruction. + @opindex mcond-move-int @item -mcond-move-int @itemx -mno-cond-move-int @@ -27976,6 +28958,8 @@ be within 2GB addressing space. @item medium The text segment and data segment must be within 2GB addressing space. +This is the default code model unless GCC has been configured with +@option{--with-cmodel=} specifying a different default code model. @item large (Not implemented yet) @@ -27984,7 +28968,6 @@ This mode does not limit the size of the code segment and data segment. The @option{-mcmodel=extreme} option is incompatible with @option{-fplt} and/or @option{-mexplicit-relocs=none}. @end table -The default code model is @code{normal}. @item -mexplicit-relocs=@var{style} Set when to use assembler relocation operators when dealing with symbolic @@ -28145,6 +29128,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 @@ -28965,6 +29956,7 @@ The processor names are: @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300}, @samp{vr5000}, @samp{vr5400}, @samp{vr5500}, @samp{xlr} and @samp{xlp}. +@samp{allegrex}, The special value @samp{from-abi} selects the most compatible architecture for the selected ABI (that is, @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@. @@ -30558,6 +31550,7 @@ Generate code for the specified PTX ISA target architecture. Valid architecture strings are @samp{sm_30}, @samp{sm_35}, @samp{sm_37}, @samp{sm_52}, @samp{sm_53}, +@samp{sm_61}, @samp{sm_70}, @samp{sm_75}, @samp{sm_80}, and @samp{sm_89}. The default depends on how the compiler has been configured, see @@ -30584,6 +31577,7 @@ Generate code for the specified PTX ISA version. Valid version strings are @samp{3.1}, @samp{4.1}, @samp{4.2}, +@samp{5.0}, @samp{6.0}, @samp{6.3}, @samp{7.0}, @samp{7.3}, and @samp{7.8}. The default PTX ISA version is the one that added support for the @@ -30737,12 +31731,13 @@ to store the immediate to a register first. @opindex mcmodel= @opindex mcmodel=small @item -mcmodel=small -Generate OpenRISC code for the small model: The GOT is limited to 64k. This is -the default model. +Generate OpenRISC code for the small model: The GOT is limited to 64k and +function call jumps are limited to 64M offsets. This is the default model. @opindex mcmodel=large @item -mcmodel=large -Generate OpenRISC code for the large model: The GOT may grow up to 4G in size. +Generate OpenRISC code for the large model: The GOT may grow up to 4G in size +and function call jumps can target the full 4G address space. @end table @@ -30865,6 +31860,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 @@ -30882,6 +31885,29 @@ pointer as the first argument of the function. TI ABI, though, mandates that the pointer can be NULL in case the caller is not using the returned value. GNU always passes and expects a valid return value pointer. +@item Size Of Struct Containing Bit-fields +TI ABI mandates that struct size is determined by the bit-field type, if it +contains any. Whereas GNU allocates the smallest amount of bytes which would +fit the bit-field. + +For example, TI ABI reserves 4 bytes for this struct, whereas GNU reserves +a single byte: + +@smallexample +struct S @{ int i:1; @}; +@end smallexample + +@item Access Size For Volatile Bit-fields +TI ABI mandates that volatile bit-fields are accessed using their type. +In contrast, GNU ABI uses the smallest integer type fitting the bit-field. + +For example, TI ABI requires a single load of 4 bytes for the +following bit-field. Whereas GNU generates a load of 1 byte: + +@smallexample +struct S @{ volatile int i:1; @}; +@end smallexample + @end table The current @option{-mabi=ti} implementation simply raises a compile error @@ -30975,11 +32001,22 @@ 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} -Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}). ISA strings must be -lower-case. Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and -@samp{rv32imaf}. Additionally, a special value @option{help} -(@option{-march=help}) is accepted to list all supported extensions. +@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}, +@samp{rv32e}, @samp{rv32imaf}, @samp{rva22u64} and @samp{rva23u64}. +To combine Profiles and optional RISC-V ISA extention, the profile should start +at the beginning of the option, then use underline connect ISA-string (e.g.@: +@samp{rvi20u64_zca_zcb} @samp{rva23u64_zacas}). Additionally, a special value +@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: @@ -30998,493 +32035,8 @@ syntax @samp{<major>p<minor>} or @samp{<major>}, (e.g.@: @samp{m2p1} or @end table Supported extension are listed below: -@multitable @columnfractions .10 .10 .80 -@headitem Extension Name @tab Supported Version @tab Description -@item i -@tab 2.0, 2.1 -@tab Base integer extension. - -@item e -@tab 2.0 -@tab Reduced base integer extension. - -@item g -@tab - -@tab General-purpose computing base extension, @samp{g} will expand to -@samp{i}, @samp{m}, @samp{a}, @samp{f}, @samp{d}, @samp{zicsr} and -@samp{zifencei}. - -@item m -@tab 2.0 -@tab Integer multiplication and division extension. -@item a -@tab 2.0, 2.1 -@tab Atomic extension. - -@item f -@tab 2.0, 2.2 -@tab Single-precision floating-point extension. - -@item d -@tab 2.0, 2.2 -@tab Double-precision floating-point extension. - -@item c -@tab 2.0 -@tab Compressed extension. - -@item h -@tab 1.0 -@tab Hypervisor extension. - -@item v -@tab 1.0 -@tab Vector extension. - -@item zicsr -@tab 2.0 -@tab Control and status register access extension. - -@item zifencei -@tab 2.0 -@tab Instruction-fetch fence extension. - -@item zicond -@tab 1.0 -@tab Integer conditional operations extension. - -@item za64rs -@tab 1.0 -@tab Reservation set size of 64 bytes. - -@item za128rs -@tab 1.0 -@tab Reservation set size of 128 bytes. - -@item zawrs -@tab 1.0 -@tab Wait-on-reservation-set extension. - -@item zba -@tab 1.0 -@tab Address calculation extension. - -@item zbb -@tab 1.0 -@tab Basic bit manipulation extension. - -@item zbc -@tab 1.0 -@tab Carry-less multiplication extension. - -@item zbs -@tab 1.0 -@tab Single-bit operation extension. - -@item zfinx -@tab 1.0 -@tab Single-precision floating-point in integer registers extension. - -@item zdinx -@tab 1.0 -@tab Double-precision floating-point in integer registers extension. - -@item zhinx -@tab 1.0 -@tab Half-precision floating-point in integer registers extension. - -@item zhinxmin -@tab 1.0 -@tab Minimal half-precision floating-point in integer registers extension. - -@item zbkb -@tab 1.0 -@tab Cryptography bit-manipulation extension. - -@item zbkc -@tab 1.0 -@tab Cryptography carry-less multiply extension. - -@item zbkx -@tab 1.0 -@tab Cryptography crossbar permutation extension. - -@item zkne -@tab 1.0 -@tab AES Encryption extension. - -@item zknd -@tab 1.0 -@tab AES Decryption extension. - -@item zknh -@tab 1.0 -@tab Hash function extension. - -@item zkr -@tab 1.0 -@tab Entropy source extension. - -@item zksed -@tab 1.0 -@tab SM4 block cipher extension. - -@item zksh -@tab 1.0 -@tab SM3 hash function extension. - -@item zkt -@tab 1.0 -@tab Data independent execution latency extension. - -@item zk -@tab 1.0 -@tab Standard scalar cryptography extension. - -@item zkn -@tab 1.0 -@tab NIST algorithm suite extension. - -@item zks -@tab 1.0 -@tab ShangMi algorithm suite extension. - -@item zihintntl -@tab 1.0 -@tab Non-temporal locality hints extension. - -@item zihintpause -@tab 1.0 -@tab Pause hint extension. - -@item zicboz -@tab 1.0 -@tab Cache-block zero extension. - -@item zicbom -@tab 1.0 -@tab Cache-block management extension. - -@item zicbop -@tab 1.0 -@tab Cache-block prefetch extension. - -@item zic64b -@tab 1.0 -@tab Cache block size isf 64 bytes. - -@item ziccamoa -@tab 1.0 -@tab Main memory supports all atomics in A. - -@item ziccif -@tab 1.0 -@tab Main memory supports instruction fetch with atomicity requirement. - -@item zicclsm -@tab 1.0 -@tab Main memory supports misaligned loads/stores. - -@item ziccrse -@tab 1.0 -@tab Main memory supports forward progress on LR/SC sequences. - -@item zicntr -@tab 2.0 -@tab Standard extension for base counters and timers. - -@item zihpm -@tab 2.0 -@tab Standard extension for hardware performance counters. - -@item ztso -@tab 1.0 -@tab Total store ordering extension. - -@item zve32x -@tab 1.0 -@tab Vector extensions for embedded processors. - -@item zve32f -@tab 1.0 -@tab Vector extensions for embedded processors. - -@item zve64x -@tab 1.0 -@tab Vector extensions for embedded processors. - -@item zve64f -@tab 1.0 -@tab Vector extensions for embedded processors. - -@item zve64d -@tab 1.0 -@tab Vector extensions for embedded processors. - -@item zvl32b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvl64b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvl128b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvl256b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvl512b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvl1024b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvl2048b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvl4096b -@tab 1.0 -@tab Minimum vector length standard extensions - -@item zvbb -@tab 1.0 -@tab Vector basic bit-manipulation extension. - -@item zvbc -@tab 1.0 -@tab Vector carryless multiplication extension. - -@item zvkb -@tab 1.0 -@tab Vector cryptography bit-manipulation extension. - -@item zvkg -@tab 1.0 -@tab Vector GCM/GMAC extension. - -@item zvkned -@tab 1.0 -@tab Vector AES block cipher extension. - -@item zvknha -@tab 1.0 -@tab Vector SHA-2 secure hash extension. - -@item zvknhb -@tab 1.0 -@tab Vector SHA-2 secure hash extension. - -@item zvksed -@tab 1.0 -@tab Vector SM4 Block Cipher extension. - -@item zvksh -@tab 1.0 -@tab Vector SM3 Secure Hash extension. - -@item zvkn -@tab 1.0 -@tab Vector NIST Algorithm Suite extension, @samp{zvkn} will expand to -@samp{zvkned}, @samp{zvknhb}, @samp{zvkb} and @samp{zvkt}. - -@item zvknc -@tab 1.0 -@tab Vector NIST Algorithm Suite with carryless multiply extension, @samp{zvknc} -will expand to @samp{zvkn} and @samp{zvbc}. - -@item zvkng -@tab 1.0 -@tab Vector NIST Algorithm Suite with GCM extension, @samp{zvkng} will expand -to @samp{zvkn} and @samp{zvkg}. - -@item zvks -@tab 1.0 -@tab Vector ShangMi algorithm suite extension, @samp{zvks} will expand -to @samp{zvksed}, @samp{zvksh}, @samp{zvkb} and @samp{zvkt}. - -@item zvksc -@tab 1.0 -@tab Vector ShangMi algorithm suite with carryless multiplication extension, -@samp{zvksc} will expand to @samp{zvks} and @samp{zvbc}. - -@item zvksg -@tab 1.0 -@tab Vector ShangMi algorithm suite with GCM extension, @samp{zvksg} will expand -to @samp{zvks} and @samp{zvkg}. - -@item zvkt -@tab 1.0 -@tab Vector data independent execution latency extension. - -@item zfh -@tab 1.0 -@tab Half-precision floating-point extension. - -@item zfhmin -@tab 1.0 -@tab Minimal half-precision floating-point extension. - -@item zvfh -@tab 1.0 -@tab Vector half-precision floating-point extension. - -@item zvfhmin -@tab 1.0 -@tab Vector minimal half-precision floating-point extension. - -@item zvfbfmin -@tab 1.0 -@tab Vector BF16 converts extension. - -@item zfa -@tab 1.0 -@tab Additional floating-point extension. - -@item zmmul -@tab 1.0 -@tab Integer multiplication extension. - -@item zca -@tab 1.0 -@tab Integer compressed instruction extension. - -@item zcf -@tab 1.0 -@tab Compressed single-precision floating point loads and stores extension. - -@item zcd -@tab 1.0 -@tab Compressed double-precision floating point loads and stores extension. - -@item zcb -@tab 1.0 -@tab Simple compressed instruction extension. - -@item zce -@tab 1.0 -@tab Compressed instruction extensions for embedded processors. - -@item zcmp -@tab 1.0 -@tab Compressed push pop extension. - -@item zcmt -@tab 1.0 -@tab Table jump instruction extension. - -@item smaia -@tab 1.0 -@tab Advanced interrupt architecture extension. - -@item smepmp -@tab 1.0 -@tab PMP Enhancements for memory access and execution prevention on Machine mode. - -@item smstateen -@tab 1.0 -@tab State enable extension. - -@item ssaia -@tab 1.0 -@tab Advanced interrupt architecture extension for supervisor-mode. - -@item sscofpmf -@tab 1.0 -@tab Count overflow & filtering extension. - -@item ssstateen -@tab 1.0 -@tab State-enable extension for supervisor-mode. - -@item sstc -@tab 1.0 -@tab Supervisor-mode timer interrupts extension. - -@item svinval -@tab 1.0 -@tab Fine-grained address-translation cache invalidation extension. - -@item svnapot -@tab 1.0 -@tab NAPOT translation contiguity extension. - -@item svpbmt -@tab 1.0 -@tab Page-based memory types extension. - -@item xcvmac -@tab 1.0 -@tab Core-V multiply-accumulate extension. - -@item xcvalu -@tab 1.0 -@tab Core-V miscellaneous ALU extension. - -@item xcvelw -@tab 1.0 -@tab Core-V event load word extension. - -@item xtheadba -@tab 1.0 -@tab T-head address calculation extension. - -@item xtheadbb -@tab 1.0 -@tab T-head basic bit-manipulation extension. - -@item xtheadbs -@tab 1.0 -@tab T-head single-bit instructions extension. - -@item xtheadcmo -@tab 1.0 -@tab T-head cache management operations extension. - -@item xtheadcondmov -@tab 1.0 -@tab T-head conditional move extension. - -@item xtheadfmemidx -@tab 1.0 -@tab T-head indexed memory operations for floating-point registers extension. - -@item xtheadfmv -@tab 1.0 -@tab T-head double floating-point high-bit data transmission extension. - -@item xtheadint -@tab 1.0 -@tab T-head acceleration interruption extension. - -@item xtheadmac -@tab 1.0 -@tab T-head multiply-accumulate extension. - -@item xtheadmemidx -@tab 1.0 -@tab T-head indexed memory operation extension. - -@item xtheadmempair -@tab 1.0 -@tab T-head two-GPR memory operation extension. - -@item xtheadsync -@tab 1.0 -@tab T-head multi-core synchronization extension. - -@item xventanacondops -@tab 1.0 -@tab Ventana integer conditional operations extension. - -@end multitable +@include riscv-ext.texi When @option{-march=} is not specified, use the setting from @option{-mcpu}. @@ -31496,30 +32048,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{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}. +@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{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 @@ -31627,6 +32163,12 @@ Do not or do generate unaligned vector memory accesses. The default is set to off unless the processor we are optimizing for explicitly supports element-misaligned vector memory access. +@item -mmax-vectorization +@itemx -mno-max-vectorization +Enable or disable an override to vectorizer cost model making vectorization +always appear profitable. Unlike @option{-fno-vect-cost-model} or +@option{-fvect-cost-model=unlimited} this option does not turn off cost +comparison between different vector modes. @opindex mcmodel= @opindex mcmodel=medlow @@ -33466,6 +34008,20 @@ If both arguments are zero, hotpatching is disabled. This option can be overridden for individual functions with the @code{hotpatch} attribute. + +@opindex mstack-protector-guard +@opindex mstack-protector-guard-record +@item -mstack-protector-guard=@var{guard} +@itemx -mstack-protector-guard-record +Generate stack protection code using canary at @var{guard}. Supported +locations are @var{global} for a global canary or @var{tls} for a per-thread +canary in the TLS block (the default). + +Option @option{-mstack-protector-guard-record} results in the generation of +section @code{__stack_protector_loc} containing pointers to all instructions +which load the address of the global guard. Thus, this option has only an +effect in conjunction with @option{-mstack-protector-guard=global}. The +intended use is for the Linux kernel. @end table @node SH Options @@ -34402,16 +34958,6 @@ compatibility with other compilers on those systems: Create a shared object. It is recommended that @option{-symbolic} or @option{-shared} be used instead. -@opindex Qy -@item -Qy -Identify the versions of each tool used by the compiler, in a -@code{.ident} assembler directive in the output. - -@opindex Qn -@item -Qn -Refrain from adding @code{.ident} directives to the output file (this is -the default). - @opindex YP @item -YP,@var{dirs} Search the directories @var{dirs}, and no others, for libraries @@ -35053,37 +35599,46 @@ VPCLMULQDQ, AVX512BITALG, RDPID and AVX512VPOPCNTDQ instruction set support. Intel Alder Lake/Raptor Lake/Meteor Lake/Gracemont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, -GFNI-SSE, CLWB, MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, -BMI2, F16C, FMA, LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, -WIDEKL and AVX-VNNI instruction set support. +GFNI-SSE, CLWB, MOVDIRI, MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, +FMA, LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL and +AVX-VNNI instruction set support. @item arrowlake Intel Arrow Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, MOVDIRI, -MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, -PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, -UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT and CMPCCXADD instruction set -support. +MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, PCONFIG, PKU, +VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, UINTR, AVXIFMA, +AVXVNNIINT8, AVXNECONVERT and CMPCCXADD instruction set support. @item arrowlake-s @itemx lunarlake Intel Arrow Lake S/Lunar Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, -MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, -LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, -UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, -SM3 and SM4 instruction set support. +MOVDIRI, MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, +PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, UINTR, +AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3 and +SM4 instruction set support. @item pantherlake -Intel Panther Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, +@itemx wildcatlake +Intel Panther Lake/Wildcat Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, +SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, +XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, +CLWB, MOVDIRI, MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, +LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, AVX-VNNI, UINTR, +AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3 and +SM4 instruction set support. + +@item novalake +Intel Nova Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, MOVDIRI, -MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, -PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, -UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, -SM3, SM4 and PREFETCHI instruction set support. +MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, PCONFIG, PKU, +VAES, VPCLMULQDQ, SERIALIZE, HRESET, AVX-VNNI, UINTR, AVXIFMA, AVXVNNIINT8, +AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3, SM4, PREFETCHI, APX_F, +AVX10.1, AVX10.2 and MOVRS instruction set support. @item sapphirerapids @itemx emeraldrapids @@ -35130,8 +35685,7 @@ MOVDIRI, MOVDIR64B, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG, SERIALIZE, TSXLDTRK, UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, AVX512FP16, AVX512BF16, AMX-FP16, PREFETCHI, AMX-COMPLEX, AVX10.1-512, AVX-IFMA, AVX-NE-CONVERT, AVX-VNNI-INT16, AVX-VNNI-INT8, CMPccXADD, SHA512, SM3, SM4, AVX10.2-512, APX_F, AMX-AVX512, -AMX-FP8, AMX-TF32, AMX-TRANSPOSE, MOVRS, AMX-MOVRS and USER_MSR instruction set -support. +AMX-FP8, AMX-TF32, MOVRS and AMX-MOVRS instruction set support. @item bonnell @itemx atom @@ -35186,9 +35740,9 @@ Intel Clearwater Forest CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, -LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, -ENQCMD, UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, -SHA512, SM3, SM4, USER_MSR and PREFETCHI instruction set support. +LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, AVX-VNNI, ENQCMD, +UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, +SM3, SM4, USER_MSR and PREFETCHI instruction set support. @item k6 AMD K6 CPU with MMX instruction set support. @@ -35435,8 +35989,8 @@ Produce code optimized for the most current Intel processors, which are Haswell and Silvermont for this version of GCC. If you know the CPU on which your code will run, then you should use the corresponding @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}. -But, if you want your application performs better on both Haswell and -Silvermont, then you should use this option. +But, if you want your application performs better on both Diamond Rapids +and Clearwater Forest, then you should use this option. As new Intel processors are deployed in the marketplace, the behavior of this option will change. Therefore, if you upgrade to a newer version of @@ -36078,12 +36632,6 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}. @opindex mavx10.1 @itemx -mavx10.1 @need 200 -@opindex mavx10.1-256 -@itemx -mavx10.1-256 -@need 200 -@opindex mavx10.1-512 -@itemx -mavx10.1-512 -@need 200 @opindex mavx10.2 @itemx -mavx10.2 @need 200 @@ -36093,9 +36641,6 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}. @opindex mamx-tf32 @itemx -mamx-tf32 @need 200 -@opindex mamx-transpose -@itemx -mamx-transpose -@need 200 @itemx -mamx-fp8 @opindex mamx-fp8 @need 200 @@ -36114,9 +36659,9 @@ WAITPKG, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B, AVX512BF16, ENQCMD, AVX512VPOPCNTDQ, AVX512VNNI, SERIALIZE, UINTR, HRESET, AMXTILE, AMXINT8, AMXBF16, KL, WIDEKL, AVXVNNI, AVX512-FP16, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AMX-FP16, PREFETCHI, RAOINT, AMX-COMPLEX, AVXVNNIINT16, SM3, SHA512, -SM4, APX_F, USER_MSR, AVX10.1, AVX10.2, AMX-AVX512, AMX-TF32, AMX-TRANSPOSE, -AMX-FP8, MOVRS, AMX-MOVRS or CLDEMOTE extended instruction sets. Each has a -corresponding @option{-mno-} option to disable use of these instructions. +SM4, APX_F, USER_MSR, AVX10.1, AVX10.2, AMX-AVX512, AMX-TF32, AMX-FP8, MOVRS, +AMX-MOVRS or CLDEMOTE extended instruction sets. Each has a corresponding +@option{-mno-} option to disable use of these instructions. These extensions are also available as built-in functions: see @ref{x86 Built-in Functions}, for details of the functions enabled and @@ -36675,7 +37220,7 @@ The option is similar to @option{-mmemcpy-strategy=} except that it is to contro Don't keep the frame pointer in a register for leaf functions. This avoids the instructions to save, set up, and restore frame pointers and makes an extra register available in leaf functions. The option -@option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions, +@option{-momit-leaf-frame-pointer} removes the frame pointer for leaf functions, which might make debugging harder. @opindex mtls-direct-seg-refs @@ -36872,11 +37417,6 @@ To invoke egpr usage in inline asm, use new compiler option -mapx-inline-asm-use-gpr32 and user should ensure the instruction supports EGPR. -@opindex mevex512 -@item -mevex512 -@itemx -mno-evex512 -Enables/disables 512-bit vector. It will be default on if AVX512F is enabled. - @end table These @samp{-m} switches are supported in addition to the above @@ -37941,6 +38481,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 @@ -38040,6 +38590,19 @@ As @code{fixits-v1}, but columns are expressed as display columns, as per @option{-fdiagnostics-column-unit=display}. @end table +@vindex EXPERIMENTAL_SARIF_SOCKET +@item EXPERIMENTAL_SARIF_SOCKET +If @env{EXPERIMENTAL_SARIF_SOCKET} is set in the environment, then the +compiler will attempt to connect to a UNIX domain stream socket with +that name, and send an @code{OnSarifResult} JSON-RPC 2.0 notification to +it for each diagnostic that occurs, where the value of the notification +is a SARIF @code{result} object. + +The compiler will fail immediately if @env{EXPERIMENTAL_SARIF_SOCKET} is +set and it cannot connect to it. + +This feature is experimental and subject to change or removal without +notice. @end table @noindent @@ -38217,24 +38780,11 @@ reverse is not implemented---textually redefining an entity that has been defined in an imported header-unit. A redefinition error is emitted. -@item Translation-Unit local referencing rules -Papers p1815 (@uref{https://wg21.link/p1815}) and p2003 -(@uref{https://wg21.link/p2003}) add limitations on which entities an -exported region may reference (for instance, the entities an exported -template definition may reference). These are not fully implemented. - -@item Standard Library Header Units -The Standard Library is not provided as importable header units. If -you want to import such units, you must explicitly build them first. -If you do not do this with care, you may have multiple declarations, -which the module machinery must merge---compiler resource usage can be -affected by how you partition header files into header units. - @end table Modular compilation is @emph{not} enabled with just the @option{-std=c++20} option. You must explicitly enable it with the -@option{-fmodules-ts} option. It is independent of the language +@option{-fmodules} option. It is independent of the language version selected, although in pre-C++20 versions, it is of course an extension. @@ -38292,6 +38842,14 @@ and any standard library #includes in mycode.C will be skipped, because the import brought in the whole library. This can be a simple way to use modules to speed up compilation without any code changes. +But for the standard library in particular this is unnecessary: if a +header unit has been built for the libstdc++ @samp{bits/stdc++.h} +header, the compiler will translate an @samp{#include} of any +importable standard library header into an import of that header unit, +speeding up compilation without needing to specify @samp{-include}. +Note that the @samp{bits/stdc++.h} header unit is also built by the +@option{--compile-std-module} option. + The @option{-fmodule-only} option disables generation of the associated object file for compiling a module interface. Only the CMI is generated. This option is implied when using the |
