On 8/26/21 13:04, Richard Biener wrote: > Yes, and that flag_complex_method is initialized via the langhook > mentioned, for example > c-family/c-opts.c has > > /* Initialize options structure OPTS. */ > void > c_common_init_options_struct (struct gcc_options *opts) > { > opts->x_flag_exceptions = c_dialect_cxx (); > opts->x_warn_pointer_arith = c_dialect_cxx (); > opts->x_warn_write_strings = c_dialect_cxx (); > opts->x_flag_warn_unused_result = true; > > /* By default, C99-like requirements for complex multiply and divide. */ > opts->x_flag_complex_method = 2; > } > > so an attempt to "cancel" a command-line option that adjusted any of > the above will not > work because we're not re-initializing global_options appropriately. > But maybe we can > just do that? That is, call > > /* Initialize global options structures; this must be repeated for > each structure used for parsing options. */ > init_options_struct (&global_options, &global_options_set); > lang_hooks.init_options_struct (&global_options); > > and > > /* Perform language-specific options initialization. */ > lang_hooks.init_options (save_decoded_options_count, save_decoded_options); > > as done by toplev.c? Or if we do not want to do that store that state away > to an 'initialized_options/initialized_options_set' set of vars we can > copy from? Hello. I think the proper fix is handling the flag_complex_method-related options in finish_options. Doing that, we can see 'optimize' pragma works with the current master. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin