Come up with OPTION_SET_P macro.

Message ID defccb26-74c7-9ebd-45a7-3ab9ac674c30@suse.cz
State New
Headers
Series Come up with OPTION_SET_P macro. |

Commit Message

Martin Liška Oct. 8, 2021, 11:02 a.m. UTC
  Hello.

It's a refactoring patch introducing a new macro.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
I verified all cross compilers do build.

Ready to be installed?
Thanks,
Martin


gcc/ada/ChangeLog:

	* gcc-interface/misc.c (gnat_post_options): Use new macro
	OPTION_SET_P.
	(gnat_init_gcc_eh): Likewise.
	(gnat_init_gcc_fp): Likewise.

gcc/c-family/ChangeLog:

	* c-opts.c (c_common_post_options): Use new macro
	OPTION_SET_P.

gcc/ChangeLog:

	* config/alpha/alpha.c (alpha_option_override): Use new macro
	OPTION_SET_P.
	* config/arc/arc.c (arc_override_options): Likewise.
	* config/arm/arm.c (arm_option_override): Likewise.
	* config/bfin/bfin.c (bfin_load_pic_reg): Likewise.
	* config/c6x/c6x.c (c6x_option_override): Likewise.
	* config/csky/csky.c: Likewise.
	* config/darwin.c (darwin_override_options): Likewise.
	* config/frv/frv.c (frv_option_override): Likewise.
	* config/i386/djgpp.h: Likewise.
	* config/i386/i386.c (ix86_stack_protect_guard): Likewise.
	(ix86_max_noce_ifcvt_seq_cost): Likewise.
	* config/ia64/ia64.c (ia64_option_override): Likewise.
	(ia64_override_options_after_change): Likewise.
	* config/m32c/m32c.c (m32c_option_override): Likewise.
	* config/m32r/m32r.c (m32r_init): Likewise.
	* config/m68k/m68k.c (m68k_option_override): Likewise.
	* config/microblaze/microblaze.c (microblaze_option_override): Likewise.
	* config/mips/mips.c (mips_option_override): Likewise.
	* config/nios2/nios2.c (nios2_option_override): Likewise.
	* config/nvptx/nvptx.c (nvptx_option_override): Likewise.
	* config/pa/pa.c (pa_option_override): Likewise.
	* config/riscv/riscv.c (riscv_option_override): Likewise.
	* config/rs6000/aix71.h: Likewise.
	* config/rs6000/aix72.h: Likewise.
	* config/rs6000/aix73.h: Likewise.
	* config/rs6000/rs6000.c (darwin_rs6000_override_options): Likewise.
	(rs6000_override_options_after_change): Likewise.
	(rs6000_linux64_override_options): Likewise.
	(glibc_supports_ieee_128bit): Likewise.
	(rs6000_option_override_internal): Likewise.
	(rs6000_file_start): Likewise.
	(rs6000_darwin_file_start): Likewise.
	* config/rs6000/rtems.h: Likewise.
	* config/rs6000/sysv4.h: Likewise.
	* config/rs6000/vxworks.h (SUB3TARGET_OVERRIDE_OPTIONS): Likewise.
	* config/s390/s390.c (s390_option_override): Likewise.
	* config/sh/linux.h: Likewise.
	* config/sh/netbsd-elf.h (while): Likewise.
	* config/sh/sh.c (sh_option_override): Likewise.
	* config/sol2.c (solaris_override_options): Likewise.
	* config/sparc/sparc.c (sparc_option_override): Likewise.
	* config/tilegx/tilegx.c (tilegx_option_override): Likewise.
	* config/visium/visium.c (visium_option_override): Likewise.
	* config/vxworks.c (vxworks_override_options): Likewise.
	* lto-opts.c (lto_write_options): Likewise.
	* omp-expand.c (expand_omp_simd): Likewise.
	* omp-general.c (omp_max_vf): Likewise.
	* omp-offload.c (oacc_xform_loop): Likewise.
	* opts.h (OPTION_SET_P): Likewise.
	* targhooks.c (default_max_noce_ifcvt_seq_cost): Likewise.
	* toplev.c (process_options): Likewise.
	* tree-predcom.c: Likewise.
	* tree-sra.c (analyze_all_variable_accesses): Likewise.

gcc/cp/ChangeLog:

	* constexpr.c (maybe_warn_about_constant_value): Use new macro
	OPTION_SET_P.
	* decl.c (redeclaration_error_message): Likewise.
	(cxx_init_decl_processing): Likewise.

gcc/d/ChangeLog:

	* d-lang.cc (d_post_options): Use new macro
	OPTION_SET_P.

gcc/fortran/ChangeLog:

	* options.c (gfc_post_options): Use new macro
	OPTION_SET_P.

gcc/objc/ChangeLog:

	* objc-next-runtime-abi-01.c: Use new macro
	OPTION_SET_P.
	* objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise.
---
  gcc/ada/gcc-interface/misc.c        | 10 ++---
  gcc/c-family/c-opts.c               |  6 +--
  gcc/config/alpha/alpha.c            |  2 +-
  gcc/config/arc/arc.c                |  4 +-
  gcc/config/arm/arm.c                |  9 ++--
  gcc/config/bfin/bfin.c              |  5 ++-
  gcc/config/c6x/c6x.c                |  3 +-
  gcc/config/csky/csky.c              |  7 +--
  gcc/config/darwin.c                 | 31 ++++++-------
  gcc/config/frv/frv.c                |  5 ++-
  gcc/config/i386/djgpp.h             |  2 +-
  gcc/config/i386/i386.c              |  6 +--
  gcc/config/ia64/ia64.c              |  6 +--
  gcc/config/m32c/m32c.c              |  3 +-
  gcc/config/m32r/m32r.c              |  3 +-
  gcc/config/m68k/m68k.c              |  6 +--
  gcc/config/microblaze/microblaze.c  |  3 +-
  gcc/config/mips/mips.c              |  9 ++--
  gcc/config/nios2/nios2.c            |  3 +-
  gcc/config/nvptx/nvptx.c            |  4 +-
  gcc/config/pa/pa.c                  |  4 +-
  gcc/config/riscv/riscv.c            | 11 ++---
  gcc/config/rs6000/aix71.h           |  6 +--
  gcc/config/rs6000/aix72.h           |  6 +--
  gcc/config/rs6000/aix73.h           |  6 +--
  gcc/config/rs6000/rs6000.c          | 70 ++++++++++++++---------------
  gcc/config/rs6000/rtems.h           |  4 +-
  gcc/config/rs6000/sysv4.h           |  8 ++--
  gcc/config/rs6000/vxworks.h         |  2 +-
  gcc/config/s390/s390.c              |  4 +-
  gcc/config/sh/linux.h               |  4 +-
  gcc/config/sh/netbsd-elf.h          |  2 +-
  gcc/config/sh/sh.c                  | 12 ++---
  gcc/config/sol2.c                   |  3 +-
  gcc/config/sparc/sparc.c            | 12 ++---
  gcc/config/tilegx/tilegx.c          |  3 +-
  gcc/config/visium/visium.c          |  2 +-
  gcc/config/vxworks.c                |  5 ++-
  gcc/cp/constexpr.c                  |  3 +-
  gcc/cp/decl.c                       |  7 +--
  gcc/d/d-lang.cc                     | 10 ++---
  gcc/fortran/options.c               |  6 +--
  gcc/lto-opts.c                      |  8 ++--
  gcc/objc/objc-next-runtime-abi-01.c |  2 +-
  gcc/objc/objc-next-runtime-abi-02.c |  4 +-
  gcc/omp-expand.c                    |  3 +-
  gcc/omp-general.c                   |  3 +-
  gcc/omp-offload.c                   |  3 +-
  gcc/opts.h                          |  4 ++
  gcc/targhooks.c                     |  4 +-
  gcc/toplev.c                        |  2 +-
  gcc/tree-predcom.c                  |  3 +-
  gcc/tree-sra.c                      |  6 +--
  53 files changed, 192 insertions(+), 167 deletions(-)
  

Comments

Richard Biener Oct. 8, 2021, 11:19 a.m. UTC | #1
On Fri, Oct 8, 2021 at 1:03 PM Martin Liška <mliska@suse.cz> wrote:
>
> Hello.
>
> It's a refactoring patch introducing a new macro.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> I verified all cross compilers do build.
>
> Ready to be installed?

OK.

Thanks,
Richard.

