Issue
gcc (x86-64) up to version 10.x produced a list of "options enabled" with -v
or as comment in the .s
assembly file with -fverbose-asm
, see e.g What is the difference between "options enabled" and "options passed" using gcc -Q -v. With gcc version 11.x this list has disappeared.
Why? Is there a way to get this list back with some compiler flag?
Solution
Use -Q
together with one of the --help=
options:
optimizers
Display all of the optimization options supported by the compiler.
warnings
Display all of the options controlling warning messages produced by the compiler.
target
Display target-specific options. Unlike the --target-help option however, target-specific options of the linker and assembler are not displayed. This is because those tools do not currently support the extended --help= syntax.
params
Display the values recognized by the --param option.
language
Display the options supported for language, where language is the name of one of the languages supported in this version of GCC. If an option is supported by all languages, one needs to select ‘common’ class.
common
Display the options that are common to all languages.
For instance, gcc -Q --help=optimizers
shows output like:
...
-fauto-inc-dec [enabled]
-fbit-tests [enabled]
-fbranch-count-reg [disabled]
-fbranch-probabilities [disabled]
-fcaller-saves [disabled]
-fcode-hoisting [disabled]
-fcombine-stack-adjustments [disabled]
...
If you run gcc -O2 -Q --help=optimizers
instead, you will see many of them change to [enabled]
.
Answered By - Nate Eldredge Answer Checked By - Clifford M. (WPSolving Volunteer)