On Mon, Sep 6, 2021 at 7:01 PM Jakub Jelinek <ja...@redhat.com> wrote:
>
> On Mon, Sep 06, 2021 at 06:58:37PM +0800, Hongtao Liu wrote:
> > > process_options would mean it affects only the command line and not
> > > __attribute__((optimize ("O2", "ftree-vectorize")))
> > > etc.
> > > So, shouldn't it be instead done in default_options_optimization, 
> > > somewhere
> > It seems default_options_optimization is before read_comline_options
> > which means it can't handle cmdline option -O2 -ftree-vectorize.
> >
> >   default_options_optimization (opts, opts_set,
> >                                 decoded_options, decoded_options_count,
> >                                 loc, lang_mask, &handlers, dc);
> >
> >   read_cmdline_options (opts, opts_set,
> >                         decoded_options, decoded_options_count,
> >                         loc, lang_mask,
> >                         &handlers, dc);
>
> 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???

>
>         Jakub
>


-- 
BR,
Hongtao

Reply via email to