On Mon, Sep 06, 2021 at 02:18:59PM +0200, Richard Biener wrote: > On Mon, Sep 6, 2021 at 1:15 PM Jakub Jelinek <ja...@redhat.com> wrote: > > > > On Mon, Sep 06, 2021 at 07:15:41PM +0800, Hongtao Liu wrote: > > > > So what about finish_options then? > > > > default_options_optimization has only a single caller that then calls > > > > read_cmdline_options and then finish_options. > > > in finish_options > > > (gdb) p opts_set->x_flag_tree_loop_vectorize > > > $37 = 1 > > > with -O2 -ftree-loop-vectorize, > > > > > > but > > > 1000 if (opts->x_dump_base_name > > > (gdb) p opts_set->x_flag_tree_loop_vectorize > > > $38 = 0 > > > for -O2 -ftree-vectorize??? > > > > > > Any magic for ftree-vectorize w/ EnabledBy??? > > > > I guess a way to get this working would be: > > ; Alias to enable both -ftree-loop-vectorize and -ftree-slp-vectorize. > > ftree-vectorize > > -Common Optimization > > +Common Var(flag_tree_vectorize) Optimization > > Enable vectorization on trees. > > > > and then you can test both > > opts_set->x_flag_tree_vectorize > > and > > opts_set->x_flag_tree_loop_vectorize > > Or make EnabledBy have set opts_set-> as well.
That would change a little bit what *_set->x_* means. If user has explicit -O2, we have *_set->x_optimize set, but don't enable it on all the suboptions that are implicitly enabled because explicit -O2 has been used. And isn't EnabledBy practically the same? If user writes -Wall explicitly which implicitly enables hundreds of warning options, do we want just Wall or also all the other options marked as explicit? E.g. backend code than can't easily differentiate between -Wwhatever and -Wall implying -Wwhatever and e.g. changing that if implicit only. Jakub