https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125311
--- Comment #11 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
Running gdb on gfortran:
Breakpoint 6, decode_cmdline_option (argv=0x7fffffffcc58, lang_mask=524288,
decoded=0x7e67a0) at ../../gcc-trunk/gcc/opts-common.cc:706
706 if (option->alias_target != N_OPTS
(gdb) p *option
$32 = {opt_text = 0x64f06f "-fcheck=bounds", help = 0x0, missing_argument_error
= 0x0,
warn_message = 0x0, alias_arg = 0x0, neg_alias_arg = 0x0, alias_target =
1142,
back_chain = 1174, opt_len = 13 '\r', neg_index = 1176, flags = 128,
cl_disabled = 0,
cl_separate_nargs = 0, cl_separate_alias = 0, cl_negative_alias = 0,
cl_no_driver_arg = 0, cl_reject_driver = 0, cl_reject_negative = 0,
cl_missing_ok = 0,
cl_uinteger = 0, cl_host_wide_int = 0, cl_tolower = 0, cl_byte_size = 0,
flag_var_offset = 65535, var_enum = 0, var_type = CLVC_INTEGER, var_value =
0,
range_min = -1, range_max = -1}
(gdb) l
701 if (arg == NULL && (separate_arg_flag || joined_arg_flag))
702 errors |= CL_ERR_MISSING_ARG;
703
704 /* Is this option an alias (or an ignored option, marked as an alias
705 of OPT_SPECIAL_ignore)? */
706 if (option->alias_target != N_OPTS
707 && (!option->cl_separate_alias || have_separate_arg))
708 {
709 size_t new_opt_index = option->alias_target;
710
This block seems responsible for the option renaming. alias_target points to
-fbounds-check. Indeed, if we force to skip this block, things work.
One problem is that we have
(gdb) p lang_mask
$33 = 524288
which is CL_DRIVER. We do not know which language we are in... :-(
Need help from someone who understands the driver.