https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119823
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to sandra from comment #0) > At optimization levels below -O1 or -Og, the pass manager completely skips > most optimization passes regardless of whether the corresponding option for > that pass is set. In common.opt many of the corresponding optimization > options are specified with Init(1), e.g. -fivopts (PR71094), and the -Q > option duly reports that they are enabled at -O0, which they are not. We > should fix this. Probably it involves adding some additional flag to > common.opt and making the -Q printer do something with it. > > We've also got a problem that it's hard to sync the manual's lists of > options enabled at different levels with reality. It would be great if we > could get -Q to produce a list that could be cross-checked with the manual, > or for the options processing during GCC build to emit some text that could > be inserted directly in the manual. Yes please. The options machinery should be able to detect whether an option has a default value or a value explicitly set by the user. It currently uses the trick of setting the default value to -1, which is a waste. An example from common.opt is ``` fprefetch-loop-arrays Common Var(flag_prefetch_loop_arrays) Init(-1) Optimization Generate prefetch instructions, if available, for arrays in loops. ``` But this should be something like: ``` fprefetch-loop-arrays Common Var(flag_prefetch_loop_arrays) Init(O2 | O3) Optimization Generate prefetch instructions, if available, for arrays in loops. ```