> Thanks,
> Martin
>
>
> gcc/ada/ChangeLog:
>
>         * gcc-interface/misc.c (gnat_post_options): Use new macro
>         OPTION_SET_P.
>         (gnat_init_gcc_eh): Likewise.
>         (gnat_init_gcc_fp): Likewise.
>
> gcc/c-family/ChangeLog:
>
>         * c-opts.c (c_common_post_options): Use new macro
>         OPTION_SET_P.
>
> gcc/ChangeLog:
>
>         * config/alpha/alpha.c (alpha_option_override): Use new macro
>         OPTION_SET_P.
>         * config/arc/arc.c (arc_override_options): Likewise.
>         * config/arm/arm.c (arm_option_override): Likewise.
>         * config/bfin/bfin.c (bfin_load_pic_reg): Likewise.
>         * config/c6x/c6x.c (c6x_option_override): Likewise.
>         * config/csky/csky.c: Likewise.
>         * config/darwin.c (darwin_override_options): Likewise.
>         * config/frv/frv.c (frv_option_override): Likewise.
>         * config/i386/djgpp.h: Likewise.
>         * config/i386/i386.c (ix86_stack_protect_guard): Likewise.
>         (ix86_max_noce_ifcvt_seq_cost): Likewise.
>         * config/ia64/ia64.c (ia64_option_override): Likewise.
>         (ia64_override_options_after_change): Likewise.
>         * config/m32c/m32c.c (m32c_option_override): Likewise.
>         * config/m32r/m32r.c (m32r_init): Likewise.
>         * config/m68k/m68k.c (m68k_option_override): Likewise.
>         * config/microblaze/microblaze.c (microblaze_option_override): Likewise.
>         * config/mips/mips.c (mips_option_override): Likewise.
>         * config/nios2/nios2.c (nios2_option_override): Likewise.
>         * config/nvptx/nvptx.c (nvptx_option_override): Likewise.
>         * config/pa/pa.c (pa_option_override): Likewise.
>         * config/riscv/riscv.c (riscv_option_override): Likewise.
>         * config/rs6000/aix71.h: Likewise.
>         * config/rs6000/aix72.h: Likewise.
>         * config/rs6000/aix73.h: Likewise.
>         * config/rs6000/rs6000.c (darwin_rs6000_override_options): Likewise.
>         (rs6000_override_options_after_change): Likewise.
>         (rs6000_linux64_override_options): Likewise.
>         (glibc_supports_ieee_128bit): Likewise.
>         (rs6000_option_override_internal): Likewise.
>         (rs6000_file_start): Likewise.
>         (rs6000_darwin_file_start): Likewise.
>         * config/rs6000/rtems.h: Likewise.
>         * config/rs6000/sysv4.h: Likewise.
>         * config/rs6000/vxworks.h (SUB3TARGET_OVERRIDE_OPTIONS): Likewise.
>         * config/s390/s390.c (s390_option_override): Likewise.
>         * config/sh/linux.h: Likewise.
>         * config/sh/netbsd-elf.h (while): Likewise.
>         * config/sh/sh.c (sh_option_override): Likewise.
>         * config/sol2.c (solaris_override_options): Likewise.
>         * config/sparc/sparc.c (sparc_option_override): Likewise.
>         * config/tilegx/tilegx.c (tilegx_option_override): Likewise.
>         * config/visium/visium.c (visium_option_override): Likewise.
>         * config/vxworks.c (vxworks_override_options): Likewise.
>         * lto-opts.c (lto_write_options): Likewise.
>         * omp-expand.c (expand_omp_simd): Likewise.
>         * omp-general.c (omp_max_vf): Likewise.
>         * omp-offload.c (oacc_xform_loop): Likewise.
>         * opts.h (OPTION_SET_P): Likewise.
>         * targhooks.c (default_max_noce_ifcvt_seq_cost): Likewise.
>         * toplev.c (process_options): Likewise.
>         * tree-predcom.c: Likewise.
>         * tree-sra.c (analyze_all_variable_accesses): Likewise.
>
> gcc/cp/ChangeLog:
>
>         * constexpr.c (maybe_warn_about_constant_value): Use new macro
>         OPTION_SET_P.
>         * decl.c (redeclaration_error_message): Likewise.
>         (cxx_init_decl_processing): Likewise.
>
> gcc/d/ChangeLog:
>
>         * d-lang.cc (d_post_options): Use new macro
>         OPTION_SET_P.
>
> gcc/fortran/ChangeLog:
>
>         * options.c (gfc_post_options): Use new macro
>         OPTION_SET_P.
>
> gcc/objc/ChangeLog:
>
>         * objc-next-runtime-abi-01.c: Use new macro
>         OPTION_SET_P.
>         * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise.
> ---
>   gcc/ada/gcc-interface/misc.c        | 10 ++---
>   gcc/c-family/c-opts.c               |  6 +--
>   gcc/config/alpha/alpha.c            |  2 +-
>   gcc/config/arc/arc.c                |  4 +-
>   gcc/config/arm/arm.c                |  9 ++--
>   gcc/config/bfin/bfin.c              |  5 ++-
>   gcc/config/c6x/c6x.c                |  3 +-
>   gcc/config/csky/csky.c              |  7 +--
>   gcc/config/darwin.c                 | 31 ++++++-------
>   gcc/config/frv/frv.c                |  5 ++-
>   gcc/config/i386/djgpp.h             |  2 +-
>   gcc/config/i386/i386.c              |  6 +--
>   gcc/config/ia64/ia64.c              |  6 +--
>   gcc/config/m32c/m32c.c              |  3 +-
>   gcc/config/m32r/m32r.c              |  3 +-
>   gcc/config/m68k/m68k.c              |  6 +--
>   gcc/config/microblaze/microblaze.c  |  3 +-
>   gcc/config/mips/mips.c              |  9 ++--
>   gcc/config/nios2/nios2.c            |  3 +-
>   gcc/config/nvptx/nvptx.c            |  4 +-
>   gcc/config/pa/pa.c                  |  4 +-
>   gcc/config/riscv/riscv.c            | 11 ++---
>   gcc/config/rs6000/aix71.h           |  6 +--
>   gcc/config/rs6000/aix72.h           |  6 +--
>   gcc/config/rs6000/aix73.h           |  6 +--
>   gcc/config/rs6000/rs6000.c          | 70 ++++++++++++++---------------
>   gcc/config/rs6000/rtems.h           |  4 +-
>   gcc/config/rs6000/sysv4.h           |  8 ++--
>   gcc/config/rs6000/vxworks.h         |  2 +-
>   gcc/config/s390/s390.c              |  4 +-
>   gcc/config/sh/linux.h               |  4 +-
>   gcc/config/sh/netbsd-elf.h          |  2 +-
>   gcc/config/sh/sh.c                  | 12 ++---
>   gcc/config/sol2.c                   |  3 +-
>   gcc/config/sparc/sparc.c            | 12 ++---
>   gcc/config/tilegx/tilegx.c          |  3 +-
>   gcc/config/visium/visium.c          |  2 +-
>   gcc/config/vxworks.c                |  5 ++-
>   gcc/cp/constexpr.c                  |  3 +-
>   gcc/cp/decl.c                       |  7 +--
>   gcc/d/d-lang.cc                     | 10 ++---
>   gcc/fortran/options.c               |  6 +--
>   gcc/lto-opts.c                      |  8 ++--
>   gcc/objc/objc-next-runtime-abi-01.c |  2 +-
>   gcc/objc/objc-next-runtime-abi-02.c |  4 +-
>   gcc/omp-expand.c                    |  3 +-
>   gcc/omp-general.c                   |  3 +-
>   gcc/omp-offload.c                   |  3 +-
>   gcc/opts.h                          |  4 ++
>   gcc/targhooks.c                     |  4 +-
>   gcc/toplev.c                        |  2 +-
>   gcc/tree-predcom.c                  |  3 +-
>   gcc/tree-sra.c                      |  6 +--
>   53 files changed, 192 insertions(+), 167 deletions(-)
>
> diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
> index 96199bd4b63..d0735708670 100644
> --- a/gcc/ada/gcc-interface/misc.c
> +++ b/gcc/ada/gcc-interface/misc.c
> @@ -271,7 +271,7 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
>     warn_stringop_overflow = 0;
>
>     /* No caret by default for Ada.  */
> -  if (!global_options_set.x_flag_diagnostics_show_caret)
> +  if (!OPTION_SET_P (flag_diagnostics_show_caret))
>       global_dc->show_caret = false;
>
>     /* Warn only if STABS is not the default: we don't want to emit a warning if
> @@ -422,12 +422,12 @@ gnat_init_gcc_eh (void)
>     flag_delete_dead_exceptions = 1;
>     if (Suppress_Checks)
>       {
> -      if (!global_options_set.x_flag_non_call_exceptions)
> +      if (!OPTION_SET_P (flag_non_call_exceptions))
>         flag_non_call_exceptions = Machine_Overflows_On_Target && GNAT_Mode;
>       }
>     else
>       {
> -      if (!global_options_set.x_flag_non_call_exceptions)
> +      if (!OPTION_SET_P (flag_non_call_exceptions))
>           flag_non_call_exceptions = 1;
>         flag_aggressive_loop_optimizations = 0;
>         warn_aggressive_loop_optimizations = 0;
> @@ -445,14 +445,14 @@ gnat_init_gcc_fp (void)
>        S'Signed_Zeros is true, but don't override the user if not.  */
>     if (Signed_Zeros_On_Target)
>       flag_signed_zeros = 1;
> -  else if (!global_options_set.x_flag_signed_zeros)
> +  else if (!OPTION_SET_P (flag_signed_zeros))
>       flag_signed_zeros = 0;
>
>     /* Assume that FP operations can trap if S'Machine_Overflow is true,
>        but don't override the user if not.  */
>     if (Machine_Overflows_On_Target)
>       flag_trapping_math = 1;
> -  else if (!global_options_set.x_flag_trapping_math)
> +  else if (!OPTION_SET_P (flag_trapping_math))
>       flag_trapping_math = 0;
>   }
>
> diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
> index 3eaab5e1530..0225cba7a4b 100644
> --- a/gcc/c-family/c-opts.c
> +++ b/gcc/c-family/c-opts.c
> @@ -831,7 +831,7 @@ c_common_post_options (const char **pfilename)
>        for -ffp-contract=off).  */
>     if (flag_iso
>         && !c_dialect_cxx ()
> -      && (global_options_set.x_flag_fp_contract_mode
> +      && (OPTION_SET_P (flag_fp_contract_mode)
>           == (enum fp_contract_mode) 0)
>         && flag_unsafe_math_optimizations == 0)
>       flag_fp_contract_mode = FP_CONTRACT_OFF;
> @@ -842,7 +842,7 @@ c_common_post_options (const char **pfilename)
>        the set specified in ISO C99/C11.  */
>     if (!flag_iso
>         && !c_dialect_cxx ()
> -      && (global_options_set.x_flag_permitted_flt_eval_methods
> +      && (OPTION_SET_P (flag_permitted_flt_eval_methods)
>           == PERMITTED_FLT_EVAL_METHODS_DEFAULT))
>       flag_permitted_flt_eval_methods = PERMITTED_FLT_EVAL_METHODS_TS_18661;
>     else
> @@ -1040,7 +1040,7 @@ c_common_post_options (const char **pfilename)
>
>         /* Unless -f{,no-}ext-numeric-literals has been used explicitly,
>          for -std=c++{11,14,17,20,23} default to -fno-ext-numeric-literals.  */
> -      if (flag_iso && !global_options_set.x_flag_ext_numeric_literals)
> +      if (flag_iso && !OPTION_SET_P (flag_ext_numeric_literals))
>         cpp_opts->ext_numeric_literals = 0;
>       }
>     else if (warn_narrowing == -1)
> diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
> index c702e683c31..fced7ceefe2 100644
> --- a/gcc/config/alpha/alpha.c
> +++ b/gcc/config/alpha/alpha.c
> @@ -575,7 +575,7 @@ alpha_option_override (void)
>     }
>
>     /* Default the definition of "small data" to 8 bytes.  */
> -  if (!global_options_set.x_g_switch_value)
> +  if (!OPTION_SET_P (g_switch_value))
>       g_switch_value = 8;
>
>     /* Infer TARGET_SMALL_DATA from -fpic/-fPIC.  */
> diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
> index 92797db96b7..8244f37bf03 100644
> --- a/gcc/config/arc/arc.c
> +++ b/gcc/config/arc/arc.c
> @@ -1441,7 +1441,7 @@ arc_override_options (void)
>       target_flags |= MASK_NO_SDATA_SET;
>
>     /* Check for small data option */
> -  if (!global_options_set.x_g_switch_value && !TARGET_NO_SDATA_SET)
> +  if (!OPTION_SET_P (g_switch_value) && !TARGET_NO_SDATA_SET)
>       g_switch_value = TARGET_LL64 ? 8 : 4;
>
>     /* A7 has an issue with delay slots.  */
> @@ -1455,7 +1455,7 @@ arc_override_options (void)
>       target_flags &= ~MASK_MILLICODE_THUNK_SET;
>
>     /* Set unaligned to all HS cpus.  */
> -  if (!global_options_set.x_unaligned_access && TARGET_HS)
> +  if (!OPTION_SET_P (unaligned_access) && TARGET_HS)
>       unaligned_access = 1;
>
>     /* These need to be done at start up.  It's convenient to do them here.  */
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 6c6e77fab66..471128fc86a 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -71,6 +71,7 @@
>   #include "gimple.h"
>   #include "selftest.h"
>   #include "tree-vectorizer.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -3468,7 +3469,7 @@ arm_option_override (void)
>
>     arm_active_target.isa = sbitmap_alloc (isa_num_bits);
>
> -  if (!global_options_set.x_arm_fpu_index)
> +  if (!OPTION_SET_P (arm_fpu_index))
>       {
>         bool ok;
>         int fpu_index;
> @@ -3528,7 +3529,7 @@ arm_option_override (void)
>       flag_schedule_insns = flag_schedule_insns_after_reload = 0;
>
>     /* Override the default structure alignment for AAPCS ABI.  */
> -  if (!global_options_set.x_arm_structure_size_boundary)
> +  if (!OPTION_SET_P (arm_structure_size_boundary))
>       {
>         if (TARGET_AAPCS_BASED)
>         arm_structure_size_boundary = 8;
> @@ -3553,12 +3554,12 @@ arm_option_override (void)
>
>     if (TARGET_VXWORKS_RTP)
>       {
> -      if (!global_options_set.x_arm_pic_data_is_text_relative)
> +      if (!OPTION_SET_P (arm_pic_data_is_text_relative))
>         arm_pic_data_is_text_relative = 0;
>       }
>     else if (flag_pic
>            && !arm_pic_data_is_text_relative
> -          && !(global_options_set.x_target_flags & MASK_SINGLE_PIC_BASE))
> +          && !(OPTION_SET_P (target_flags) & MASK_SINGLE_PIC_BASE))
>       /* When text & data segments don't have a fixed displacement, the
>          intended use is with a single, read only, pic base register.
>          Unless the user explicitly requested not to do that, set
> diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
> index 698dd879934..3287e495dd3 100644
> --- a/gcc/config/bfin/bfin.c
> +++ b/gcc/config/bfin/bfin.c
> @@ -53,6 +53,7 @@
>   #include "hw-doloop.h"
>   #include "dumpfile.h"
>   #include "builtins.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -1046,7 +1047,7 @@ bfin_load_pic_reg (rtx dest)
>     if (local_info_node && local_info_node->local)
>       return pic_offset_table_rtx;
>
> -  if (global_options_set.x_bfin_library_id)
> +  if (OPTION_SET_P (bfin_library_id))
>       addr = plus_constant (Pmode, pic_offset_table_rtx,
>                            -4 - bfin_library_id * 4);
>     else
> @@ -2369,7 +2370,7 @@ bfin_option_override (void)
>   #endif
>
>     /* Library identification */
> -  if (global_options_set.x_bfin_library_id && ! TARGET_ID_SHARED_LIBRARY)
> +  if (OPTION_SET_P (bfin_library_id) && ! TARGET_ID_SHARED_LIBRARY)
>       error ("%<-mshared-library-id=%> specified without "
>            "%<-mid-shared-library%>");
>
> diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
> index ce4949516cf..4854371ee13 100644
> --- a/gcc/config/c6x/c6x.c
> +++ b/gcc/config/c6x/c6x.c
> @@ -60,6 +60,7 @@
>   #include "dumpfile.h"
>   #include "builtins.h"
>   #include "flags.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -221,7 +222,7 @@ c6x_option_override (void)
>   {
>     unsigned i;
>
> -  if (global_options_set.x_c6x_arch_option)
> +  if (OPTION_SET_P (c6x_arch_option))
>       {
>         c6x_arch = all_isas[c6x_arch_option].type;
>         c6x_insn_mask &= ~C6X_INSNS_ALL_CPU_BITS;
> diff --git a/gcc/config/csky/csky.c b/gcc/config/csky/csky.c
> index e55821fe2ee..487288b3292 100644
> --- a/gcc/config/csky/csky.c
> +++ b/gcc/config/csky/csky.c
> @@ -67,6 +67,7 @@
>   #include "pass_manager.h"
>   #include "tree-pass.h"
>   #include "context.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -2757,15 +2758,15 @@ csky_option_override (void)
>   #ifdef ENABLE_TPF_DEBUG
>     /* Don't emit DWARF4 unless specifically selected.  The TPF
>        debuggers do not yet support DWARF 3/4.  */
> -  if (!global_options_set.x_dwarf_strict)
> +  if (!OPTION_SET_P (dwarf_strict))
>       dwarf_strict = 1;
> -  if (!global_options_set.x_dwarf_version)
> +  if (!OPTION_SET_P (dwarf_version))
>       dwarf_version = 3;
>   #endif
>
>     /* Don't run the scheduler before reload by default,
>        since it tends to increase register pressure.  */
> -  if (!global_options_set.x_flag_schedule_insns)
> +  if (!OPTION_SET_P (flag_schedule_insns))
>       flag_schedule_insns = 0;
>
>     csky_add_gc_roots ();
> diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
> index 781742fe46f..28dc55d9b1c 100644
> --- a/gcc/config/darwin.c
> +++ b/gcc/config/darwin.c
> @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "intl.h"
>   #include "optabs.h"
>   #include "flags.h"
> +#include "opts.h"
>
>   /* Fix and Continue.
>
> @@ -3282,7 +3283,7 @@ darwin_override_options (void)
>       }
>
>     /* Unless set, force ABI=2 for NeXT and m64, 0 otherwise.  */
> -  if (!global_options_set.x_flag_objc_abi)
> +  if (!OPTION_SET_P (flag_objc_abi))
>       global_options.x_flag_objc_abi
>         = (!flag_next_runtime)
>                 ? 0
> @@ -3290,7 +3291,7 @@ darwin_override_options (void)
>                                 : (generating_for_darwin_version >= 9) ? 1
>                                                                        : 0);
>
> -  if (global_options_set.x_flag_objc_abi && flag_next_runtime)
> +  if (OPTION_SET_P (flag_objc_abi) && flag_next_runtime)
>       {
>         if (TARGET_64BIT && global_options.x_flag_objc_abi != 2)
>         /* The Objective-C family ABI 2 is the only valid version NeXT/m64.  */
> @@ -3307,23 +3308,23 @@ darwin_override_options (void)
>
>     /* Don't emit DWARF3/4 unless specifically selected.  This is a
>        workaround for tool bugs.  */
> -  if (!global_options_set.x_dwarf_strict)
> +  if (!OPTION_SET_P (dwarf_strict))
>       dwarf_strict = 1;
> -  if (!global_options_set.x_dwarf_version)
> +  if (!OPTION_SET_P (dwarf_version))
>       dwarf_version = 2;
>
> -  if (global_options_set.x_dwarf_split_debug_info)
> +  if (OPTION_SET_P (dwarf_split_debug_info))
>       {
>         inform (input_location,
>               "%<-gsplit-dwarf%> is not supported on this platform, ignored");
>         dwarf_split_debug_info = 0;
> -      global_options_set.x_dwarf_split_debug_info = 0;
> +      OPTION_SET_P (dwarf_split_debug_info) = 0;
>       }
>
>     /* Do not allow unwind tables to be generated by default for m32.
>        fnon-call-exceptions will override this, regardless of what we do.  */
>     if (generating_for_darwin_version < 10
> -      && !global_options_set.x_flag_asynchronous_unwind_tables
> +      && !OPTION_SET_P (flag_asynchronous_unwind_tables)
>         && !TARGET_64BIT)
>       global_options.x_flag_asynchronous_unwind_tables = 0;
>
> @@ -3334,15 +3335,15 @@ darwin_override_options (void)
>         will be generated".  If the User specifically sets flags... we assume
>         (s)he knows why...  */
>      if (generating_for_darwin_version < 9
> -       && global_options_set.x_flag_reorder_blocks_and_partition
> +       && OPTION_SET_P (flag_reorder_blocks_and_partition)
>          && ((global_options.x_flag_exceptions          /* User, c++, java */
> -           && !global_options_set.x_flag_exceptions)   /* User specified... */
> +           && !OPTION_SET_P (flag_exceptions))         /* User specified... */
>            || (global_options.x_flag_unwind_tables
> -              && !global_options_set.x_flag_unwind_tables)
> +              && !OPTION_SET_P (flag_unwind_tables))
>            || (global_options.x_flag_non_call_exceptions
> -              && !global_options_set.x_flag_non_call_exceptions)
> +              && !OPTION_SET_P (flag_non_call_exceptions))
>            || (global_options.x_flag_asynchronous_unwind_tables
> -              && !global_options_set.x_flag_asynchronous_unwind_tables)))
> +              && !OPTION_SET_P (flag_asynchronous_unwind_tables))))
>       {
>         inform (input_location,
>               "%<-freorder-blocks-and-partition%> does not work with "
> @@ -3353,12 +3354,12 @@ darwin_override_options (void)
>
>       /* FIXME: flag_objc_sjlj_exceptions is no longer needed since there is only
>          one valid choice of exception scheme for each runtime.  */
> -    if (!global_options_set.x_flag_objc_sjlj_exceptions)
> +    if (!OPTION_SET_P (flag_objc_sjlj_exceptions))
>         global_options.x_flag_objc_sjlj_exceptions =
>                                 flag_next_runtime && !TARGET_64BIT;
>
>       /* FIXME: and this could be eliminated then too.  */
> -    if (!global_options_set.x_flag_exceptions
> +    if (!OPTION_SET_P (flag_exceptions)
>         && flag_objc_exceptions
>         && TARGET_64BIT)
>         flag_exceptions = 1;
> @@ -3414,7 +3415,7 @@ darwin_override_options (void)
>        Linkers that don't need stubs, don't need the EH symbol markers either.
>     */
>
> -  if (!global_options_set.x_darwin_symbol_stubs)
> +  if (!OPTION_SET_P (darwin_symbol_stubs))
>       {
>         if (darwin_target_linker)
>         {
> diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
> index a7f7f086d17..02cd07c09bc 100644
> --- a/gcc/config/frv/frv.c
> +++ b/gcc/config/frv/frv.c
> @@ -50,6 +50,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "ifcvt.h"
>   #include "rtl-iter.h"
>   #include "calls.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -664,7 +665,7 @@ frv_option_override (void)
>         if (!flag_pic)          /* -fPIC */
>         flag_pic = 2;
>
> -      if (!global_options_set.x_g_switch_value)        /* -G0 */
> +      if (!OPTION_SET_P (g_switch_value))      /* -G0 */
>         {
>           g_switch_value = 0;
>         }
> @@ -757,7 +758,7 @@ frv_option_override (void)
>       }
>
>     /* Check for small data option */
> -  if (!global_options_set.x_g_switch_value && !TARGET_LIBPIC)
> +  if (!OPTION_SET_P (g_switch_value) && !TARGET_LIBPIC)
>       g_switch_value = SDATA_DEFAULT_SIZE;
>
>     /* There is no single unaligned SI op for PIC code.  Sometimes we
> diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h
> index 9decff7e56c..f1afad91c99 100644
> --- a/gcc/config/i386/djgpp.h
> +++ b/gcc/config/i386/djgpp.h
> @@ -147,7 +147,7 @@ along with GCC; see the file COPYING3.  If not see
>                                                                           \
>           /* Don't emit DWARF3/4 unless specifically selected. */         \
>           /* DWARF3/4 currently does not work for DJGPP.  */              \
> -        if (!global_options_set.x_dwarf_version)                        \
> +        if (!OPTION_SET_P (dwarf_version))                        \
>               dwarf_version = 2;                                          \
>                                                                           \
>           }                                                               \
> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> index a566d84a61e..24c4b50d3db 100644
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -22280,7 +22280,7 @@ ix86_stack_protect_guard (void)
>         tree type = build_qualified_type (type_node, qual);
>         tree t;
>
> -      if (global_options_set.x_ix86_stack_protector_guard_symbol_str)
> +      if (OPTION_SET_P (ix86_stack_protector_guard_symbol_str))
>         {
>           t = ix86_tls_stack_chk_guard_decl;
>
> @@ -22794,12 +22794,12 @@ ix86_max_noce_ifcvt_seq_cost (edge e)
>     bool predictable_p = predictable_edge_p (e);
>     if (predictable_p)
>       {
> -      if (global_options_set.x_param_max_rtl_if_conversion_predictable_cost)
> +      if (OPTION_SET_P (param_max_rtl_if_conversion_predictable_cost))
>         return param_max_rtl_if_conversion_predictable_cost;
>       }
>     else
>       {
> -      if (global_options_set.x_param_max_rtl_if_conversion_unpredictable_cost)
> +      if (OPTION_SET_P (param_max_rtl_if_conversion_unpredictable_cost))
>         return param_max_rtl_if_conversion_unpredictable_cost;
>       }
>
> diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
> index 632b9df1761..39a0e0791b7 100644
> --- a/gcc/config/ia64/ia64.c
> +++ b/gcc/config/ia64/ia64.c
> @@ -6098,7 +6098,7 @@ ia64_option_override (void)
>       flag_ira_loop_pressure = 1;
>
>
> -  ia64_section_threshold = (global_options_set.x_g_switch_value
> +  ia64_section_threshold = (OPTION_SET_P (g_switch_value)
>                             ? g_switch_value
>                             : IA64_DEFAULT_GVALUE);
>
> @@ -6120,8 +6120,8 @@ static void
>   ia64_override_options_after_change (void)
>   {
>     if (optimize >= 3
> -      && !global_options_set.x_flag_selective_scheduling
> -      && !global_options_set.x_flag_selective_scheduling2)
> +      && !OPTION_SET_P (flag_selective_scheduling)
> +      && !OPTION_SET_P (flag_selective_scheduling2))
>       {
>         flag_selective_scheduling2 = 1;
>         flag_sel_sched_pipelining = 1;
> diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
> index d22bdd79c71..f99e2b0a485 100644
> --- a/gcc/config/m32c/m32c.c
> +++ b/gcc/config/m32c/m32c.c
> @@ -48,6 +48,7 @@
>   #include "expr.h"
>   #include "tm-constrs.h"
>   #include "builtins.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -412,7 +413,7 @@ static void
>   m32c_option_override (void)
>   {
>     /* We limit memregs to 0..16, and provide a default.  */
> -  if (global_options_set.x_target_memregs)
> +  if (OPTION_SET_P (target_memregs))
>       {
>         if (target_memregs < 0 || target_memregs > 16)
>         error ("invalid target memregs value %<%d%>", target_memregs);
> diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
> index 1aaba94bb5c..d644f6bda73 100644
> --- a/gcc/config/m32r/m32r.c
> +++ b/gcc/config/m32r/m32r.c
> @@ -45,6 +45,7 @@
>   #include "expr.h"
>   #include "tm-constrs.h"
>   #include "builtins.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -244,7 +245,7 @@ m32r_init (void)
>     m32r_punct_chars['@'] = 1; /* ??? no longer used */
>
>     /* Provide default value if not specified.  */
> -  if (!global_options_set.x_g_switch_value)
> +  if (!OPTION_SET_P (g_switch_value))
>       g_switch_value = SDATA_DEFAULT_SIZE;
>   }
>
> diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
> index 0248eb719a8..d1105e7a137 100644
> --- a/gcc/config/m68k/m68k.c
> +++ b/gcc/config/m68k/m68k.c
> @@ -500,13 +500,13 @@ m68k_option_override (void)
>     const struct m68k_target_selection *entry;
>     unsigned long target_mask;
>
> -  if (global_options_set.x_m68k_arch_option)
> +  if (OPTION_SET_P (m68k_arch_option))
>       m68k_arch_entry = &all_isas[m68k_arch_option];
>
> -  if (global_options_set.x_m68k_cpu_option)
> +  if (OPTION_SET_P (m68k_cpu_option))
>       m68k_cpu_entry = &all_devices[(int) m68k_cpu_option];
>
> -  if (global_options_set.x_m68k_tune_option)
> +  if (OPTION_SET_P (m68k_tune_option))
>       m68k_tune_entry = &all_microarchs[(int) m68k_tune_option];
>
>     /* User can choose:
> diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
> index 6e8f367c80a..4813f7a7921 100644
> --- a/gcc/config/microblaze/microblaze.c
> +++ b/gcc/config/microblaze/microblaze.c
> @@ -51,6 +51,7 @@
>   #include "cfgloop.h"
>   #include "insn-addr.h"
>   #include "cfgrtl.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -1741,7 +1742,7 @@ microblaze_option_override (void)
>     machine_mode mode;
>     int ver;
>
> -  microblaze_section_threshold = (global_options_set.x_g_switch_value
> +  microblaze_section_threshold = (OPTION_SET_P (g_switch_value)
>                                   ? g_switch_value
>                                   : MICROBLAZE_DEFAULT_GVALUE);
>
> diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
> index ade5d7041f0..807bf1a78d4 100644
> --- a/gcc/config/mips/mips.c
> +++ b/gcc/config/mips/mips.c
> @@ -66,6 +66,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "builtins.h"
>   #include "rtl-iter.h"
>   #include "flags.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -19883,7 +19884,7 @@ mips_option_override (void)
>   {
>     int i, start, regno, mode;
>
> -  if (global_options_set.x_mips_isa_option)
> +  if (OPTION_SET_P (mips_isa_option))
>       mips_isa_option_info = &mips_cpu_info_table[mips_isa_option];
>
>   #ifdef SUBTARGET_OVERRIDE_OPTIONS
> @@ -19915,7 +19916,7 @@ mips_option_override (void)
>       TARGET_INTERLINK_COMPRESSED = 1;
>
>     /* Set the small data limit.  */
> -  mips_small_data_threshold = (global_options_set.x_g_switch_value
> +  mips_small_data_threshold = (OPTION_SET_P (g_switch_value)
>                                ? g_switch_value
>                                : MIPS_DEFAULT_GVALUE);
>
> @@ -19923,7 +19924,7 @@ mips_option_override (void)
>        Similar code was added to GAS 2.14 (see tc-mips.c:md_after_parse_args()).
>        The GAS and GCC code should be kept in sync as much as possible.  */
>
> -  if (global_options_set.x_mips_arch_option)
> +  if (OPTION_SET_P (mips_arch_option))
>       mips_set_architecture (mips_cpu_info_from_opt (mips_arch_option));
>
>     if (mips_isa_option_info != 0)
> @@ -19945,7 +19946,7 @@ mips_option_override (void)
>            mips_arch_info->name);
>
>     /* Optimize for mips_arch, unless -mtune selects a different processor.  */
> -  if (global_options_set.x_mips_tune_option)
> +  if (OPTION_SET_P (mips_tune_option))
>       mips_set_tune (mips_cpu_info_from_opt (mips_tune_option));
>
>     if (mips_tune_info == 0)
> diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
> index 26d43331f33..7a613e4c13e 100644
> --- a/gcc/config/nios2/nios2.c
> +++ b/gcc/config/nios2/nios2.c
> @@ -52,6 +52,7 @@
>   #include "builtins.h"
>   #include "tree-pass.h"
>   #include "xregex.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -1363,7 +1364,7 @@ nios2_option_override (void)
>     init_machine_status = &nios2_init_machine_status;
>
>     nios2_section_threshold
> -    = (global_options_set.x_g_switch_value
> +    = (OPTION_SET_P (g_switch_value)
>          ? g_switch_value : NIOS2_DEFAULT_GVALUE);
>
>     if (nios2_gpopt_option == gpopt_unspecified)
> diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
> index 4e4909e8c5f..951252e598a 100644
> --- a/gcc/config/nvptx/nvptx.c
> +++ b/gcc/config/nvptx/nvptx.c
> @@ -215,7 +215,7 @@ nvptx_option_override (void)
>     /* Set toplevel_reorder, unless explicitly disabled.  We need
>        reordering so that we emit necessary assembler decls of
>        undeclared variables. */
> -  if (!global_options_set.x_flag_toplevel_reorder)
> +  if (!OPTION_SET_P (flag_toplevel_reorder))
>       flag_toplevel_reorder = 1;
>
>     debug_nonbind_markers_p = 0;
> @@ -223,7 +223,7 @@ nvptx_option_override (void)
>     /* Set flag_no_common, unless explicitly disabled.  We fake common
>        using .weak, and that's not entirely accurate, so avoid it
>        unless forced.  */
> -  if (!global_options_set.x_flag_no_common)
> +  if (!OPTION_SET_P (flag_no_common))
>       flag_no_common = 1;
>
>     /* The patch area requires nops, which we don't have.  */
> diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
> index 69ba5bd035c..d13021ad94a 100644
> --- a/gcc/config/pa/pa.c
> +++ b/gcc/config/pa/pa.c
> @@ -545,9 +545,9 @@ pa_option_override (void)
>       {
>         /* DWARF5 is not supported by gdb.  Don't emit DWARF5 unless
>          specifically selected.  */
> -      if (!global_options_set.x_dwarf_strict)
> +      if (!OPTION_SET_P (dwarf_strict))
>         dwarf_strict = 1;
> -      if (!global_options_set.x_dwarf_version)
> +      if (!OPTION_SET_P (dwarf_version))
>         dwarf_version = 4;
>       }
>
> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
> index 576960bb37c..126572c6243 100644
> --- a/gcc/config/riscv/riscv.c
> +++ b/gcc/config/riscv/riscv.c
> @@ -56,6 +56,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "builtins.h"
>   #include "predict.h"
>   #include "tree-pass.h"
> +#include "opts.h"
>
>   /* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF.  */
>   #define UNSPEC_ADDRESS_P(X)                                   \
> @@ -4839,7 +4840,7 @@ riscv_option_override (void)
>   #endif
>
>     if (riscv_stack_protector_guard == SSP_GLOBAL
> -      && global_options_set.x_riscv_stack_protector_guard_offset_str)
> +      && OPTION_SET_P (riscv_stack_protector_guard_offset_str))
>       {
>         error ("incompatible options %<-mstack-protector-guard=global%> and "
>              "%<-mstack-protector-guard-offset=%s%>",
> @@ -4847,15 +4848,15 @@ riscv_option_override (void)
>       }
>
>     if (riscv_stack_protector_guard == SSP_TLS
> -      && !(global_options_set.x_riscv_stack_protector_guard_offset_str
> -          && global_options_set.x_riscv_stack_protector_guard_reg_str))
> +      && !(OPTION_SET_P (riscv_stack_protector_guard_offset_str)
> +          && OPTION_SET_P (riscv_stack_protector_guard_reg_str)))
>       {
>         error ("both %<-mstack-protector-guard-offset%> and "
>              "%<-mstack-protector-guard-reg%> must be used "
>              "with %<-mstack-protector-guard=sysreg%>");
>       }
>
> -  if (global_options_set.x_riscv_stack_protector_guard_reg_str)
> +  if (OPTION_SET_P (riscv_stack_protector_guard_reg_str))
>       {
>         const char *str = riscv_stack_protector_guard_reg_str;
>         int reg = decode_reg_name (str);
> @@ -4867,7 +4868,7 @@ riscv_option_override (void)
>         riscv_stack_protector_guard_reg = reg;
>       }
>
> -  if (global_options_set.x_riscv_stack_protector_guard_offset_str)
> +  if (OPTION_SET_P (riscv_stack_protector_guard_offset_str))
>       {
>         char *end;
>         const char *str = riscv_stack_protector_guard_offset_str;
> diff --git a/gcc/config/rs6000/aix71.h b/gcc/config/rs6000/aix71.h
> index 1bc1560c496..ddd204dd862 100644
> --- a/gcc/config/rs6000/aix71.h
> +++ b/gcc/config/rs6000/aix71.h
> @@ -33,7 +33,7 @@ do {                                                                  \
>     if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)                    \
>       {                                                                 \
>         rs6000_long_double_type_size = 64;                              \
> -      if (global_options_set.x_rs6000_long_double_type_size)           \
> +      if (OPTION_SET_P (rs6000_long_double_type_size))         \
>         warning (0, "soft-float and long-double-128 are incompatible"); \
>       }                                                                 \
>     if (TARGET_POWERPC64 && ! TARGET_64BIT)                             \
> @@ -43,7 +43,7 @@ do {                                                                  \
>     if ((rs6000_isa_flags_explicit                                      \
>          & OPTION_MASK_MINIMAL_TOC) != 0)                                       \
>       {                                                                 \
> -      if (global_options_set.x_rs6000_current_cmodel                   \
> +      if (OPTION_SET_P (rs6000_current_cmodel)                 \
>           && rs6000_current_cmodel != CMODEL_SMALL)                     \
>         error ("%<-mcmodel%> incompatible with other toc options");     \
>         SET_CMODEL (CMODEL_SMALL);                                      \
> @@ -63,7 +63,7 @@ do {                                                                  \
>         /* aix/ppc doesn't support -mvsx and -maltivec with Go */               \
>         rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);   \
>       }                                                                 \
> -  if (!global_options_set.x_dwarf_version)                             \
> +  if (!OPTION_SET_P (dwarf_version))                           \
>       /* AIX only supports DWARF 4.  */                                 \
>       dwarf_version = 4;                                                        \
>   } while (0)
> diff --git a/gcc/config/rs6000/aix72.h b/gcc/config/rs6000/aix72.h
> index cca64f14f3a..f0e375cb984 100644
> --- a/gcc/config/rs6000/aix72.h
> +++ b/gcc/config/rs6000/aix72.h
> @@ -33,7 +33,7 @@ do {                                                                  \
>     if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)                    \
>       {                                                                 \
>         rs6000_long_double_type_size = 64;                              \
> -      if (global_options_set.x_rs6000_long_double_type_size)           \
> +      if (OPTION_SET_P (rs6000_long_double_type_size))         \
>         warning (0, "soft-float and long-double-128 are incompatible"); \
>       }                                                                 \
>     if (TARGET_POWERPC64 && ! TARGET_64BIT)                             \
> @@ -43,7 +43,7 @@ do {                                                                  \
>     if ((rs6000_isa_flags_explicit                                      \
>          & OPTION_MASK_MINIMAL_TOC) != 0)                                       \
>       {                                                                 \
> -      if (global_options_set.x_rs6000_current_cmodel                   \
> +      if (OPTION_SET_P (rs6000_current_cmodel)                 \
>           && rs6000_current_cmodel != CMODEL_SMALL)                     \
>         error ("%<-mcmodel%> incompatible with other toc options");     \
>         SET_CMODEL (CMODEL_SMALL);                                      \
> @@ -63,7 +63,7 @@ do {                                                                  \
>         /* aix/ppc doesn't support -mvsx and -maltivec with Go */               \
>         rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);   \
>       }                                                                 \
> -  if (!global_options_set.x_dwarf_version)                             \
> +  if (!OPTION_SET_P (dwarf_version))                           \
>       /* AIX only supports DWARF 4.  */                                 \
>       dwarf_version = 4;                                                        \
>   } while (0)
> diff --git a/gcc/config/rs6000/aix73.h b/gcc/config/rs6000/aix73.h
> index f0ca1a55e5d..2c92cc3db0d 100644
> --- a/gcc/config/rs6000/aix73.h
> +++ b/gcc/config/rs6000/aix73.h
> @@ -33,7 +33,7 @@ do {                                                                  \
>     if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)                    \
>       {                                                                 \
>         rs6000_long_double_type_size = 64;                              \
> -      if (global_options_set.x_rs6000_long_double_type_size)           \
> +      if (OPTION_SET_P (rs6000_long_double_type_size))         \
>         warning (0, "soft-float and long-double-128 are incompatible"); \
>       }                                                                 \
>     if (TARGET_POWERPC64 && ! TARGET_64BIT)                             \
> @@ -43,7 +43,7 @@ do {                                                                  \
>     if ((rs6000_isa_flags_explicit                                      \
>          & OPTION_MASK_MINIMAL_TOC) != 0)                                       \
>       {                                                                 \
> -      if (global_options_set.x_rs6000_current_cmodel                   \
> +      if (OPTION_SET_P (rs6000_current_cmodel)                 \
>           && rs6000_current_cmodel != CMODEL_SMALL)                     \
>         error ("%<-mcmodel%> incompatible with other toc options");     \
>         SET_CMODEL (CMODEL_SMALL);                                      \
> @@ -63,7 +63,7 @@ do {                                                                  \
>         /* aix/ppc doesn't support -mvsx and -maltivec with Go */               \
>         rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);   \
>       }                                                                 \
> -  if (!global_options_set.x_dwarf_version)                             \
> +  if (!OPTION_SET_P (dwarf_version))                           \
>       /* AIX only supports DWARF 4.  */                                 \
>       dwarf_version = 4;                                                        \
>   } while (0)
> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> index ad860728169..acba4d9f26c 100644
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -3392,7 +3392,7 @@ darwin_rs6000_override_options (void)
>         && !flag_apple_kext
>         && strverscmp (darwin_macosx_version_min, "10.5") >= 0
>         && ! (rs6000_isa_flags_explicit & OPTION_MASK_ALTIVEC)
> -      && ! global_options_set.x_rs6000_cpu_index)
> +      && ! OPTION_SET_P (rs6000_cpu_index))
>       {
>         rs6000_isa_flags |= OPTION_MASK_ALTIVEC;
>       }
> @@ -3471,18 +3471,18 @@ rs6000_override_options_after_change (void)
>   {
>     /* Explicit -funroll-loops turns -munroll-only-small-loops off, and
>        turns -frename-registers on.  */
> -  if ((global_options_set.x_flag_unroll_loops && flag_unroll_loops)
> -       || (global_options_set.x_flag_unroll_all_loops
> +  if ((OPTION_SET_P (flag_unroll_loops) && flag_unroll_loops)
> +       || (OPTION_SET_P (flag_unroll_all_loops)
>            && flag_unroll_all_loops))
>       {
> -      if (!global_options_set.x_unroll_only_small_loops)
> +      if (!OPTION_SET_P (unroll_only_small_loops))
>         unroll_only_small_loops = 0;
> -      if (!global_options_set.x_flag_rename_registers)
> +      if (!OPTION_SET_P (flag_rename_registers))
>         flag_rename_registers = 1;
> -      if (!global_options_set.x_flag_cunroll_grow_size)
> +      if (!OPTION_SET_P (flag_cunroll_grow_size))
>         flag_cunroll_grow_size = 1;
>       }
> -  else if (!global_options_set.x_flag_cunroll_grow_size)
> +  else if (!OPTION_SET_P (flag_cunroll_grow_size))
>       flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
>   }
>
> @@ -3490,7 +3490,7 @@ rs6000_override_options_after_change (void)
>   static void
>   rs6000_linux64_override_options ()
>   {
> -  if (!global_options_set.x_rs6000_alignment_flags)
> +  if (!OPTION_SET_P (rs6000_alignment_flags))
>       rs6000_alignment_flags = MASK_ALIGN_NATURAL;
>     if (rs6000_isa_flags & OPTION_MASK_64BIT)
>       {
> @@ -3526,11 +3526,11 @@ rs6000_linux64_override_options ()
>           rs6000_isa_flags |= OPTION_MASK_POWERPC64;
>           error ("%<-m64%> requires a PowerPC64 cpu");
>         }
> -      if (!global_options_set.x_rs6000_current_cmodel)
> +      if (!OPTION_SET_P (rs6000_current_cmodel))
>         SET_CMODEL (CMODEL_MEDIUM);
>         if ((rs6000_isa_flags_explicit & OPTION_MASK_MINIMAL_TOC) != 0)
>         {
> -         if (global_options_set.x_rs6000_current_cmodel
> +         if (OPTION_SET_P (rs6000_current_cmodel)
>               && rs6000_current_cmodel != CMODEL_SMALL)
>             error ("%<-mcmodel incompatible with other toc options%>");
>           if (TARGET_MINIMAL_TOC)
> @@ -3545,14 +3545,14 @@ rs6000_linux64_override_options ()
>         }
>         if (rs6000_current_cmodel != CMODEL_SMALL)
>         {
> -         if (!global_options_set.x_TARGET_NO_FP_IN_TOC)
> +         if (!OPTION_SET_P (TARGET_NO_FP_IN_TOC))
>             TARGET_NO_FP_IN_TOC = rs6000_current_cmodel == CMODEL_MEDIUM;
> -         if (!global_options_set.x_TARGET_NO_SUM_IN_TOC)
> +         if (!OPTION_SET_P (TARGET_NO_SUM_IN_TOC))
>             TARGET_NO_SUM_IN_TOC = 0;
>         }
>         if (TARGET_PLTSEQ && DEFAULT_ABI != ABI_ELFv2)
>         {
> -         if (global_options_set.x_rs6000_pltseq)
> +         if (OPTION_SET_P (rs6000_pltseq))
>             warning (0, "%qs unsupported for this ABI",
>                      "-mpltseq");
>           rs6000_pltseq = false;
> @@ -3567,7 +3567,7 @@ rs6000_linux64_override_options ()
>           profile_kernel = 0;
>           error (INVALID_32BIT, "profile-kernel");
>         }
> -      if (global_options_set.x_rs6000_current_cmodel)
> +      if (OPTION_SET_P (rs6000_current_cmodel))
>         {
>           SET_CMODEL (CMODEL_SMALL);
>           error (INVALID_32BIT, "cmodel");
> @@ -3627,7 +3627,7 @@ glibc_supports_ieee_128bit (void)
>        includes OPTION_TARGET_CPU_DEFAULT, representing the name of the
>        default CPU specified at build configure time, TARGET_DEFAULT,
>        representing the default set of option flags for the default
> -     target, and global_options_set.x_rs6000_isa_flags, representing
> +     target, and OPTION_SET_P (rs6000_isa_flags), representing
>        which options were requested on the command line.
>
>      Upon return from this function:
> @@ -3676,13 +3676,13 @@ rs6000_option_override_internal (bool global_init_p)
>
>     /* Remember the explicit arguments.  */
>     if (global_init_p)
> -    rs6000_isa_flags_explicit = global_options_set.x_rs6000_isa_flags;
> +    rs6000_isa_flags_explicit = OPTION_SET_P (rs6000_isa_flags);
>
>     /* On 64-bit Darwin, power alignment is ABI-incompatible with some C
>        library functions, so warn about it. The flag may be useful for
>        performance studies from time to time though, so don't disable it
>        entirely.  */
> -  if (global_options_set.x_rs6000_alignment_flags
> +  if (OPTION_SET_P (rs6000_alignment_flags)
>         && rs6000_alignment_flags == MASK_ALIGN_POWER
>         && DEFAULT_ABI == ABI_DARWIN
>         && TARGET_64BIT)
> @@ -3695,20 +3695,20 @@ rs6000_option_override_internal (bool global_init_p)
>        with enough (>= 32) registers.  It is an expensive optimization.
>        So it is on only for peak performance.  */
>     if (optimize >= 3 && global_init_p
> -      && !global_options_set.x_flag_ira_loop_pressure)
> +      && !OPTION_SET_P (flag_ira_loop_pressure))
>       flag_ira_loop_pressure = 1;
>
>     /* -fsanitize=address needs to turn on -fasynchronous-unwind-tables in order
>        for tracebacks to be complete but not if any -fasynchronous-unwind-tables
>        options were already specified.  */
>     if (flag_sanitize & SANITIZE_USER_ADDRESS
> -      && !global_options_set.x_flag_asynchronous_unwind_tables)
> +      && !OPTION_SET_P (flag_asynchronous_unwind_tables))
>       flag_asynchronous_unwind_tables = 1;
>
>     /* -fvariable-expansion-in-unroller is a win for POWER whenever the
>        loop unroller is active.  It is only checked during unrolling, so
>        we can just set it on by default.  */
> -  if (!global_options_set.x_flag_variable_expansion_in_unroller)
> +  if (!OPTION_SET_P (flag_variable_expansion_in_unroller))
>       flag_variable_expansion_in_unroller = 1;
>
>     /* Set the pointer size.  */
> @@ -3905,7 +3905,7 @@ rs6000_option_override_internal (bool global_init_p)
>
>   #ifdef XCOFF_DEBUGGING_INFO
>     /* For AIX default to 64-bit DWARF.  */
> -  if (!global_options_set.x_dwarf_offset_size)
> +  if (!OPTION_SET_P (dwarf_offset_size))
>       dwarf_offset_size = POINTER_SIZE_UNITS;
>   #endif
>
> @@ -4129,7 +4129,7 @@ rs6000_option_override_internal (bool global_init_p)
>     else if (TARGET_ALLOW_MOVMISALIGN && !TARGET_VSX)
>       {
>         if (TARGET_ALLOW_MOVMISALIGN > 0
> -         && global_options_set.x_TARGET_ALLOW_MOVMISALIGN)
> +         && OPTION_SET_P (TARGET_ALLOW_MOVMISALIGN))
>         error ("%qs requires %qs", "-mallow-movmisalign", "-mvsx");
>
>         TARGET_ALLOW_MOVMISALIGN = 0;
> @@ -4184,7 +4184,7 @@ rs6000_option_override_internal (bool global_init_p)
>                                   : FLOAT_PRECISION_TFmode);
>
>     /* Set long double size before the IEEE 128-bit tests.  */
> -  if (!global_options_set.x_rs6000_long_double_type_size)
> +  if (!OPTION_SET_P (rs6000_long_double_type_size))
>       {
>         if (main_target_opt != NULL
>           && (main_target_opt->x_rs6000_long_double_type_size
> @@ -4197,7 +4197,7 @@ rs6000_option_override_internal (bool global_init_p)
>       ; /* The option value can be seen when cl_target_option_restore is called.  */
>     else if (rs6000_long_double_type_size == 128)
>       rs6000_long_double_type_size = FLOAT_PRECISION_TFmode;
> -  else if (global_options_set.x_rs6000_ieeequad)
> +  else if (OPTION_SET_P (rs6000_ieeequad))
>       {
>         if (global_options.x_rs6000_ieeequad)
>         error ("%qs requires %qs", "-mabi=ieeelongdouble", "-mlong-double-128");
> @@ -4210,7 +4210,7 @@ rs6000_option_override_internal (bool global_init_p)
>        explicitly redefine TARGET_IEEEQUAD and TARGET_IEEEQUAD_DEFAULT to 0, so
>        those systems will not pick up this default.  Warn if the user changes the
>        default unless -Wno-psabi.  */
> -  if (!global_options_set.x_rs6000_ieeequad)
> +  if (!OPTION_SET_P (rs6000_ieeequad))
>       rs6000_ieeequad = TARGET_IEEEQUAD_DEFAULT;
>
>     else
> @@ -4395,7 +4395,7 @@ rs6000_option_override_internal (bool global_init_p)
>     /* Enable Altivec ABI for AIX -maltivec.  */
>     if (TARGET_XCOFF
>         && (TARGET_ALTIVEC || TARGET_VSX)
> -      && !global_options_set.x_rs6000_altivec_abi)
> +      && !OPTION_SET_P (rs6000_altivec_abi))
>       {
>         if (main_target_opt != NULL && !main_target_opt->x_rs6000_altivec_abi)
>         error ("target attribute or pragma changes AltiVec ABI");
> @@ -4408,7 +4408,7 @@ rs6000_option_override_internal (bool global_init_p)
>        be explicitly overridden in either case.  */
>     if (TARGET_ELF)
>       {
> -      if (!global_options_set.x_rs6000_altivec_abi
> +      if (!OPTION_SET_P (rs6000_altivec_abi)
>           && (TARGET_64BIT || TARGET_ALTIVEC || TARGET_VSX))
>         {
>           if (main_target_opt != NULL &&
> @@ -4438,7 +4438,7 @@ rs6000_option_override_internal (bool global_init_p)
>     /* Place FP constants in the constant pool instead of TOC
>        if section anchors enabled.  */
>     if (flag_section_anchors
> -      && !global_options_set.x_TARGET_NO_FP_IN_TOC)
> +      && !OPTION_SET_P (TARGET_NO_FP_IN_TOC))
>       TARGET_NO_FP_IN_TOC = 1;
>
>     if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
> @@ -4595,7 +4595,7 @@ rs6000_option_override_internal (bool global_init_p)
>       }
>
>     /* Handle stack protector */
> -  if (!global_options_set.x_rs6000_stack_protector_guard)
> +  if (!OPTION_SET_P (rs6000_stack_protector_guard))
>   #ifdef TARGET_THREAD_SSP_OFFSET
>       rs6000_stack_protector_guard = SSP_TLS;
>   #else
> @@ -4607,7 +4607,7 @@ rs6000_option_override_internal (bool global_init_p)
>     rs6000_stack_protector_guard_reg = TARGET_64BIT ? 13 : 2;
>   #endif
>
> -  if (global_options_set.x_rs6000_stack_protector_guard_offset_str)
> +  if (OPTION_SET_P (rs6000_stack_protector_guard_offset_str))
>       {
>         char *endp;
>         const char *str = rs6000_stack_protector_guard_offset_str;
> @@ -4626,7 +4626,7 @@ rs6000_option_override_internal (bool global_init_p)
>         rs6000_stack_protector_guard_offset = offset;
>       }
>
> -  if (global_options_set.x_rs6000_stack_protector_guard_reg_str)
> +  if (OPTION_SET_P (rs6000_stack_protector_guard_reg_str))
>       {
>         const char *str = rs6000_stack_protector_guard_reg_str;
>         int reg = decode_reg_name (str);
> @@ -4654,7 +4654,7 @@ rs6000_option_override_internal (bool global_init_p)
>         /* Set aix_struct_return last, after the ABI is determined.
>          If -maix-struct-return or -msvr4-struct-return was explicitly
>          used, don't override with the ABI default.  */
> -      if (!global_options_set.x_aix_struct_return)
> +      if (!OPTION_SET_P (aix_struct_return))
>         aix_struct_return = (DEFAULT_ABI != ABI_V4 || DRAFT_V4_STRUCT_RET);
>
>   #if 0
> @@ -6272,14 +6272,14 @@ rs6000_file_start (void)
>           start = "";
>         }
>
> -      if (global_options_set.x_rs6000_cpu_index)
> +      if (OPTION_SET_P (rs6000_cpu_index))
>         {
>           fprintf (file, "%s -mcpu=%s", start,
>                    processor_target_table[rs6000_cpu_index].name);
>           start = "";
>         }
>
> -      if (global_options_set.x_rs6000_tune_index)
> +      if (OPTION_SET_P (rs6000_tune_index))
>         {
>           fprintf (file, "%s -mtune=%s", start,
>                    processor_target_table[rs6000_tune_index].name);
> @@ -21053,7 +21053,7 @@ rs6000_darwin_file_start (void)
>     if (rs6000_default_cpu != 0 && rs6000_default_cpu[0] != '\0')
>       cpu_id = rs6000_default_cpu;
>
> -  if (global_options_set.x_rs6000_cpu_index)
> +  if (OPTION_SET_P (rs6000_cpu_index))
>       cpu_id = processor_target_table[rs6000_cpu_index].name;
>
>     /* Look through the mapping array.  Pick the first name that either
> diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
> index 872cc2849af..6184c5fde45 100644
> --- a/gcc/config/rs6000/rtems.h
> +++ b/gcc/config/rs6000/rtems.h
> @@ -116,14 +116,14 @@
>           if ((rs6000_isa_flags_explicit                        \
>                 & OPTION_MASK_MINIMAL_TOC) != 0)                \
>             {                                                   \
> -             if (global_options_set.x_rs6000_current_cmodel    \
> +             if (OPTION_SET_P (rs6000_current_cmodel)  \
>                   && rs6000_current_cmodel != CMODEL_SMALL)     \
>                 error ("%<-mcmodel%> incompatible with other toc options"); \
>               SET_CMODEL (CMODEL_SMALL);                        \
>             }                                                   \
>           else                                                  \
>             {                                                   \
> -             if (!global_options_set.x_rs6000_current_cmodel)  \
> +             if (!OPTION_SET_P (rs6000_current_cmodel))        \
>                 SET_CMODEL (CMODEL_MEDIUM);                     \
>               if (rs6000_current_cmodel != CMODEL_SMALL)        \
>                 {                                               \
> diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
> index 23ff59403a3..96ee5524224 100644
> --- a/gcc/config/rs6000/sysv4.h
> +++ b/gcc/config/rs6000/sysv4.h
> @@ -70,7 +70,7 @@
>
>   #define SUBTARGET_OVERRIDE_OPTIONS                                    \
>   do {                                                                  \
> -  if (!global_options_set.x_g_switch_value)                            \
> +  if (!OPTION_SET_P (g_switch_value))                          \
>       g_switch_value = SDATA_DEFAULT_SIZE;                              \
>                                                                         \
>     if (rs6000_abi_name == NULL)                                                \
> @@ -197,16 +197,16 @@ do {                                                                      \
>       }                                                                 \
>                                                                         \
>     if (TARGET_PLTSEQ != rs6000_pltseq                                  \
> -      && global_options_set.x_rs6000_pltseq)                           \
> +      && OPTION_SET_P (rs6000_pltseq))                         \
>       {                                                                 \
>         error ("%qs not supported by your assembler", "-mpltseq");      \
>       }                                                                 \
>                                                                         \
>     if (DEFAULT_ABI == ABI_V4 && TARGET_PLTSEQ && !TARGET_SECURE_PLT)   \
>       {                                                                 \
> -      if (global_options_set.x_rs6000_pltseq)                          \
> +      if (OPTION_SET_P (rs6000_pltseq))                                \
>         {                                                               \
> -         if (global_options_set.x_secure_plt)                          \
> +         if (OPTION_SET_P (secure_plt))                                \
>             error ("%qs and %qs are incompatible",                      \
>                    "-mpltseq", "-mbss-plt");                            \
>           else                                                          \
> diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
> index d8ecc0296c8..ca21a3a7bd3 100644
> --- a/gcc/config/rs6000/vxworks.h
> +++ b/gcc/config/rs6000/vxworks.h
> @@ -155,7 +155,7 @@ along with GCC; see the file COPYING3.  If not see
>   #undef SUB3TARGET_OVERRIDE_OPTIONS
>   #define SUB3TARGET_OVERRIDE_OPTIONS           \
>     do {                                          \
> -  if (!global_options_set.x_g_switch_value)     \
> +  if (!OPTION_SET_P (g_switch_value))     \
>       g_switch_value = SDATA_DEFAULT_SIZE;        \
>     VXWORKS_OVERRIDE_OPTIONS;                     \
>     } while (0)
> diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
> index e04385451cf..4f144d1b0eb 100644
> --- a/gcc/config/s390/s390.c
> +++ b/gcc/config/s390/s390.c
> @@ -15746,9 +15746,9 @@ s390_option_override (void)
>       {
>         /* Don't emit DWARF3/4 unless specifically selected.  The TPF
>          debuggers do not yet support DWARF 3/4.  */
> -      if (!global_options_set.x_dwarf_strict)
> +      if (!OPTION_SET_P (dwarf_strict))
>         dwarf_strict = 1;
> -      if (!global_options_set.x_dwarf_version)
> +      if (!OPTION_SET_P (dwarf_version))
>         dwarf_version = 2;
>       }
>   }
> diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
> index 7558d2f7195..b75a7b8250e 100644
> --- a/gcc/config/sh/linux.h
> +++ b/gcc/config/sh/linux.h
> @@ -126,7 +126,7 @@ along with GCC; see the file COPYING3.  If not see
>     do                                                                  \
>       {                                                                 \
>         /* Set default atomic model if it hasn't been specified.  */    \
> -      if (global_options_set.x_sh_atomic_model_str == 0)               \
> +      if (OPTION_SET_P (sh_atomic_model_str) == 0)             \
>         {                                                               \
>           if (TARGET_SH3)                                               \
>             sh_atomic_model_str = "soft-gusa";                          \
> @@ -134,7 +134,7 @@ along with GCC; see the file COPYING3.  If not see
>             sh_atomic_model_str = "soft-imask";                         \
>         }                                                               \
>         /* Set -musermode if it hasn't been specified.  */              \
> -      if (global_options_set.x_TARGET_USERMODE == 0)                   \
> +      if (OPTION_SET_P (TARGET_USERMODE) == 0)                 \
>         TARGET_USERMODE = true;                                         \
>       }                                                                 \
>     while (0)
> diff --git a/gcc/config/sh/netbsd-elf.h b/gcc/config/sh/netbsd-elf.h
> index f0b75419855..39eb773001d 100644
> --- a/gcc/config/sh/netbsd-elf.h
> +++ b/gcc/config/sh/netbsd-elf.h
> @@ -85,7 +85,7 @@ while (0)
>     do                                                                  \
>       {                                                                 \
>         /* Set -musermode if it hasn't been specified.  */              \
> -      if (global_options_set.x_TARGET_USERMODE == 0)                   \
> +      if (OPTION_SET_P (TARGET_USERMODE) == 0)                 \
>         TARGET_USERMODE = true;                                         \
>       }                                                                 \
>     while (0)
> diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
> index 1564109c942..0628f059ca2 100644
> --- a/gcc/config/sh/sh.c
> +++ b/gcc/config/sh/sh.c
> @@ -893,7 +893,7 @@ sh_option_override (void)
>       }
>
>     /* Set -mzdcbranch for SH4 / SH4A if not otherwise specified by the user.  */
> -  if (! global_options_set.x_TARGET_ZDCBRANCH && TARGET_HARD_SH4)
> +  if (! OPTION_SET_P (TARGET_ZDCBRANCH) && TARGET_HARD_SH4)
>       TARGET_ZDCBRANCH = 1;
>
>     /* FDPIC code is a special form of PIC, and the vast majority of code
> @@ -932,13 +932,13 @@ sh_option_override (void)
>          <http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00816.html>.  */
>         else if (flag_exceptions)
>         {
> -         if (flag_schedule_insns && global_options_set.x_flag_schedule_insns)
> +         if (flag_schedule_insns && OPTION_SET_P (flag_schedule_insns))
>             warning (0, "ignoring %<-fschedule-insns%> because of exception "
>                         "handling bug");
>           flag_schedule_insns = 0;
>         }
>         else if (flag_schedule_insns
> -              && !global_options_set.x_flag_schedule_insns)
> +              && !OPTION_SET_P (flag_schedule_insns))
>         flag_schedule_insns = 0;
>       }
>
> @@ -958,12 +958,12 @@ sh_option_override (void)
>     if (flag_unsafe_math_optimizations)
>       {
>         /* Enable fsca insn for SH4A if not otherwise specified by the user.  */
> -      if (global_options_set.x_TARGET_FSCA == 0
> +      if (OPTION_SET_P (TARGET_FSCA) == 0
>           && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
>         TARGET_FSCA = 1;
>
>         /* Enable fsrra insn for SH4A if not otherwise specified by the user.  */
> -      if (global_options_set.x_TARGET_FSRRA == 0
> +      if (OPTION_SET_P (TARGET_FSRRA) == 0
>           && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
>         TARGET_FSRRA = 1;
>       }
> @@ -976,7 +976,7 @@ sh_option_override (void)
>
>     /* If the -mieee option was not explicitly set by the user, turn it on
>        unless -ffinite-math-only was specified.  See also PR 33135.  */
> -  if (! global_options_set.x_TARGET_IEEE)
> +  if (! OPTION_SET_P (TARGET_IEEE))
>       TARGET_IEEE = ! flag_finite_math_only;
>
>     if (sh_fixed_range_str)
> diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
> index 1fbdbf5046c..517816a1fe6 100644
> --- a/gcc/config/sol2.c
> +++ b/gcc/config/sol2.c
> @@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "diagnostic-core.h"
>   #include "varasm.h"
>   #include "output.h"
> +#include "opts.h"
>
>   tree solaris_pending_aligns, solaris_pending_inits, solaris_pending_finis;
>
> @@ -296,6 +297,6 @@ solaris_override_options (void)
>   {
>     /* Older versions of Solaris ld cannot handle CIE version 3 in .eh_frame.
>        Don't emit DWARF3/4 unless specifically selected if so.  */
> -  if (!HAVE_LD_EH_FRAME_CIEV3 && !global_options_set.x_dwarf_version)
> +  if (!HAVE_LD_EH_FRAME_CIEV3 && !OPTION_SET_P (dwarf_version))
>       dwarf_version = 2;
>   }
> diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
> index 6bc6f0ace6a..ca91be4c8e9 100644
> --- a/gcc/config/sparc/sparc.c
> +++ b/gcc/config/sparc/sparc.c
> @@ -1859,7 +1859,7 @@ sparc_option_override (void)
>         }
>
>     /* Set the default CPU if no -mcpu option was specified.  */
> -  if (!global_options_set.x_sparc_cpu_and_features)
> +  if (!OPTION_SET_P (sparc_cpu_and_features))
>       {
>         for (def = &cpu_default[0]; def->cpu != -1; ++def)
>         if (def->cpu == TARGET_CPU_DEFAULT)
> @@ -1869,7 +1869,7 @@ sparc_option_override (void)
>       }
>
>     /* Set the default CPU if no -mtune option was specified.  */
> -  if (!global_options_set.x_sparc_cpu)
> +  if (!OPTION_SET_P (sparc_cpu))
>       sparc_cpu = sparc_cpu_and_features;
>
>     cpu = &cpu_table[(int) sparc_cpu_and_features];
> @@ -1975,7 +1975,7 @@ sparc_option_override (void)
>       dump_target_flags ("Final target_flags", target_flags);
>
>     /* Set the code model if no -mcmodel option was specified.  */
> -  if (global_options_set.x_sparc_code_model)
> +  if (OPTION_SET_P (sparc_code_model))
>       {
>         if (TARGET_ARCH32)
>         error ("%<-mcmodel=%> is not supported in 32-bit mode");
> @@ -1989,7 +1989,7 @@ sparc_option_override (void)
>       }
>
>     /* Set the memory model if no -mmemory-model option was specified.  */
> -  if (!global_options_set.x_sparc_memory_model)
> +  if (!OPTION_SET_P (sparc_memory_model))
>       {
>         /* Choose the memory model for the operating system.  */
>         enum sparc_memory_model_type os_default = SUBTARGET_DEFAULT_MEMORY_MODEL;
> @@ -2177,12 +2177,12 @@ sparc_option_override (void)
>     /* Disable save slot sharing for call-clobbered registers by default.
>        The IRA sharing algorithm works on single registers only and this
>        pessimizes for double floating-point registers.  */
> -  if (!global_options_set.x_flag_ira_share_save_slots)
> +  if (!OPTION_SET_P (flag_ira_share_save_slots))
>       flag_ira_share_save_slots = 0;
>
>     /* Only enable REE by default in 64-bit mode where it helps to eliminate
>        redundant 32-to-64-bit extensions.  */
> -  if (!global_options_set.x_flag_ree && TARGET_ARCH32)
> +  if (!OPTION_SET_P (flag_ree) && TARGET_ARCH32)
>       flag_ree = 0;
>
>     /* Do various machine dependent initializations.  */
> diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
> index 64e28f641d8..08d1126c49e 100644
> --- a/gcc/config/tilegx/tilegx.c
> +++ b/gcc/config/tilegx/tilegx.c
> @@ -56,6 +56,7 @@
>   #include "tilegx-builtins.h"
>   #include "tilegx-multiply.h"
>   #include "builtins.h"
> +#include "opts.h"
>
>   /* This file should be included last.  */
>   #include "target-def.h"
> @@ -76,7 +77,7 @@ static bool output_memory_autoinc_first;
>   static void
>   tilegx_option_override (void)
>   {
> -  if (global_options_set.x_tilegx_cmodel)
> +  if (OPTION_SET_P (tilegx_cmodel))
>       {
>         switch (tilegx_cmodel)
>         {
> diff --git a/gcc/config/visium/visium.c b/gcc/config/visium/visium.c
> index 58e5355e712..ffa2243f155 100644
> --- a/gcc/config/visium/visium.c
> +++ b/gcc/config/visium/visium.c
> @@ -443,7 +443,7 @@ visium_option_override (void)
>       }
>
>     /* Set -mtune from -mcpu if not specified.  */
> -  if (!global_options_set.x_visium_cpu)
> +  if (!OPTION_SET_P (visium_cpu))
>       visium_cpu = visium_cpu_and_features;
>
>     /* Align functions on 256-byte (32-quadword) for GR5 and 64-byte (8-quadword)
> diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c
> index 51f4675d7c6..29ec0604b62 100644
> --- a/gcc/config/vxworks.c
> +++ b/gcc/config/vxworks.c
> @@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "rtl.h"
>   #include "memmodel.h"
>   #include "optabs.h"
> +#include "opts.h"
>
>   #if !HAVE_INITFINI_ARRAY_SUPPORT
>   /* Like default_named_section_asm_out_constructor, except that even
> @@ -167,10 +168,10 @@ vxworks_override_options (void)
>        dwarf up to certain version.  Default dwarf control to friendly
>        values for these.  */
>
> -  if (!global_options_set.x_dwarf_strict)
> +  if (!OPTION_SET_P (dwarf_strict))
>       dwarf_strict = 1;
>
> -  if (!global_options_set.x_dwarf_version)
> +  if (!OPTION_SET_P (dwarf_version))
>       dwarf_version = VXWORKS_DWARF_VERSION_DEFAULT;
>
>   }
> diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
> index 66d5221692a..08f8514d08d 100644
> --- a/gcc/cp/constexpr.c
> +++ b/gcc/cp/constexpr.c
> @@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "fold-const-call.h"
>   #include "stor-layout.h"
>   #include "cgraph.h"
> +#include "opts.h"
>
>   static bool verify_constant (tree, bool, bool *, bool *);
>   #define VERIFY_CONSTANT(X)                                            \
> @@ -6107,7 +6108,7 @@ maybe_warn_about_constant_value (location_t loc, tree decl)
>     static bool explained = false;
>     if (cxx_dialect >= cxx17
>         && warn_interference_size
> -      && !global_options_set.x_param_destruct_interfere_size
> +      && !OPTION_SET_P (param_destruct_interfere_size)
>         && DECL_CONTEXT (decl) == std_node
>         && id_equal (DECL_NAME (decl), "hardware_destructive_interference_size")
>         && (LOCATION_FILE (input_location) != main_input_filename
> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
> index 2d30c790b93..561debe6a0e 100644
> --- a/gcc/cp/decl.c
> +++ b/gcc/cp/decl.c
> @@ -56,6 +56,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "context.h"  /* For 'g'.  */
>   #include "omp-general.h"
>   #include "omp-offload.h"  /* For offload_vars.  */
> +#include "opts.h"
>
>   /* Possible cases of bad specifiers type used by bad_specifiers. */
>   enum bad_spec_place {
> @@ -3228,7 +3229,7 @@ redeclaration_error_message (tree newdecl, tree olddecl)
>         {
>           DECL_EXTERNAL (newdecl) = 1;
>           /* For now, only warn with explicit -Wdeprecated.  */
> -         if (global_options_set.x_warn_deprecated)
> +         if (OPTION_SET_P (warn_deprecated))
>             {
>               auto_diagnostic_group d;
>               if (warning_at (DECL_SOURCE_LOCATION (newdecl), OPT_Wdeprecated,
> @@ -4756,7 +4757,7 @@ cxx_init_decl_processing (void)
>     /* Check that the hardware interference sizes are at least
>        alignof(max_align_t), as required by the standard.  */
>     const int max_align = max_align_t_align () / BITS_PER_UNIT;
> -  if (global_options_set.x_param_destruct_interfere_size)
> +  if (OPTION_SET_P (param_destruct_interfere_size))
>       {
>         if (param_destruct_interfere_size < max_align)
>         error ("%<--param destructive-interference-size=%d%> is less than "
> @@ -4773,7 +4774,7 @@ cxx_init_decl_processing (void)
>       param_destruct_interfere_size = param_l1_cache_line_size;
>     /* else leave it unset.  */
>
> -  if (global_options_set.x_param_construct_interfere_size)
> +  if (OPTION_SET_P (param_construct_interfere_size))
>       {
>         if (param_construct_interfere_size < max_align)
>         error ("%<--param constructive-interference-size=%d%> is less than "
> diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
> index fa29a46ab1e..be6330fbdfb 100644
> --- a/gcc/d/d-lang.cc
> +++ b/gcc/d/d-lang.cc
> @@ -792,13 +792,13 @@ d_post_options (const char ** fn)
>
>     if (global.params.betterC)
>       {
> -      if (!global_options_set.x_flag_moduleinfo)
> +      if (!OPTION_SET_P (flag_moduleinfo))
>         global.params.useModuleInfo = false;
>
> -      if (!global_options_set.x_flag_rtti)
> +      if (!OPTION_SET_P (flag_rtti))
>         global.params.useTypeInfo = false;
>
> -      if (!global_options_set.x_flag_exceptions)
> +      if (!OPTION_SET_P (flag_exceptions))
>         global.params.useExceptions = false;
>
>         global.params.checkAction = CHECKACTION_C;
> @@ -810,7 +810,7 @@ d_post_options (const char ** fn)
>     /* Turn off partitioning unless it was explicitly requested, as it doesn't
>        work with D exception chaining, where EH handler uses LSDA to determine
>        whether two thrown exception are in the same context.  */
> -  if (!global_options_set.x_flag_reorder_blocks_and_partition)
> +  if (!OPTION_SET_P (flag_reorder_blocks_and_partition))
>       global_options.x_flag_reorder_blocks_and_partition = 0;
>
>     /* Error about use of deprecated features.  */
> @@ -819,7 +819,7 @@ d_post_options (const char ** fn)
>       global.params.useDeprecated = DIAGNOSTICerror;
>
>     /* Make -fmax-errors visible to frontend's diagnostic machinery.  */
> -  if (global_options_set.x_flag_max_errors)
> +  if (OPTION_SET_P (flag_max_errors))
>       global.params.errorLimit = flag_max_errors;
>
>     if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
> diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
> index 016b70443ae..3499a1caa6d 100644
> --- a/gcc/fortran/options.c
> +++ b/gcc/fortran/options.c
> @@ -260,7 +260,7 @@ gfc_post_options (const char **pfilename)
>        If not enabled explicitly by the user, only warn for -I
>        and -J, otherwise warn for all include paths.  */
>     verbose_missing_dir_warn
> -    = (global_options_set.x_cpp_warn_missing_include_dirs
> +    = (OPTION_SET_P (cpp_warn_missing_include_dirs)
>          && global_options.x_cpp_warn_missing_include_dirs);
>     SET_OPTION_IF_UNSET (&global_options, &global_options_set,
>                        cpp_warn_missing_include_dirs, 1);
> @@ -309,7 +309,7 @@ gfc_post_options (const char **pfilename)
>       flag_dump_fortran_original = 0;
>
>     /* Make -fmax-errors visible to gfortran's diagnostic machinery.  */
> -  if (global_options_set.x_flag_max_errors)
> +  if (OPTION_SET_P (flag_max_errors))
>       gfc_option.max_errors = flag_max_errors;
>
>     /* Verify the input file name.  */
> @@ -388,7 +388,7 @@ gfc_post_options (const char **pfilename)
>
>         /* Enable -Werror=line-truncation when -Werror and -Wno-error have
>          not been set.  */
> -      if (warn_line_truncation && !global_options_set.x_warnings_are_errors
> +      if (warn_line_truncation && !OPTION_SET_P (warnings_are_errors)
>           && (global_dc->classify_diagnostic[OPT_Wline_truncation] ==
>               DK_UNSPECIFIED))
>         diagnostic_classify_diagnostic (global_dc, OPT_Wline_truncation,
> diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
> index 9496b3c8e0b..7b2ad74e69a 100644
> --- a/gcc/lto-opts.c
> +++ b/gcc/lto-opts.c
> @@ -70,17 +70,17 @@ lto_write_options (void)
>
>     obstack_init (&temporary_obstack);
>
> -  if (!global_options_set.x_flag_openmp
> +  if (!OPTION_SET_P (flag_openmp)
>         && !global_options.x_flag_openmp)
>       append_to_collect_gcc_options (&temporary_obstack, &first_p,
>                                    "-fno-openmp");
> -  if (!global_options_set.x_flag_openacc
> +  if (!OPTION_SET_P (flag_openacc)
>         && !global_options.x_flag_openacc)
>       append_to_collect_gcc_options (&temporary_obstack, &first_p,
>                                    "-fno-openacc");
>     /* Append PIC/PIE mode because its default depends on target and it is
>        subject of merging in lto-wrapper.  */
> -  if (!global_options_set.x_flag_pic && !global_options_set.x_flag_pie)
> +  if (!OPTION_SET_P (flag_pic) && !OPTION_SET_P (flag_pie))
>       {
>          append_to_collect_gcc_options (&temporary_obstack, &first_p,
>                                       global_options.x_flag_pic == 2
> @@ -94,7 +94,7 @@ lto_write_options (void)
>                                       : "-fno-pie");
>       }
>
> -  if (!global_options_set.x_flag_cf_protection)
> +  if (!OPTION_SET_P (flag_cf_protection))
>       {
>         append_to_collect_gcc_options (
>         &temporary_obstack, &first_p,
> diff --git a/gcc/objc/objc-next-runtime-abi-01.c b/gcc/objc/objc-next-runtime-abi-01.c
> index 183fc01abb2..17c86189923 100644
> --- a/gcc/objc/objc-next-runtime-abi-01.c
> +++ b/gcc/objc/objc-next-runtime-abi-01.c
> @@ -259,7 +259,7 @@ static void next_runtime_01_initialize (void)
>   #ifdef OBJCPLUS
>     /* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by
>        default.  */
> -  if (!global_options_set.x_flag_objc_call_cxx_cdtors)
> +  if (!OPTION_SET_P (flag_objc_call_cxx_cdtors))
>       global_options.x_flag_objc_call_cxx_cdtors = 1;
>   #endif
>
> diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
> index 9c35738a95c..677b75f0334 100644
> --- a/gcc/objc/objc-next-runtime-abi-02.c
> +++ b/gcc/objc/objc-next-runtime-abi-02.c
> @@ -255,7 +255,7 @@ objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
>       }
>
>     /* NeXT ABI 2 is intended to default to checking for nil receivers.  */
> -  if (! global_options_set.x_flag_objc_nilcheck)
> +  if (! OPTION_SET_P (flag_objc_nilcheck))
>       flag_objc_nilcheck = 1;
>
>     rthooks->initialize = next_runtime_02_initialize;
> @@ -366,7 +366,7 @@ static void next_runtime_02_initialize (void)
>   #ifdef OBJCPLUS
>     /* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by
>        default.  */
> -  if (!global_options_set.x_flag_objc_call_cxx_cdtors)
> +  if (!OPTION_SET_P (flag_objc_call_cxx_cdtors))
>       global_options.x_flag_objc_call_cxx_cdtors = 1;
>   #endif
>
> diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
> index 496c0e6cdd6..9715ef50e62 100644
> --- a/gcc/omp-expand.c
> +++ b/gcc/omp-expand.c
> @@ -59,6 +59,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "stringpool.h"
>   #include "attribs.h"
>   #include "tree-eh.h"
> +#include "opts.h"
>
>   /* OMP region information.  Every parallel and workshare
>      directive is enclosed between two markers, the OMP_* directive
> @@ -6960,7 +6961,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
>         /* If not -fno-tree-loop-vectorize, hint that we want to vectorize
>          the loop.  */
>         if ((flag_tree_loop_vectorize
> -          || !global_options_set.x_flag_tree_loop_vectorize)
> +          || !OPTION_SET_P (flag_tree_loop_vectorize))
>           && flag_tree_loop_optimize
>           && loop->safelen > 1)
>         {
> diff --git a/gcc/omp-general.c b/gcc/omp-general.c
> index 1e4c0b25531..3e5ca94c2a7 100644
> --- a/gcc/omp-general.c
> +++ b/gcc/omp-general.c
> @@ -44,6 +44,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "tree-iterator.h"
>   #include "data-streamer.h"
>   #include "streamer-hooks.h"
> +#include "opts.h"
>
>   enum omp_requires omp_requires_mask;
>
> @@ -952,7 +953,7 @@ omp_max_vf (void)
>         || optimize_debug
>         || !flag_tree_loop_optimize
>         || (!flag_tree_loop_vectorize
> -         && global_options_set.x_flag_tree_loop_vectorize))
> +         && OPTION_SET_P (flag_tree_loop_vectorize)))
>       return 1;
>
>     auto_vector_modes modes;
> diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c
> index d881426ae65..833f7ddea58 100644
> --- a/gcc/omp-offload.c
> +++ b/gcc/omp-offload.c
> @@ -54,6 +54,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "cfgloop.h"
>   #include "context.h"
>   #include "convert.h"
> +#include "opts.h"
>
>   /* Describe the OpenACC looping structure of a function.  The entire
>      function is held in a 'NULL' loop.  */
> @@ -633,7 +634,7 @@ oacc_xform_loop (gcall *call)
>           /* If not -fno-tree-loop-vectorize, hint that we want to vectorize
>              the loop.  */
>           && (flag_tree_loop_vectorize
> -             || !global_options_set.x_flag_tree_loop_vectorize))
> +             || !OPTION_SET_P (flag_tree_loop_vectorize)))
>         {
>           basic_block bb = gsi_bb (gsi);
>           class loop *parent = bb->loop_father;
> diff --git a/gcc/opts.h b/gcc/opts.h
> index bafc790112b..f5bc9a3149c 100644
> --- a/gcc/opts.h
> +++ b/gcc/opts.h
> @@ -500,4 +500,8 @@ extern char *gen_producer_string (const char *language_string,
>     } \
>     while (false)
>
> +/* Return true if OPTION is set by user in global options.  */
> +
> +#define OPTION_SET_P(OPTION) global_options_set.x_ ## OPTION
> +
>   #endif
> diff --git a/gcc/targhooks.c b/gcc/targhooks.c
> index c9b5208853d..cbbcedf790f 100644
> --- a/gcc/targhooks.c
> +++ b/gcc/targhooks.c
> @@ -2453,12 +2453,12 @@ default_max_noce_ifcvt_seq_cost (edge e)
>
>     if (predictable_p)
>       {
> -      if (global_options_set.x_param_max_rtl_if_conversion_predictable_cost)
> +      if (OPTION_SET_P (param_max_rtl_if_conversion_predictable_cost))
>         return param_max_rtl_if_conversion_predictable_cost;
>       }
>     else
>       {
> -      if (global_options_set.x_param_max_rtl_if_conversion_unpredictable_cost)
> +      if (OPTION_SET_P (param_max_rtl_if_conversion_unpredictable_cost))
>         return param_max_rtl_if_conversion_unpredictable_cost;
>       }
>
> diff --git a/gcc/toplev.c b/gcc/toplev.c
> index ecb2b694970..e4b381e159b 100644
> --- a/gcc/toplev.c
> +++ b/gcc/toplev.c
> @@ -1751,7 +1751,7 @@ process_options (bool no_backend)
>
>     /* Enable -Werror=coverage-mismatch when -Werror and -Wno-error
>        have not been set.  */
> -  if (!global_options_set.x_warnings_are_errors)
> +  if (!OPTION_SET_P (warnings_are_errors))
>       {
>         if (warn_coverage_mismatch
>           && (global_dc->classify_diagnostic[OPT_Wcoverage_mismatch] ==
> diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
> index 6b195d1914f..ce1f08f7d22 100644
> --- a/gcc/tree-predcom.c
> +++ b/gcc/tree-predcom.c
> @@ -233,6 +233,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "tree-scalar-evolution.h"
>   #include "tree-affine.h"
>   #include "builtins.h"
> +#include "opts.h"
>
>   /* The maximum number of iterations between the considered memory
>      references.  */
> @@ -3492,7 +3493,7 @@ public:
>          only if predictive commoning isn't set explicitly, and it
>          doesn't allow unrolling.  */
>       if (flag_tree_loop_vectorize
> -       && !global_options_set.x_flag_predictive_commoning)
> +       && !OPTION_SET_P (flag_predictive_commoning))
>         return true;
>
>       return false;
> diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
> index 0363c5efb78..9b786e29e4e 100644
> --- a/gcc/tree-sra.c
> +++ b/gcc/tree-sra.c
> @@ -99,7 +99,7 @@ along with GCC; see the file COPYING3.  If not see
>   #include "dbgcnt.h"
>   #include "builtins.h"
>   #include "tree-sra.h"
> -
> +#include "opts.h"
>
>   /* Enumeration of all aggregate reductions we can do.  */
>   enum sra_mode { SRA_MODE_EARLY_IPA,   /* early call regularization */
> @@ -3427,12 +3427,12 @@ analyze_all_variable_accesses (void)
>
>     if (optimize_speed_p)
>       {
> -      if (global_options_set.x_param_sra_max_scalarization_size_speed)
> +      if (OPTION_SET_P (param_sra_max_scalarization_size_speed))
>         max_scalarization_size = param_sra_max_scalarization_size_speed;
>       }
>     else
>       {
> -      if (global_options_set.x_param_sra_max_scalarization_size_size)
> +      if (OPTION_SET_P (param_sra_max_scalarization_size_size))
>         max_scalarization_size = param_sra_max_scalarization_size_size;
>       }
>     max_scalarization_size *= BITS_PER_UNIT;
> --
> 2.33.0
>
  

Patch

diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 96199bd4b63..d0735708670 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -271,7 +271,7 @@  gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
    warn_stringop_overflow = 0;
  
    /* No caret by default for Ada.  */
-  if (!global_options_set.x_flag_diagnostics_show_caret)
+  if (!OPTION_SET_P (flag_diagnostics_show_caret))
      global_dc->show_caret = false;
  
    /* Warn only if STABS is not the default: we don't want to emit a warning if
@@ -422,12 +422,12 @@  gnat_init_gcc_eh (void)
    flag_delete_dead_exceptions = 1;
    if (Suppress_Checks)
      {
-      if (!global_options_set.x_flag_non_call_exceptions)
+      if (!OPTION_SET_P (flag_non_call_exceptions))
  	flag_non_call_exceptions = Machine_Overflows_On_Target && GNAT_Mode;
      }
    else
      {
-      if (!global_options_set.x_flag_non_call_exceptions)
+      if (!OPTION_SET_P (flag_non_call_exceptions))
          flag_non_call_exceptions = 1;
        flag_aggressive_loop_optimizations = 0;
        warn_aggressive_loop_optimizations = 0;
@@ -445,14 +445,14 @@  gnat_init_gcc_fp (void)
       S'Signed_Zeros is true, but don't override the user if not.  */
    if (Signed_Zeros_On_Target)
      flag_signed_zeros = 1;
-  else if (!global_options_set.x_flag_signed_zeros)
+  else if (!OPTION_SET_P (flag_signed_zeros))
      flag_signed_zeros = 0;
  
    /* Assume that FP operations can trap if S'Machine_Overflow is true,
       but don't override the user if not.  */
    if (Machine_Overflows_On_Target)
      flag_trapping_math = 1;
-  else if (!global_options_set.x_flag_trapping_math)
+  else if (!OPTION_SET_P (flag_trapping_math))
      flag_trapping_math = 0;
  }
  
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 3eaab5e1530..0225cba7a4b 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -831,7 +831,7 @@  c_common_post_options (const char **pfilename)
       for -ffp-contract=off).  */
    if (flag_iso
        && !c_dialect_cxx ()
-      && (global_options_set.x_flag_fp_contract_mode
+      && (OPTION_SET_P (flag_fp_contract_mode)
  	  == (enum fp_contract_mode) 0)
        && flag_unsafe_math_optimizations == 0)
      flag_fp_contract_mode = FP_CONTRACT_OFF;
@@ -842,7 +842,7 @@  c_common_post_options (const char **pfilename)
       the set specified in ISO C99/C11.  */
    if (!flag_iso
        && !c_dialect_cxx ()
-      && (global_options_set.x_flag_permitted_flt_eval_methods
+      && (OPTION_SET_P (flag_permitted_flt_eval_methods)
  	  == PERMITTED_FLT_EVAL_METHODS_DEFAULT))
      flag_permitted_flt_eval_methods = PERMITTED_FLT_EVAL_METHODS_TS_18661;
    else
@@ -1040,7 +1040,7 @@  c_common_post_options (const char **pfilename)
  
        /* Unless -f{,no-}ext-numeric-literals has been used explicitly,
  	 for -std=c++{11,14,17,20,23} default to -fno-ext-numeric-literals.  */
-      if (flag_iso && !global_options_set.x_flag_ext_numeric_literals)
+      if (flag_iso && !OPTION_SET_P (flag_ext_numeric_literals))
  	cpp_opts->ext_numeric_literals = 0;
      }
    else if (warn_narrowing == -1)
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index c702e683c31..fced7ceefe2 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -575,7 +575,7 @@  alpha_option_override (void)
    }
  
    /* Default the definition of "small data" to 8 bytes.  */
-  if (!global_options_set.x_g_switch_value)
+  if (!OPTION_SET_P (g_switch_value))
      g_switch_value = 8;
  
    /* Infer TARGET_SMALL_DATA from -fpic/-fPIC.  */
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 92797db96b7..8244f37bf03 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -1441,7 +1441,7 @@  arc_override_options (void)
      target_flags |= MASK_NO_SDATA_SET;
  
    /* Check for small data option */
-  if (!global_options_set.x_g_switch_value && !TARGET_NO_SDATA_SET)
+  if (!OPTION_SET_P (g_switch_value) && !TARGET_NO_SDATA_SET)
      g_switch_value = TARGET_LL64 ? 8 : 4;
  
    /* A7 has an issue with delay slots.  */
@@ -1455,7 +1455,7 @@  arc_override_options (void)
      target_flags &= ~MASK_MILLICODE_THUNK_SET;
  
    /* Set unaligned to all HS cpus.  */
-  if (!global_options_set.x_unaligned_access && TARGET_HS)
+  if (!OPTION_SET_P (unaligned_access) && TARGET_HS)
      unaligned_access = 1;
  
    /* These need to be done at start up.  It's convenient to do them here.  */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 6c6e77fab66..471128fc86a 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -71,6 +71,7 @@ 
  #include "gimple.h"
  #include "selftest.h"
  #include "tree-vectorizer.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -3468,7 +3469,7 @@  arm_option_override (void)
  
    arm_active_target.isa = sbitmap_alloc (isa_num_bits);
  
-  if (!global_options_set.x_arm_fpu_index)
+  if (!OPTION_SET_P (arm_fpu_index))
      {
        bool ok;
        int fpu_index;
@@ -3528,7 +3529,7 @@  arm_option_override (void)
      flag_schedule_insns = flag_schedule_insns_after_reload = 0;
  
    /* Override the default structure alignment for AAPCS ABI.  */
-  if (!global_options_set.x_arm_structure_size_boundary)
+  if (!OPTION_SET_P (arm_structure_size_boundary))
      {
        if (TARGET_AAPCS_BASED)
  	arm_structure_size_boundary = 8;
@@ -3553,12 +3554,12 @@  arm_option_override (void)
  
    if (TARGET_VXWORKS_RTP)
      {
-      if (!global_options_set.x_arm_pic_data_is_text_relative)
+      if (!OPTION_SET_P (arm_pic_data_is_text_relative))
  	arm_pic_data_is_text_relative = 0;
      }
    else if (flag_pic
  	   && !arm_pic_data_is_text_relative
-	   && !(global_options_set.x_target_flags & MASK_SINGLE_PIC_BASE))
+	   && !(OPTION_SET_P (target_flags) & MASK_SINGLE_PIC_BASE))
      /* When text & data segments don't have a fixed displacement, the
         intended use is with a single, read only, pic base register.
         Unless the user explicitly requested not to do that, set
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 698dd879934..3287e495dd3 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -53,6 +53,7 @@ 
  #include "hw-doloop.h"
  #include "dumpfile.h"
  #include "builtins.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -1046,7 +1047,7 @@  bfin_load_pic_reg (rtx dest)
    if (local_info_node && local_info_node->local)
      return pic_offset_table_rtx;
        
-  if (global_options_set.x_bfin_library_id)
+  if (OPTION_SET_P (bfin_library_id))
      addr = plus_constant (Pmode, pic_offset_table_rtx,
  			   -4 - bfin_library_id * 4);
    else
@@ -2369,7 +2370,7 @@  bfin_option_override (void)
  #endif
  
    /* Library identification */
-  if (global_options_set.x_bfin_library_id && ! TARGET_ID_SHARED_LIBRARY)
+  if (OPTION_SET_P (bfin_library_id) && ! TARGET_ID_SHARED_LIBRARY)
      error ("%<-mshared-library-id=%> specified without "
  	   "%<-mid-shared-library%>");
  
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index ce4949516cf..4854371ee13 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -60,6 +60,7 @@ 
  #include "dumpfile.h"
  #include "builtins.h"
  #include "flags.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -221,7 +222,7 @@  c6x_option_override (void)
  {
    unsigned i;
  
-  if (global_options_set.x_c6x_arch_option)
+  if (OPTION_SET_P (c6x_arch_option))
      {
        c6x_arch = all_isas[c6x_arch_option].type;
        c6x_insn_mask &= ~C6X_INSNS_ALL_CPU_BITS;
diff --git a/gcc/config/csky/csky.c b/gcc/config/csky/csky.c
index e55821fe2ee..487288b3292 100644
--- a/gcc/config/csky/csky.c
+++ b/gcc/config/csky/csky.c
@@ -67,6 +67,7 @@ 
  #include "pass_manager.h"
  #include "tree-pass.h"
  #include "context.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -2757,15 +2758,15 @@  csky_option_override (void)
  #ifdef ENABLE_TPF_DEBUG
    /* Don't emit DWARF4 unless specifically selected.  The TPF
       debuggers do not yet support DWARF 3/4.  */
-  if (!global_options_set.x_dwarf_strict)
+  if (!OPTION_SET_P (dwarf_strict))
      dwarf_strict = 1;
-  if (!global_options_set.x_dwarf_version)
+  if (!OPTION_SET_P (dwarf_version))
      dwarf_version = 3;
  #endif
  
    /* Don't run the scheduler before reload by default,
       since it tends to increase register pressure.  */
-  if (!global_options_set.x_flag_schedule_insns)
+  if (!OPTION_SET_P (flag_schedule_insns))
      flag_schedule_insns = 0;
  
    csky_add_gc_roots ();
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 781742fe46f..28dc55d9b1c 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -48,6 +48,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "intl.h"
  #include "optabs.h"
  #include "flags.h"
+#include "opts.h"
  
  /* Fix and Continue.
  
@@ -3282,7 +3283,7 @@  darwin_override_options (void)
      }
  
    /* Unless set, force ABI=2 for NeXT and m64, 0 otherwise.  */
-  if (!global_options_set.x_flag_objc_abi)
+  if (!OPTION_SET_P (flag_objc_abi))
      global_options.x_flag_objc_abi
  	= (!flag_next_runtime)
  		? 0
@@ -3290,7 +3291,7 @@  darwin_override_options (void)
  				: (generating_for_darwin_version >= 9) ? 1
  								       : 0);
  
-  if (global_options_set.x_flag_objc_abi && flag_next_runtime)
+  if (OPTION_SET_P (flag_objc_abi) && flag_next_runtime)
      {
        if (TARGET_64BIT && global_options.x_flag_objc_abi != 2)
  	/* The Objective-C family ABI 2 is the only valid version NeXT/m64.  */
@@ -3307,23 +3308,23 @@  darwin_override_options (void)
  
    /* Don't emit DWARF3/4 unless specifically selected.  This is a
       workaround for tool bugs.  */
-  if (!global_options_set.x_dwarf_strict)
+  if (!OPTION_SET_P (dwarf_strict))
      dwarf_strict = 1;
-  if (!global_options_set.x_dwarf_version)
+  if (!OPTION_SET_P (dwarf_version))
      dwarf_version = 2;
  
-  if (global_options_set.x_dwarf_split_debug_info)
+  if (OPTION_SET_P (dwarf_split_debug_info))
      {
        inform (input_location,
  	      "%<-gsplit-dwarf%> is not supported on this platform, ignored");
        dwarf_split_debug_info = 0;
-      global_options_set.x_dwarf_split_debug_info = 0;
+      OPTION_SET_P (dwarf_split_debug_info) = 0;
      }
  
    /* Do not allow unwind tables to be generated by default for m32.
       fnon-call-exceptions will override this, regardless of what we do.  */
    if (generating_for_darwin_version < 10
-      && !global_options_set.x_flag_asynchronous_unwind_tables
+      && !OPTION_SET_P (flag_asynchronous_unwind_tables)
        && !TARGET_64BIT)
      global_options.x_flag_asynchronous_unwind_tables = 0;
  
@@ -3334,15 +3335,15 @@  darwin_override_options (void)
        will be generated".  If the User specifically sets flags... we assume
        (s)he knows why...  */
     if (generating_for_darwin_version < 9
-       && global_options_set.x_flag_reorder_blocks_and_partition
+       && OPTION_SET_P (flag_reorder_blocks_and_partition)
         && ((global_options.x_flag_exceptions 		/* User, c++, java */
-	    && !global_options_set.x_flag_exceptions) 	/* User specified... */
+	    && !OPTION_SET_P (flag_exceptions)) 	/* User specified... */
  	   || (global_options.x_flag_unwind_tables
-	       && !global_options_set.x_flag_unwind_tables)
+	       && !OPTION_SET_P (flag_unwind_tables))
  	   || (global_options.x_flag_non_call_exceptions
-	       && !global_options_set.x_flag_non_call_exceptions)
+	       && !OPTION_SET_P (flag_non_call_exceptions))
  	   || (global_options.x_flag_asynchronous_unwind_tables
-	       && !global_options_set.x_flag_asynchronous_unwind_tables)))
+	       && !OPTION_SET_P (flag_asynchronous_unwind_tables))))
      {
        inform (input_location,
  	      "%<-freorder-blocks-and-partition%> does not work with "
@@ -3353,12 +3354,12 @@  darwin_override_options (void)
  
      /* FIXME: flag_objc_sjlj_exceptions is no longer needed since there is only
         one valid choice of exception scheme for each runtime.  */
-    if (!global_options_set.x_flag_objc_sjlj_exceptions)
+    if (!OPTION_SET_P (flag_objc_sjlj_exceptions))
        global_options.x_flag_objc_sjlj_exceptions =
  				flag_next_runtime && !TARGET_64BIT;
  
      /* FIXME: and this could be eliminated then too.  */
-    if (!global_options_set.x_flag_exceptions
+    if (!OPTION_SET_P (flag_exceptions)
  	&& flag_objc_exceptions
  	&& TARGET_64BIT)
        flag_exceptions = 1;
@@ -3414,7 +3415,7 @@  darwin_override_options (void)
       Linkers that don't need stubs, don't need the EH symbol markers either.
    */
  
-  if (!global_options_set.x_darwin_symbol_stubs)
+  if (!OPTION_SET_P (darwin_symbol_stubs))
      {
        if (darwin_target_linker)
  	{
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index a7f7f086d17..02cd07c09bc 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -50,6 +50,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "ifcvt.h"
  #include "rtl-iter.h"
  #include "calls.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -664,7 +665,7 @@  frv_option_override (void)
        if (!flag_pic)		/* -fPIC */
  	flag_pic = 2;
  
-      if (!global_options_set.x_g_switch_value)	/* -G0 */
+      if (!OPTION_SET_P (g_switch_value))	/* -G0 */
  	{
  	  g_switch_value = 0;
  	}
@@ -757,7 +758,7 @@  frv_option_override (void)
      }
  
    /* Check for small data option */
-  if (!global_options_set.x_g_switch_value && !TARGET_LIBPIC)
+  if (!OPTION_SET_P (g_switch_value) && !TARGET_LIBPIC)
      g_switch_value = SDATA_DEFAULT_SIZE;
  
    /* There is no single unaligned SI op for PIC code.  Sometimes we
diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h
index 9decff7e56c..f1afad91c99 100644
--- a/gcc/config/i386/djgpp.h
+++ b/gcc/config/i386/djgpp.h
@@ -147,7 +147,7 @@  along with GCC; see the file COPYING3.  If not see
                                                                          \
          /* Don't emit DWARF3/4 unless specifically selected. */         \
          /* DWARF3/4 currently does not work for DJGPP.  */              \
-        if (!global_options_set.x_dwarf_version)                        \
+        if (!OPTION_SET_P (dwarf_version))                        \
              dwarf_version = 2;                                          \
                                                                          \
          }                                                               \
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a566d84a61e..24c4b50d3db 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -22280,7 +22280,7 @@  ix86_stack_protect_guard (void)
        tree type = build_qualified_type (type_node, qual);
        tree t;
  
-      if (global_options_set.x_ix86_stack_protector_guard_symbol_str)
+      if (OPTION_SET_P (ix86_stack_protector_guard_symbol_str))
  	{
  	  t = ix86_tls_stack_chk_guard_decl;
  
@@ -22794,12 +22794,12 @@  ix86_max_noce_ifcvt_seq_cost (edge e)
    bool predictable_p = predictable_edge_p (e);
    if (predictable_p)
      {
-      if (global_options_set.x_param_max_rtl_if_conversion_predictable_cost)
+      if (OPTION_SET_P (param_max_rtl_if_conversion_predictable_cost))
  	return param_max_rtl_if_conversion_predictable_cost;
      }
    else
      {
-      if (global_options_set.x_param_max_rtl_if_conversion_unpredictable_cost)
+      if (OPTION_SET_P (param_max_rtl_if_conversion_unpredictable_cost))
  	return param_max_rtl_if_conversion_unpredictable_cost;
      }
  
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 632b9df1761..39a0e0791b7 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -6098,7 +6098,7 @@  ia64_option_override (void)
      flag_ira_loop_pressure = 1;
  
  
-  ia64_section_threshold = (global_options_set.x_g_switch_value
+  ia64_section_threshold = (OPTION_SET_P (g_switch_value)
  			    ? g_switch_value
  			    : IA64_DEFAULT_GVALUE);
  
@@ -6120,8 +6120,8 @@  static void
  ia64_override_options_after_change (void)
  {
    if (optimize >= 3
-      && !global_options_set.x_flag_selective_scheduling
-      && !global_options_set.x_flag_selective_scheduling2)
+      && !OPTION_SET_P (flag_selective_scheduling)
+      && !OPTION_SET_P (flag_selective_scheduling2))
      {
        flag_selective_scheduling2 = 1;
        flag_sel_sched_pipelining = 1;
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index d22bdd79c71..f99e2b0a485 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -48,6 +48,7 @@ 
  #include "expr.h"
  #include "tm-constrs.h"
  #include "builtins.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -412,7 +413,7 @@  static void
  m32c_option_override (void)
  {
    /* We limit memregs to 0..16, and provide a default.  */
-  if (global_options_set.x_target_memregs)
+  if (OPTION_SET_P (target_memregs))
      {
        if (target_memregs < 0 || target_memregs > 16)
  	error ("invalid target memregs value %<%d%>", target_memregs);
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 1aaba94bb5c..d644f6bda73 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -45,6 +45,7 @@ 
  #include "expr.h"
  #include "tm-constrs.h"
  #include "builtins.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -244,7 +245,7 @@  m32r_init (void)
    m32r_punct_chars['@'] = 1; /* ??? no longer used */
  
    /* Provide default value if not specified.  */
-  if (!global_options_set.x_g_switch_value)
+  if (!OPTION_SET_P (g_switch_value))
      g_switch_value = SDATA_DEFAULT_SIZE;
  }
  
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 0248eb719a8..d1105e7a137 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -500,13 +500,13 @@  m68k_option_override (void)
    const struct m68k_target_selection *entry;
    unsigned long target_mask;
  
-  if (global_options_set.x_m68k_arch_option)
+  if (OPTION_SET_P (m68k_arch_option))
      m68k_arch_entry = &all_isas[m68k_arch_option];
  
-  if (global_options_set.x_m68k_cpu_option)
+  if (OPTION_SET_P (m68k_cpu_option))
      m68k_cpu_entry = &all_devices[(int) m68k_cpu_option];
  
-  if (global_options_set.x_m68k_tune_option)
+  if (OPTION_SET_P (m68k_tune_option))
      m68k_tune_entry = &all_microarchs[(int) m68k_tune_option];
  
    /* User can choose:
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index 6e8f367c80a..4813f7a7921 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -51,6 +51,7 @@ 
  #include "cfgloop.h"
  #include "insn-addr.h"
  #include "cfgrtl.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -1741,7 +1742,7 @@  microblaze_option_override (void)
    machine_mode mode;
    int ver;
  
-  microblaze_section_threshold = (global_options_set.x_g_switch_value
+  microblaze_section_threshold = (OPTION_SET_P (g_switch_value)
  				  ? g_switch_value
  				  : MICROBLAZE_DEFAULT_GVALUE);
  
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ade5d7041f0..807bf1a78d4 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -66,6 +66,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "builtins.h"
  #include "rtl-iter.h"
  #include "flags.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -19883,7 +19884,7 @@  mips_option_override (void)
  {
    int i, start, regno, mode;
  
-  if (global_options_set.x_mips_isa_option)
+  if (OPTION_SET_P (mips_isa_option))
      mips_isa_option_info = &mips_cpu_info_table[mips_isa_option];
  
  #ifdef SUBTARGET_OVERRIDE_OPTIONS
@@ -19915,7 +19916,7 @@  mips_option_override (void)
      TARGET_INTERLINK_COMPRESSED = 1;
  
    /* Set the small data limit.  */
-  mips_small_data_threshold = (global_options_set.x_g_switch_value
+  mips_small_data_threshold = (OPTION_SET_P (g_switch_value)
  			       ? g_switch_value
  			       : MIPS_DEFAULT_GVALUE);
  
@@ -19923,7 +19924,7 @@  mips_option_override (void)
       Similar code was added to GAS 2.14 (see tc-mips.c:md_after_parse_args()).
       The GAS and GCC code should be kept in sync as much as possible.  */
  
-  if (global_options_set.x_mips_arch_option)
+  if (OPTION_SET_P (mips_arch_option))
      mips_set_architecture (mips_cpu_info_from_opt (mips_arch_option));
  
    if (mips_isa_option_info != 0)
@@ -19945,7 +19946,7 @@  mips_option_override (void)
  	   mips_arch_info->name);
  
    /* Optimize for mips_arch, unless -mtune selects a different processor.  */
-  if (global_options_set.x_mips_tune_option)
+  if (OPTION_SET_P (mips_tune_option))
      mips_set_tune (mips_cpu_info_from_opt (mips_tune_option));
  
    if (mips_tune_info == 0)
diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index 26d43331f33..7a613e4c13e 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -52,6 +52,7 @@ 
  #include "builtins.h"
  #include "tree-pass.h"
  #include "xregex.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -1363,7 +1364,7 @@  nios2_option_override (void)
    init_machine_status = &nios2_init_machine_status;
  
    nios2_section_threshold
-    = (global_options_set.x_g_switch_value
+    = (OPTION_SET_P (g_switch_value)
         ? g_switch_value : NIOS2_DEFAULT_GVALUE);
  
    if (nios2_gpopt_option == gpopt_unspecified)
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 4e4909e8c5f..951252e598a 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -215,7 +215,7 @@  nvptx_option_override (void)
    /* Set toplevel_reorder, unless explicitly disabled.  We need
       reordering so that we emit necessary assembler decls of
       undeclared variables. */
-  if (!global_options_set.x_flag_toplevel_reorder)
+  if (!OPTION_SET_P (flag_toplevel_reorder))
      flag_toplevel_reorder = 1;
  
    debug_nonbind_markers_p = 0;
@@ -223,7 +223,7 @@  nvptx_option_override (void)
    /* Set flag_no_common, unless explicitly disabled.  We fake common
       using .weak, and that's not entirely accurate, so avoid it
       unless forced.  */
-  if (!global_options_set.x_flag_no_common)
+  if (!OPTION_SET_P (flag_no_common))
      flag_no_common = 1;
  
    /* The patch area requires nops, which we don't have.  */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 69ba5bd035c..d13021ad94a 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -545,9 +545,9 @@  pa_option_override (void)
      {
        /* DWARF5 is not supported by gdb.  Don't emit DWARF5 unless
  	 specifically selected.  */
-      if (!global_options_set.x_dwarf_strict)
+      if (!OPTION_SET_P (dwarf_strict))
  	dwarf_strict = 1;
-      if (!global_options_set.x_dwarf_version)
+      if (!OPTION_SET_P (dwarf_version))
  	dwarf_version = 4;
      }
  
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
index 576960bb37c..126572c6243 100644
--- a/gcc/config/riscv/riscv.c
+++ b/gcc/config/riscv/riscv.c
@@ -56,6 +56,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "builtins.h"
  #include "predict.h"
  #include "tree-pass.h"
+#include "opts.h"
  
  /* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF.  */
  #define UNSPEC_ADDRESS_P(X)					\
@@ -4839,7 +4840,7 @@  riscv_option_override (void)
  #endif
  
    if (riscv_stack_protector_guard == SSP_GLOBAL
-      && global_options_set.x_riscv_stack_protector_guard_offset_str)
+      && OPTION_SET_P (riscv_stack_protector_guard_offset_str))
      {
        error ("incompatible options %<-mstack-protector-guard=global%> and "
  	     "%<-mstack-protector-guard-offset=%s%>",
@@ -4847,15 +4848,15 @@  riscv_option_override (void)
      }
  
    if (riscv_stack_protector_guard == SSP_TLS
-      && !(global_options_set.x_riscv_stack_protector_guard_offset_str
-	   && global_options_set.x_riscv_stack_protector_guard_reg_str))
+      && !(OPTION_SET_P (riscv_stack_protector_guard_offset_str)
+	   && OPTION_SET_P (riscv_stack_protector_guard_reg_str)))
      {
        error ("both %<-mstack-protector-guard-offset%> and "
  	     "%<-mstack-protector-guard-reg%> must be used "
  	     "with %<-mstack-protector-guard=sysreg%>");
      }
  
-  if (global_options_set.x_riscv_stack_protector_guard_reg_str)
+  if (OPTION_SET_P (riscv_stack_protector_guard_reg_str))
      {
        const char *str = riscv_stack_protector_guard_reg_str;
        int reg = decode_reg_name (str);
@@ -4867,7 +4868,7 @@  riscv_option_override (void)
        riscv_stack_protector_guard_reg = reg;
      }
  
-  if (global_options_set.x_riscv_stack_protector_guard_offset_str)
+  if (OPTION_SET_P (riscv_stack_protector_guard_offset_str))
      {
        char *end;
        const char *str = riscv_stack_protector_guard_offset_str;
diff --git a/gcc/config/rs6000/aix71.h b/gcc/config/rs6000/aix71.h
index 1bc1560c496..ddd204dd862 100644
--- a/gcc/config/rs6000/aix71.h
+++ b/gcc/config/rs6000/aix71.h
@@ -33,7 +33,7 @@  do {									\
    if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)			\
      {									\
        rs6000_long_double_type_size = 64;				\
-      if (global_options_set.x_rs6000_long_double_type_size)		\
+      if (OPTION_SET_P (rs6000_long_double_type_size))		\
  	warning (0, "soft-float and long-double-128 are incompatible");	\
      }									\
    if (TARGET_POWERPC64 && ! TARGET_64BIT)				\
@@ -43,7 +43,7 @@  do {									\
    if ((rs6000_isa_flags_explicit					\
         & OPTION_MASK_MINIMAL_TOC) != 0)					\
      {									\
-      if (global_options_set.x_rs6000_current_cmodel			\
+      if (OPTION_SET_P (rs6000_current_cmodel)			\
  	  && rs6000_current_cmodel != CMODEL_SMALL)			\
  	error ("%<-mcmodel%> incompatible with other toc options"); 	\
        SET_CMODEL (CMODEL_SMALL);					\
@@ -63,7 +63,7 @@  do {									\
        /* aix/ppc doesn't support -mvsx and -maltivec with Go */		\
        rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);	\
      }									\
-  if (!global_options_set.x_dwarf_version)				\
+  if (!OPTION_SET_P (dwarf_version))				\
      /* AIX only supports DWARF 4.  */					\
      dwarf_version = 4;							\
  } while (0)
diff --git a/gcc/config/rs6000/aix72.h b/gcc/config/rs6000/aix72.h
index cca64f14f3a..f0e375cb984 100644
--- a/gcc/config/rs6000/aix72.h
+++ b/gcc/config/rs6000/aix72.h
@@ -33,7 +33,7 @@  do {									\
    if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)			\
      {									\
        rs6000_long_double_type_size = 64;				\
-      if (global_options_set.x_rs6000_long_double_type_size)		\
+      if (OPTION_SET_P (rs6000_long_double_type_size))		\
  	warning (0, "soft-float and long-double-128 are incompatible");	\
      }									\
    if (TARGET_POWERPC64 && ! TARGET_64BIT)				\
@@ -43,7 +43,7 @@  do {									\
    if ((rs6000_isa_flags_explicit					\
         & OPTION_MASK_MINIMAL_TOC) != 0)					\
      {									\
-      if (global_options_set.x_rs6000_current_cmodel			\
+      if (OPTION_SET_P (rs6000_current_cmodel)			\
  	  && rs6000_current_cmodel != CMODEL_SMALL)			\
  	error ("%<-mcmodel%> incompatible with other toc options"); 	\
        SET_CMODEL (CMODEL_SMALL);					\
@@ -63,7 +63,7 @@  do {									\
        /* aix/ppc doesn't support -mvsx and -maltivec with Go */		\
        rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);	\
      }									\
-  if (!global_options_set.x_dwarf_version)				\
+  if (!OPTION_SET_P (dwarf_version))				\
      /* AIX only supports DWARF 4.  */					\
      dwarf_version = 4;							\
  } while (0)
diff --git a/gcc/config/rs6000/aix73.h b/gcc/config/rs6000/aix73.h
index f0ca1a55e5d..2c92cc3db0d 100644
--- a/gcc/config/rs6000/aix73.h
+++ b/gcc/config/rs6000/aix73.h
@@ -33,7 +33,7 @@  do {									\
    if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)			\
      {									\
        rs6000_long_double_type_size = 64;				\
-      if (global_options_set.x_rs6000_long_double_type_size)		\
+      if (OPTION_SET_P (rs6000_long_double_type_size))		\
  	warning (0, "soft-float and long-double-128 are incompatible");	\
      }									\
    if (TARGET_POWERPC64 && ! TARGET_64BIT)				\
@@ -43,7 +43,7 @@  do {									\
    if ((rs6000_isa_flags_explicit					\
         & OPTION_MASK_MINIMAL_TOC) != 0)					\
      {									\
-      if (global_options_set.x_rs6000_current_cmodel			\
+      if (OPTION_SET_P (rs6000_current_cmodel)			\
  	  && rs6000_current_cmodel != CMODEL_SMALL)			\
  	error ("%<-mcmodel%> incompatible with other toc options"); 	\
        SET_CMODEL (CMODEL_SMALL);					\
@@ -63,7 +63,7 @@  do {									\
        /* aix/ppc doesn't support -mvsx and -maltivec with Go */		\
        rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);	\
      }									\
-  if (!global_options_set.x_dwarf_version)				\
+  if (!OPTION_SET_P (dwarf_version))				\
      /* AIX only supports DWARF 4.  */					\
      dwarf_version = 4;							\
  } while (0)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ad860728169..acba4d9f26c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -3392,7 +3392,7 @@  darwin_rs6000_override_options (void)
        && !flag_apple_kext
        && strverscmp (darwin_macosx_version_min, "10.5") >= 0
        && ! (rs6000_isa_flags_explicit & OPTION_MASK_ALTIVEC)
-      && ! global_options_set.x_rs6000_cpu_index)
+      && ! OPTION_SET_P (rs6000_cpu_index))
      {
        rs6000_isa_flags |= OPTION_MASK_ALTIVEC;
      }
@@ -3471,18 +3471,18 @@  rs6000_override_options_after_change (void)
  {
    /* Explicit -funroll-loops turns -munroll-only-small-loops off, and
       turns -frename-registers on.  */
-  if ((global_options_set.x_flag_unroll_loops && flag_unroll_loops)
-       || (global_options_set.x_flag_unroll_all_loops
+  if ((OPTION_SET_P (flag_unroll_loops) && flag_unroll_loops)
+       || (OPTION_SET_P (flag_unroll_all_loops)
  	   && flag_unroll_all_loops))
      {
-      if (!global_options_set.x_unroll_only_small_loops)
+      if (!OPTION_SET_P (unroll_only_small_loops))
  	unroll_only_small_loops = 0;
-      if (!global_options_set.x_flag_rename_registers)
+      if (!OPTION_SET_P (flag_rename_registers))
  	flag_rename_registers = 1;
-      if (!global_options_set.x_flag_cunroll_grow_size)
+      if (!OPTION_SET_P (flag_cunroll_grow_size))
  	flag_cunroll_grow_size = 1;
      }
-  else if (!global_options_set.x_flag_cunroll_grow_size)
+  else if (!OPTION_SET_P (flag_cunroll_grow_size))
      flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
  }
  
@@ -3490,7 +3490,7 @@  rs6000_override_options_after_change (void)
  static void
  rs6000_linux64_override_options ()
  {
-  if (!global_options_set.x_rs6000_alignment_flags)
+  if (!OPTION_SET_P (rs6000_alignment_flags))
      rs6000_alignment_flags = MASK_ALIGN_NATURAL;
    if (rs6000_isa_flags & OPTION_MASK_64BIT)
      {
@@ -3526,11 +3526,11 @@  rs6000_linux64_override_options ()
  	  rs6000_isa_flags |= OPTION_MASK_POWERPC64;
  	  error ("%<-m64%> requires a PowerPC64 cpu");
  	}
-      if (!global_options_set.x_rs6000_current_cmodel)
+      if (!OPTION_SET_P (rs6000_current_cmodel))
  	SET_CMODEL (CMODEL_MEDIUM);
        if ((rs6000_isa_flags_explicit & OPTION_MASK_MINIMAL_TOC) != 0)
  	{
-	  if (global_options_set.x_rs6000_current_cmodel
+	  if (OPTION_SET_P (rs6000_current_cmodel)
  	      && rs6000_current_cmodel != CMODEL_SMALL)
  	    error ("%<-mcmodel incompatible with other toc options%>");
  	  if (TARGET_MINIMAL_TOC)
@@ -3545,14 +3545,14 @@  rs6000_linux64_override_options ()
  	}
        if (rs6000_current_cmodel != CMODEL_SMALL)
  	{
-	  if (!global_options_set.x_TARGET_NO_FP_IN_TOC)
+	  if (!OPTION_SET_P (TARGET_NO_FP_IN_TOC))
  	    TARGET_NO_FP_IN_TOC = rs6000_current_cmodel == CMODEL_MEDIUM;
-	  if (!global_options_set.x_TARGET_NO_SUM_IN_TOC)
+	  if (!OPTION_SET_P (TARGET_NO_SUM_IN_TOC))
  	    TARGET_NO_SUM_IN_TOC = 0;
  	}
        if (TARGET_PLTSEQ && DEFAULT_ABI != ABI_ELFv2)
  	{
-	  if (global_options_set.x_rs6000_pltseq)
+	  if (OPTION_SET_P (rs6000_pltseq))
  	    warning (0, "%qs unsupported for this ABI",
  		     "-mpltseq");
  	  rs6000_pltseq = false;
@@ -3567,7 +3567,7 @@  rs6000_linux64_override_options ()
  	  profile_kernel = 0;
  	  error (INVALID_32BIT, "profile-kernel");
  	}
-      if (global_options_set.x_rs6000_current_cmodel)
+      if (OPTION_SET_P (rs6000_current_cmodel))
  	{
  	  SET_CMODEL (CMODEL_SMALL);
  	  error (INVALID_32BIT, "cmodel");
@@ -3627,7 +3627,7 @@  glibc_supports_ieee_128bit (void)
       includes OPTION_TARGET_CPU_DEFAULT, representing the name of the
       default CPU specified at build configure time, TARGET_DEFAULT,
       representing the default set of option flags for the default
-     target, and global_options_set.x_rs6000_isa_flags, representing
+     target, and OPTION_SET_P (rs6000_isa_flags), representing
       which options were requested on the command line.
  
     Upon return from this function:
@@ -3676,13 +3676,13 @@  rs6000_option_override_internal (bool global_init_p)
  
    /* Remember the explicit arguments.  */
    if (global_init_p)
-    rs6000_isa_flags_explicit = global_options_set.x_rs6000_isa_flags;
+    rs6000_isa_flags_explicit = OPTION_SET_P (rs6000_isa_flags);
  
    /* On 64-bit Darwin, power alignment is ABI-incompatible with some C
       library functions, so warn about it. The flag may be useful for
       performance studies from time to time though, so don't disable it
       entirely.  */
-  if (global_options_set.x_rs6000_alignment_flags
+  if (OPTION_SET_P (rs6000_alignment_flags)
        && rs6000_alignment_flags == MASK_ALIGN_POWER
        && DEFAULT_ABI == ABI_DARWIN
        && TARGET_64BIT)
@@ -3695,20 +3695,20 @@  rs6000_option_override_internal (bool global_init_p)
       with enough (>= 32) registers.  It is an expensive optimization.
       So it is on only for peak performance.  */
    if (optimize >= 3 && global_init_p
-      && !global_options_set.x_flag_ira_loop_pressure)
+      && !OPTION_SET_P (flag_ira_loop_pressure))
      flag_ira_loop_pressure = 1;
  
    /* -fsanitize=address needs to turn on -fasynchronous-unwind-tables in order
       for tracebacks to be complete but not if any -fasynchronous-unwind-tables
       options were already specified.  */
    if (flag_sanitize & SANITIZE_USER_ADDRESS
-      && !global_options_set.x_flag_asynchronous_unwind_tables)
+      && !OPTION_SET_P (flag_asynchronous_unwind_tables))
      flag_asynchronous_unwind_tables = 1;
  
    /* -fvariable-expansion-in-unroller is a win for POWER whenever the
       loop unroller is active.  It is only checked during unrolling, so
       we can just set it on by default.  */
-  if (!global_options_set.x_flag_variable_expansion_in_unroller)
+  if (!OPTION_SET_P (flag_variable_expansion_in_unroller))
      flag_variable_expansion_in_unroller = 1;
  
    /* Set the pointer size.  */
@@ -3905,7 +3905,7 @@  rs6000_option_override_internal (bool global_init_p)
  
  #ifdef XCOFF_DEBUGGING_INFO
    /* For AIX default to 64-bit DWARF.  */
-  if (!global_options_set.x_dwarf_offset_size)
+  if (!OPTION_SET_P (dwarf_offset_size))
      dwarf_offset_size = POINTER_SIZE_UNITS;
  #endif
  
@@ -4129,7 +4129,7 @@  rs6000_option_override_internal (bool global_init_p)
    else if (TARGET_ALLOW_MOVMISALIGN && !TARGET_VSX)
      {
        if (TARGET_ALLOW_MOVMISALIGN > 0
-	  && global_options_set.x_TARGET_ALLOW_MOVMISALIGN)
+	  && OPTION_SET_P (TARGET_ALLOW_MOVMISALIGN))
  	error ("%qs requires %qs", "-mallow-movmisalign", "-mvsx");
  
        TARGET_ALLOW_MOVMISALIGN = 0;
@@ -4184,7 +4184,7 @@  rs6000_option_override_internal (bool global_init_p)
  				  : FLOAT_PRECISION_TFmode);
  
    /* Set long double size before the IEEE 128-bit tests.  */
-  if (!global_options_set.x_rs6000_long_double_type_size)
+  if (!OPTION_SET_P (rs6000_long_double_type_size))
      {
        if (main_target_opt != NULL
  	  && (main_target_opt->x_rs6000_long_double_type_size
@@ -4197,7 +4197,7 @@  rs6000_option_override_internal (bool global_init_p)
      ; /* The option value can be seen when cl_target_option_restore is called.  */
    else if (rs6000_long_double_type_size == 128)
      rs6000_long_double_type_size = FLOAT_PRECISION_TFmode;
-  else if (global_options_set.x_rs6000_ieeequad)
+  else if (OPTION_SET_P (rs6000_ieeequad))
      {
        if (global_options.x_rs6000_ieeequad)
  	error ("%qs requires %qs", "-mabi=ieeelongdouble", "-mlong-double-128");
@@ -4210,7 +4210,7 @@  rs6000_option_override_internal (bool global_init_p)
       explicitly redefine TARGET_IEEEQUAD and TARGET_IEEEQUAD_DEFAULT to 0, so
       those systems will not pick up this default.  Warn if the user changes the
       default unless -Wno-psabi.  */
-  if (!global_options_set.x_rs6000_ieeequad)
+  if (!OPTION_SET_P (rs6000_ieeequad))
      rs6000_ieeequad = TARGET_IEEEQUAD_DEFAULT;
  
    else
@@ -4395,7 +4395,7 @@  rs6000_option_override_internal (bool global_init_p)
    /* Enable Altivec ABI for AIX -maltivec.  */
    if (TARGET_XCOFF
        && (TARGET_ALTIVEC || TARGET_VSX)
-      && !global_options_set.x_rs6000_altivec_abi)
+      && !OPTION_SET_P (rs6000_altivec_abi))
      {
        if (main_target_opt != NULL && !main_target_opt->x_rs6000_altivec_abi)
  	error ("target attribute or pragma changes AltiVec ABI");
@@ -4408,7 +4408,7 @@  rs6000_option_override_internal (bool global_init_p)
       be explicitly overridden in either case.  */
    if (TARGET_ELF)
      {
-      if (!global_options_set.x_rs6000_altivec_abi
+      if (!OPTION_SET_P (rs6000_altivec_abi)
  	  && (TARGET_64BIT || TARGET_ALTIVEC || TARGET_VSX))
  	{
  	  if (main_target_opt != NULL &&
@@ -4438,7 +4438,7 @@  rs6000_option_override_internal (bool global_init_p)
    /* Place FP constants in the constant pool instead of TOC
       if section anchors enabled.  */
    if (flag_section_anchors
-      && !global_options_set.x_TARGET_NO_FP_IN_TOC)
+      && !OPTION_SET_P (TARGET_NO_FP_IN_TOC))
      TARGET_NO_FP_IN_TOC = 1;
  
    if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
@@ -4595,7 +4595,7 @@  rs6000_option_override_internal (bool global_init_p)
      }
  
    /* Handle stack protector */
-  if (!global_options_set.x_rs6000_stack_protector_guard)
+  if (!OPTION_SET_P (rs6000_stack_protector_guard))
  #ifdef TARGET_THREAD_SSP_OFFSET
      rs6000_stack_protector_guard = SSP_TLS;
  #else
@@ -4607,7 +4607,7 @@  rs6000_option_override_internal (bool global_init_p)
    rs6000_stack_protector_guard_reg = TARGET_64BIT ? 13 : 2;
  #endif
  
-  if (global_options_set.x_rs6000_stack_protector_guard_offset_str)
+  if (OPTION_SET_P (rs6000_stack_protector_guard_offset_str))
      {
        char *endp;
        const char *str = rs6000_stack_protector_guard_offset_str;
@@ -4626,7 +4626,7 @@  rs6000_option_override_internal (bool global_init_p)
        rs6000_stack_protector_guard_offset = offset;
      }
  
-  if (global_options_set.x_rs6000_stack_protector_guard_reg_str)
+  if (OPTION_SET_P (rs6000_stack_protector_guard_reg_str))
      {
        const char *str = rs6000_stack_protector_guard_reg_str;
        int reg = decode_reg_name (str);
@@ -4654,7 +4654,7 @@  rs6000_option_override_internal (bool global_init_p)
        /* Set aix_struct_return last, after the ABI is determined.
  	 If -maix-struct-return or -msvr4-struct-return was explicitly
  	 used, don't override with the ABI default.  */
-      if (!global_options_set.x_aix_struct_return)
+      if (!OPTION_SET_P (aix_struct_return))
  	aix_struct_return = (DEFAULT_ABI != ABI_V4 || DRAFT_V4_STRUCT_RET);
  
  #if 0
@@ -6272,14 +6272,14 @@  rs6000_file_start (void)
  	  start = "";
  	}
  
-      if (global_options_set.x_rs6000_cpu_index)
+      if (OPTION_SET_P (rs6000_cpu_index))
  	{
  	  fprintf (file, "%s -mcpu=%s", start,
  		   processor_target_table[rs6000_cpu_index].name);
  	  start = "";
  	}
  
-      if (global_options_set.x_rs6000_tune_index)
+      if (OPTION_SET_P (rs6000_tune_index))
  	{
  	  fprintf (file, "%s -mtune=%s", start,
  		   processor_target_table[rs6000_tune_index].name);
@@ -21053,7 +21053,7 @@  rs6000_darwin_file_start (void)
    if (rs6000_default_cpu != 0 && rs6000_default_cpu[0] != '\0')
      cpu_id = rs6000_default_cpu;
  
-  if (global_options_set.x_rs6000_cpu_index)
+  if (OPTION_SET_P (rs6000_cpu_index))
      cpu_id = processor_target_table[rs6000_cpu_index].name;
  
    /* Look through the mapping array.  Pick the first name that either
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index 872cc2849af..6184c5fde45 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -116,14 +116,14 @@ 
  	  if ((rs6000_isa_flags_explicit			\
  		& OPTION_MASK_MINIMAL_TOC) != 0)		\
  	    {							\
-	      if (global_options_set.x_rs6000_current_cmodel	\
+	      if (OPTION_SET_P (rs6000_current_cmodel)	\
  		  && rs6000_current_cmodel != CMODEL_SMALL)	\
  		error ("%<-mcmodel%> incompatible with other toc options"); \
  	      SET_CMODEL (CMODEL_SMALL);			\
  	    }							\
  	  else							\
  	    {							\
-	      if (!global_options_set.x_rs6000_current_cmodel)	\
+	      if (!OPTION_SET_P (rs6000_current_cmodel))	\
  		SET_CMODEL (CMODEL_MEDIUM);			\
  	      if (rs6000_current_cmodel != CMODEL_SMALL)	\
  		{						\
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 23ff59403a3..96ee5524224 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -70,7 +70,7 @@ 
  
  #define SUBTARGET_OVERRIDE_OPTIONS					\
  do {									\
-  if (!global_options_set.x_g_switch_value)				\
+  if (!OPTION_SET_P (g_switch_value))				\
      g_switch_value = SDATA_DEFAULT_SIZE;				\
  									\
    if (rs6000_abi_name == NULL)						\
@@ -197,16 +197,16 @@  do {									\
      }									\
  									\
    if (TARGET_PLTSEQ != rs6000_pltseq					\
-      && global_options_set.x_rs6000_pltseq)				\
+      && OPTION_SET_P (rs6000_pltseq))				\
      {									\
        error ("%qs not supported by your assembler", "-mpltseq");	\
      }									\
  									\
    if (DEFAULT_ABI == ABI_V4 && TARGET_PLTSEQ && !TARGET_SECURE_PLT)	\
      {									\
-      if (global_options_set.x_rs6000_pltseq)				\
+      if (OPTION_SET_P (rs6000_pltseq))				\
  	{								\
-	  if (global_options_set.x_secure_plt)				\
+	  if (OPTION_SET_P (secure_plt))				\
  	    error ("%qs and %qs are incompatible",			\
  		   "-mpltseq", "-mbss-plt");				\
  	  else								\
diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
index d8ecc0296c8..ca21a3a7bd3 100644
--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -155,7 +155,7 @@  along with GCC; see the file COPYING3.  If not see
  #undef SUB3TARGET_OVERRIDE_OPTIONS
  #define SUB3TARGET_OVERRIDE_OPTIONS           \
    do {                                          \
-  if (!global_options_set.x_g_switch_value)     \
+  if (!OPTION_SET_P (g_switch_value))     \
      g_switch_value = SDATA_DEFAULT_SIZE;        \
    VXWORKS_OVERRIDE_OPTIONS;                     \
    } while (0)
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index e04385451cf..4f144d1b0eb 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -15746,9 +15746,9 @@  s390_option_override (void)
      {
        /* Don't emit DWARF3/4 unless specifically selected.  The TPF
  	 debuggers do not yet support DWARF 3/4.  */
-      if (!global_options_set.x_dwarf_strict)
+      if (!OPTION_SET_P (dwarf_strict))
  	dwarf_strict = 1;
-      if (!global_options_set.x_dwarf_version)
+      if (!OPTION_SET_P (dwarf_version))
  	dwarf_version = 2;
      }
  }
diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
index 7558d2f7195..b75a7b8250e 100644
--- a/gcc/config/sh/linux.h
+++ b/gcc/config/sh/linux.h
@@ -126,7 +126,7 @@  along with GCC; see the file COPYING3.  If not see
    do									\
      {									\
        /* Set default atomic model if it hasn't been specified.  */	\
-      if (global_options_set.x_sh_atomic_model_str == 0)		\
+      if (OPTION_SET_P (sh_atomic_model_str) == 0)		\
  	{								\
  	  if (TARGET_SH3)						\
  	    sh_atomic_model_str = "soft-gusa";				\
@@ -134,7 +134,7 @@  along with GCC; see the file COPYING3.  If not see
  	    sh_atomic_model_str = "soft-imask";				\
  	}								\
        /* Set -musermode if it hasn't been specified.  */		\
-      if (global_options_set.x_TARGET_USERMODE == 0)			\
+      if (OPTION_SET_P (TARGET_USERMODE) == 0)			\
  	TARGET_USERMODE = true;						\
      }									\
    while (0)
diff --git a/gcc/config/sh/netbsd-elf.h b/gcc/config/sh/netbsd-elf.h
index f0b75419855..39eb773001d 100644
--- a/gcc/config/sh/netbsd-elf.h
+++ b/gcc/config/sh/netbsd-elf.h
@@ -85,7 +85,7 @@  while (0)
    do									\
      {									\
        /* Set -musermode if it hasn't been specified.  */		\
-      if (global_options_set.x_TARGET_USERMODE == 0)			\
+      if (OPTION_SET_P (TARGET_USERMODE) == 0)			\
  	TARGET_USERMODE = true;						\
      }									\
    while (0)
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1564109c942..0628f059ca2 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -893,7 +893,7 @@  sh_option_override (void)
      }
  
    /* Set -mzdcbranch for SH4 / SH4A if not otherwise specified by the user.  */
-  if (! global_options_set.x_TARGET_ZDCBRANCH && TARGET_HARD_SH4)
+  if (! OPTION_SET_P (TARGET_ZDCBRANCH) && TARGET_HARD_SH4)
      TARGET_ZDCBRANCH = 1;
  
    /* FDPIC code is a special form of PIC, and the vast majority of code
@@ -932,13 +932,13 @@  sh_option_override (void)
  	 <http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00816.html>.  */
        else if (flag_exceptions)
  	{
-	  if (flag_schedule_insns && global_options_set.x_flag_schedule_insns)
+	  if (flag_schedule_insns && OPTION_SET_P (flag_schedule_insns))
  	    warning (0, "ignoring %<-fschedule-insns%> because of exception "
  			"handling bug");
  	  flag_schedule_insns = 0;
  	}
        else if (flag_schedule_insns
-	       && !global_options_set.x_flag_schedule_insns)
+	       && !OPTION_SET_P (flag_schedule_insns))
  	flag_schedule_insns = 0;
      }
  
@@ -958,12 +958,12 @@  sh_option_override (void)
    if (flag_unsafe_math_optimizations)
      {
        /* Enable fsca insn for SH4A if not otherwise specified by the user.  */
-      if (global_options_set.x_TARGET_FSCA == 0
+      if (OPTION_SET_P (TARGET_FSCA) == 0
  	  && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
  	TARGET_FSCA = 1;
  
        /* Enable fsrra insn for SH4A if not otherwise specified by the user.  */
-      if (global_options_set.x_TARGET_FSRRA == 0
+      if (OPTION_SET_P (TARGET_FSRRA) == 0
  	  && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
  	TARGET_FSRRA = 1;
      }
@@ -976,7 +976,7 @@  sh_option_override (void)
  
    /* If the -mieee option was not explicitly set by the user, turn it on
       unless -ffinite-math-only was specified.  See also PR 33135.  */
-  if (! global_options_set.x_TARGET_IEEE)
+  if (! OPTION_SET_P (TARGET_IEEE))
      TARGET_IEEE = ! flag_finite_math_only;
  
    if (sh_fixed_range_str)
diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
index 1fbdbf5046c..517816a1fe6 100644
--- a/gcc/config/sol2.c
+++ b/gcc/config/sol2.c
@@ -31,6 +31,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "diagnostic-core.h"
  #include "varasm.h"
  #include "output.h"
+#include "opts.h"
  
  tree solaris_pending_aligns, solaris_pending_inits, solaris_pending_finis;
  
@@ -296,6 +297,6 @@  solaris_override_options (void)
  {
    /* Older versions of Solaris ld cannot handle CIE version 3 in .eh_frame.
       Don't emit DWARF3/4 unless specifically selected if so.  */
-  if (!HAVE_LD_EH_FRAME_CIEV3 && !global_options_set.x_dwarf_version)
+  if (!HAVE_LD_EH_FRAME_CIEV3 && !OPTION_SET_P (dwarf_version))
      dwarf_version = 2;
  }
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 6bc6f0ace6a..ca91be4c8e9 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -1859,7 +1859,7 @@  sparc_option_override (void)
        }
  
    /* Set the default CPU if no -mcpu option was specified.  */
-  if (!global_options_set.x_sparc_cpu_and_features)
+  if (!OPTION_SET_P (sparc_cpu_and_features))
      {
        for (def = &cpu_default[0]; def->cpu != -1; ++def)
  	if (def->cpu == TARGET_CPU_DEFAULT)
@@ -1869,7 +1869,7 @@  sparc_option_override (void)
      }
  
    /* Set the default CPU if no -mtune option was specified.  */
-  if (!global_options_set.x_sparc_cpu)
+  if (!OPTION_SET_P (sparc_cpu))
      sparc_cpu = sparc_cpu_and_features;
  
    cpu = &cpu_table[(int) sparc_cpu_and_features];
@@ -1975,7 +1975,7 @@  sparc_option_override (void)
      dump_target_flags ("Final target_flags", target_flags);
  
    /* Set the code model if no -mcmodel option was specified.  */
-  if (global_options_set.x_sparc_code_model)
+  if (OPTION_SET_P (sparc_code_model))
      {
        if (TARGET_ARCH32)
  	error ("%<-mcmodel=%> is not supported in 32-bit mode");
@@ -1989,7 +1989,7 @@  sparc_option_override (void)
      }
  
    /* Set the memory model if no -mmemory-model option was specified.  */
-  if (!global_options_set.x_sparc_memory_model)
+  if (!OPTION_SET_P (sparc_memory_model))
      {
        /* Choose the memory model for the operating system.  */
        enum sparc_memory_model_type os_default = SUBTARGET_DEFAULT_MEMORY_MODEL;
@@ -2177,12 +2177,12 @@  sparc_option_override (void)
    /* Disable save slot sharing for call-clobbered registers by default.
       The IRA sharing algorithm works on single registers only and this
       pessimizes for double floating-point registers.  */
-  if (!global_options_set.x_flag_ira_share_save_slots)
+  if (!OPTION_SET_P (flag_ira_share_save_slots))
      flag_ira_share_save_slots = 0;
  
    /* Only enable REE by default in 64-bit mode where it helps to eliminate
       redundant 32-to-64-bit extensions.  */
-  if (!global_options_set.x_flag_ree && TARGET_ARCH32)
+  if (!OPTION_SET_P (flag_ree) && TARGET_ARCH32)
      flag_ree = 0;
  
    /* Do various machine dependent initializations.  */
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index 64e28f641d8..08d1126c49e 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -56,6 +56,7 @@ 
  #include "tilegx-builtins.h"
  #include "tilegx-multiply.h"
  #include "builtins.h"
+#include "opts.h"
  
  /* This file should be included last.  */
  #include "target-def.h"
@@ -76,7 +77,7 @@  static bool output_memory_autoinc_first;
  static void
  tilegx_option_override (void)
  {
-  if (global_options_set.x_tilegx_cmodel)
+  if (OPTION_SET_P (tilegx_cmodel))
      {
        switch (tilegx_cmodel)
  	{
diff --git a/gcc/config/visium/visium.c b/gcc/config/visium/visium.c
index 58e5355e712..ffa2243f155 100644
--- a/gcc/config/visium/visium.c
+++ b/gcc/config/visium/visium.c
@@ -443,7 +443,7 @@  visium_option_override (void)
      }
  
    /* Set -mtune from -mcpu if not specified.  */
-  if (!global_options_set.x_visium_cpu)
+  if (!OPTION_SET_P (visium_cpu))
      visium_cpu = visium_cpu_and_features;
  
    /* Align functions on 256-byte (32-quadword) for GR5 and 64-byte (8-quadword)
diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c
index 51f4675d7c6..29ec0604b62 100644
--- a/gcc/config/vxworks.c
+++ b/gcc/config/vxworks.c
@@ -30,6 +30,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "rtl.h"
  #include "memmodel.h"
  #include "optabs.h"
+#include "opts.h"
  
  #if !HAVE_INITFINI_ARRAY_SUPPORT
  /* Like default_named_section_asm_out_constructor, except that even
@@ -167,10 +168,10 @@  vxworks_override_options (void)
       dwarf up to certain version.  Default dwarf control to friendly
       values for these.  */
  
-  if (!global_options_set.x_dwarf_strict)
+  if (!OPTION_SET_P (dwarf_strict))
      dwarf_strict = 1;
  
-  if (!global_options_set.x_dwarf_version)
+  if (!OPTION_SET_P (dwarf_version))
      dwarf_version = VXWORKS_DWARF_VERSION_DEFAULT;
  
  }
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 66d5221692a..08f8514d08d 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -36,6 +36,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "fold-const-call.h"
  #include "stor-layout.h"
  #include "cgraph.h"
+#include "opts.h"
  
  static bool verify_constant (tree, bool, bool *, bool *);
  #define VERIFY_CONSTANT(X)						\
@@ -6107,7 +6108,7 @@  maybe_warn_about_constant_value (location_t loc, tree decl)
    static bool explained = false;
    if (cxx_dialect >= cxx17
        && warn_interference_size
-      && !global_options_set.x_param_destruct_interfere_size
+      && !OPTION_SET_P (param_destruct_interfere_size)
        && DECL_CONTEXT (decl) == std_node
        && id_equal (DECL_NAME (decl), "hardware_destructive_interference_size")
        && (LOCATION_FILE (input_location) != main_input_filename
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2d30c790b93..561debe6a0e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -56,6 +56,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "context.h"  /* For 'g'.  */
  #include "omp-general.h"
  #include "omp-offload.h"  /* For offload_vars.  */
+#include "opts.h"
  
  /* Possible cases of bad specifiers type used by bad_specifiers. */
  enum bad_spec_place {
@@ -3228,7 +3229,7 @@  redeclaration_error_message (tree newdecl, tree olddecl)
  	{
  	  DECL_EXTERNAL (newdecl) = 1;
  	  /* For now, only warn with explicit -Wdeprecated.  */
-	  if (global_options_set.x_warn_deprecated)
+	  if (OPTION_SET_P (warn_deprecated))
  	    {
  	      auto_diagnostic_group d;
  	      if (warning_at (DECL_SOURCE_LOCATION (newdecl), OPT_Wdeprecated,
@@ -4756,7 +4757,7 @@  cxx_init_decl_processing (void)
    /* Check that the hardware interference sizes are at least
       alignof(max_align_t), as required by the standard.  */
    const int max_align = max_align_t_align () / BITS_PER_UNIT;
-  if (global_options_set.x_param_destruct_interfere_size)
+  if (OPTION_SET_P (param_destruct_interfere_size))
      {
        if (param_destruct_interfere_size < max_align)
  	error ("%<--param destructive-interference-size=%d%> is less than "
@@ -4773,7 +4774,7 @@  cxx_init_decl_processing (void)
      param_destruct_interfere_size = param_l1_cache_line_size;
    /* else leave it unset.  */
  
-  if (global_options_set.x_param_construct_interfere_size)
+  if (OPTION_SET_P (param_construct_interfere_size))
      {
        if (param_construct_interfere_size < max_align)
  	error ("%<--param constructive-interference-size=%d%> is less than "
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index fa29a46ab1e..be6330fbdfb 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -792,13 +792,13 @@  d_post_options (const char ** fn)
  
    if (global.params.betterC)
      {
-      if (!global_options_set.x_flag_moduleinfo)
+      if (!OPTION_SET_P (flag_moduleinfo))
  	global.params.useModuleInfo = false;
  
-      if (!global_options_set.x_flag_rtti)
+      if (!OPTION_SET_P (flag_rtti))
  	global.params.useTypeInfo = false;
  
-      if (!global_options_set.x_flag_exceptions)
+      if (!OPTION_SET_P (flag_exceptions))
  	global.params.useExceptions = false;
  
        global.params.checkAction = CHECKACTION_C;
@@ -810,7 +810,7 @@  d_post_options (const char ** fn)
    /* Turn off partitioning unless it was explicitly requested, as it doesn't
       work with D exception chaining, where EH handler uses LSDA to determine
       whether two thrown exception are in the same context.  */
-  if (!global_options_set.x_flag_reorder_blocks_and_partition)
+  if (!OPTION_SET_P (flag_reorder_blocks_and_partition))
      global_options.x_flag_reorder_blocks_and_partition = 0;
  
    /* Error about use of deprecated features.  */
@@ -819,7 +819,7 @@  d_post_options (const char ** fn)
      global.params.useDeprecated = DIAGNOSTICerror;
  
    /* Make -fmax-errors visible to frontend's diagnostic machinery.  */
-  if (global_options_set.x_flag_max_errors)
+  if (OPTION_SET_P (flag_max_errors))
      global.params.errorLimit = flag_max_errors;
  
    if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 016b70443ae..3499a1caa6d 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -260,7 +260,7 @@  gfc_post_options (const char **pfilename)
       If not enabled explicitly by the user, only warn for -I
       and -J, otherwise warn for all include paths.  */
    verbose_missing_dir_warn
-    = (global_options_set.x_cpp_warn_missing_include_dirs
+    = (OPTION_SET_P (cpp_warn_missing_include_dirs)
         && global_options.x_cpp_warn_missing_include_dirs);
    SET_OPTION_IF_UNSET (&global_options, &global_options_set,
  		       cpp_warn_missing_include_dirs, 1);
@@ -309,7 +309,7 @@  gfc_post_options (const char **pfilename)
      flag_dump_fortran_original = 0;
  
    /* Make -fmax-errors visible to gfortran's diagnostic machinery.  */
-  if (global_options_set.x_flag_max_errors)
+  if (OPTION_SET_P (flag_max_errors))
      gfc_option.max_errors = flag_max_errors;
  
    /* Verify the input file name.  */
@@ -388,7 +388,7 @@  gfc_post_options (const char **pfilename)
  
        /* Enable -Werror=line-truncation when -Werror and -Wno-error have
  	 not been set.  */
-      if (warn_line_truncation && !global_options_set.x_warnings_are_errors
+      if (warn_line_truncation && !OPTION_SET_P (warnings_are_errors)
  	  && (global_dc->classify_diagnostic[OPT_Wline_truncation] ==
  	      DK_UNSPECIFIED))
  	diagnostic_classify_diagnostic (global_dc, OPT_Wline_truncation,
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 9496b3c8e0b..7b2ad74e69a 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -70,17 +70,17 @@  lto_write_options (void)
  
    obstack_init (&temporary_obstack);
  
-  if (!global_options_set.x_flag_openmp
+  if (!OPTION_SET_P (flag_openmp)
        && !global_options.x_flag_openmp)
      append_to_collect_gcc_options (&temporary_obstack, &first_p,
  				   "-fno-openmp");
-  if (!global_options_set.x_flag_openacc
+  if (!OPTION_SET_P (flag_openacc)
        && !global_options.x_flag_openacc)
      append_to_collect_gcc_options (&temporary_obstack, &first_p,
  				   "-fno-openacc");
    /* Append PIC/PIE mode because its default depends on target and it is
       subject of merging in lto-wrapper.  */
-  if (!global_options_set.x_flag_pic && !global_options_set.x_flag_pie)
+  if (!OPTION_SET_P (flag_pic) && !OPTION_SET_P (flag_pie))
      {
         append_to_collect_gcc_options (&temporary_obstack, &first_p,
  				      global_options.x_flag_pic == 2
@@ -94,7 +94,7 @@  lto_write_options (void)
  				      : "-fno-pie");
      }
  
-  if (!global_options_set.x_flag_cf_protection)
+  if (!OPTION_SET_P (flag_cf_protection))
      {
        append_to_collect_gcc_options (
  	&temporary_obstack, &first_p,
diff --git a/gcc/objc/objc-next-runtime-abi-01.c b/gcc/objc/objc-next-runtime-abi-01.c
index 183fc01abb2..17c86189923 100644
--- a/gcc/objc/objc-next-runtime-abi-01.c
+++ b/gcc/objc/objc-next-runtime-abi-01.c
@@ -259,7 +259,7 @@  static void next_runtime_01_initialize (void)
  #ifdef OBJCPLUS
    /* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by
       default.  */
-  if (!global_options_set.x_flag_objc_call_cxx_cdtors)
+  if (!OPTION_SET_P (flag_objc_call_cxx_cdtors))
      global_options.x_flag_objc_call_cxx_cdtors = 1;
  #endif
  
diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
index 9c35738a95c..677b75f0334 100644
--- a/gcc/objc/objc-next-runtime-abi-02.c
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -255,7 +255,7 @@  objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
      }
  
    /* NeXT ABI 2 is intended to default to checking for nil receivers.  */
-  if (! global_options_set.x_flag_objc_nilcheck)
+  if (! OPTION_SET_P (flag_objc_nilcheck))
      flag_objc_nilcheck = 1;
  
    rthooks->initialize = next_runtime_02_initialize;
@@ -366,7 +366,7 @@  static void next_runtime_02_initialize (void)
  #ifdef OBJCPLUS
    /* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by
       default.  */
-  if (!global_options_set.x_flag_objc_call_cxx_cdtors)
+  if (!OPTION_SET_P (flag_objc_call_cxx_cdtors))
      global_options.x_flag_objc_call_cxx_cdtors = 1;
  #endif
  
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 496c0e6cdd6..9715ef50e62 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -59,6 +59,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "stringpool.h"
  #include "attribs.h"
  #include "tree-eh.h"
+#include "opts.h"
  
  /* OMP region information.  Every parallel and workshare
     directive is enclosed between two markers, the OMP_* directive
@@ -6960,7 +6961,7 @@  expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
        /* If not -fno-tree-loop-vectorize, hint that we want to vectorize
  	 the loop.  */
        if ((flag_tree_loop_vectorize
-	   || !global_options_set.x_flag_tree_loop_vectorize)
+	   || !OPTION_SET_P (flag_tree_loop_vectorize))
  	  && flag_tree_loop_optimize
  	  && loop->safelen > 1)
  	{
diff --git a/gcc/omp-general.c b/gcc/omp-general.c
index 1e4c0b25531..3e5ca94c2a7 100644
--- a/gcc/omp-general.c
+++ b/gcc/omp-general.c
@@ -44,6 +44,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "tree-iterator.h"
  #include "data-streamer.h"
  #include "streamer-hooks.h"
+#include "opts.h"
  
  enum omp_requires omp_requires_mask;
  
@@ -952,7 +953,7 @@  omp_max_vf (void)
        || optimize_debug
        || !flag_tree_loop_optimize
        || (!flag_tree_loop_vectorize
-	  && global_options_set.x_flag_tree_loop_vectorize))
+	  && OPTION_SET_P (flag_tree_loop_vectorize)))
      return 1;
  
    auto_vector_modes modes;
diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c
index d881426ae65..833f7ddea58 100644
--- a/gcc/omp-offload.c
+++ b/gcc/omp-offload.c
@@ -54,6 +54,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "cfgloop.h"
  #include "context.h"
  #include "convert.h"
+#include "opts.h"
  
  /* Describe the OpenACC looping structure of a function.  The entire
     function is held in a 'NULL' loop.  */
@@ -633,7 +634,7 @@  oacc_xform_loop (gcall *call)
  	  /* If not -fno-tree-loop-vectorize, hint that we want to vectorize
  	     the loop.  */
  	  && (flag_tree_loop_vectorize
-	      || !global_options_set.x_flag_tree_loop_vectorize))
+	      || !OPTION_SET_P (flag_tree_loop_vectorize)))
  	{
  	  basic_block bb = gsi_bb (gsi);
  	  class loop *parent = bb->loop_father;
diff --git a/gcc/opts.h b/gcc/opts.h
index bafc790112b..f5bc9a3149c 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -500,4 +500,8 @@  extern char *gen_producer_string (const char *language_string,
    } \
    while (false)
  
+/* Return true if OPTION is set by user in global options.  */
+
+#define OPTION_SET_P(OPTION) global_options_set.x_ ## OPTION
+
  #endif
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index c9b5208853d..cbbcedf790f 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -2453,12 +2453,12 @@  default_max_noce_ifcvt_seq_cost (edge e)
  
    if (predictable_p)
      {
-      if (global_options_set.x_param_max_rtl_if_conversion_predictable_cost)
+      if (OPTION_SET_P (param_max_rtl_if_conversion_predictable_cost))
  	return param_max_rtl_if_conversion_predictable_cost;
      }
    else
      {
-      if (global_options_set.x_param_max_rtl_if_conversion_unpredictable_cost)
+      if (OPTION_SET_P (param_max_rtl_if_conversion_unpredictable_cost))
  	return param_max_rtl_if_conversion_unpredictable_cost;
      }
  
diff --git a/gcc/toplev.c b/gcc/toplev.c
index ecb2b694970..e4b381e159b 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1751,7 +1751,7 @@  process_options (bool no_backend)
  
    /* Enable -Werror=coverage-mismatch when -Werror and -Wno-error
       have not been set.  */
-  if (!global_options_set.x_warnings_are_errors)
+  if (!OPTION_SET_P (warnings_are_errors))
      {
        if (warn_coverage_mismatch
  	  && (global_dc->classify_diagnostic[OPT_Wcoverage_mismatch] ==
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 6b195d1914f..ce1f08f7d22 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -233,6 +233,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "tree-scalar-evolution.h"
  #include "tree-affine.h"
  #include "builtins.h"
+#include "opts.h"
  
  /* The maximum number of iterations between the considered memory
     references.  */
@@ -3492,7 +3493,7 @@  public:
         only if predictive commoning isn't set explicitly, and it
         doesn't allow unrolling.  */
      if (flag_tree_loop_vectorize
-	&& !global_options_set.x_flag_predictive_commoning)
+	&& !OPTION_SET_P (flag_predictive_commoning))
        return true;
  
      return false;
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 0363c5efb78..9b786e29e4e 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -99,7 +99,7 @@  along with GCC; see the file COPYING3.  If not see
  #include "dbgcnt.h"
  #include "builtins.h"
  #include "tree-sra.h"
-
+#include "opts.h"
  
  /* Enumeration of all aggregate reductions we can do.  */
  enum sra_mode { SRA_MODE_EARLY_IPA,   /* early call regularization */
@@ -3427,12 +3427,12 @@  analyze_all_variable_accesses (void)
  
    if (optimize_speed_p)
      {
-      if (global_options_set.x_param_sra_max_scalarization_size_speed)
+      if (OPTION_SET_P (param_sra_max_scalarization_size_speed))
  	max_scalarization_size = param_sra_max_scalarization_size_speed;
      }
    else
      {
-      if (global_options_set.x_param_sra_max_scalarization_size_size)
+      if (OPTION_SET_P (param_sra_max_scalarization_size_size))
  	max_scalarization_size = param_sra_max_scalarization_size_size;
      }
    max_scalarization_size *= BITS_PER_UNIT;