On Mon, Sep 06, 2021 at 02:16:58PM +0200, Richard Biener wrote: > On Mon, Sep 6, 2021 at 1:46 PM Jakub Jelinek <ja...@redhat.com> wrote: > > > > On Mon, Sep 06, 2021 at 01:37:46PM +0200, Martin Liška wrote: > > > --- a/gcc/opts.c > > > +++ b/gcc/opts.c > > > @@ -1323,6 +1323,14 @@ finish_options (struct gcc_options *opts, struct > > > gcc_options *opts_set, > > > = (opts->x_flag_unroll_loops > > > || opts->x_flag_peel_loops > > > || opts->x_optimize >= 3); > > > + > > > + /* With -fcx-limited-range, we do cheap and quick complex arithmetic. > > > */ > > > + if (opts->x_flag_cx_limited_range) > > > + flag_complex_method = 0; > > > + > > > + /* With -fcx-fortran-rules, we do something in-between cheap and C99. > > > */ > > > + if (opts->x_flag_cx_fortran_rules) > > > + flag_complex_method = 1; > > > > That should then be opts->x_flag_complex_method instead of > > flag_complex_method. > > > > Ok with that change. > > But the C/C++ langhooks also set flag_complex_method so I fail to see how > this helps? As said I was referring to -fcx-limited-range on the command-line > and -fno-cx-limited-range in the optimize node to undo this which should > get you the langhook setting of flag_complex_method = 2.
flag_complex_method is global_options.x_flag_complex_method. Setting it in a function that has opts and opts_set pointers passed to it is just unclean, yes, opts will usually be &global_options, but doesn't have to be always, and everything else in finish_options uses opts->x_* instead of *. Jakub