Thanks, Richard! I think your suggestion is very good, so I made a new patch.
v2: at a high level handles -falign-foo=0 like -falign-foo v1: at the target level overides the -falign-foo=0 option values Obviously, v2 is better than v1. In addition, anthor option to reject 0 that discussed in the email and PR96247 is not as good as the current patch either, I think. I tested this patch on x86_64, it works well. OK for trunk? Regards! Hujp --- gcc/opts.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gcc/opts.c b/gcc/opts.c index 499eb900643..ed6102cd606 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -2786,18 +2786,38 @@ common_handle_option (struct gcc_options *opts, case OPT_falign_loops_: check_alignment_argument (loc, arg, "loops"); + // fix PR96247 + if (0 == atoi(arg)) { + opts->x_flag_align_loops = true; + opts->x_str_align_loops = NULL; + } break; case OPT_falign_jumps_: check_alignment_argument (loc, arg, "jumps"); + // fix PR96247 + if (0 == atoi(arg)) { + opts->x_flag_align_jumps = true; + opts->x_str_align_jumps = NULL; + } break; case OPT_falign_labels_: check_alignment_argument (loc, arg, "labels"); + // fix PR96247 + if (0 == atoi(arg)) { + opts->x_flag_align_labels = true; + opts->x_str_align_labels = NULL; + } break; case OPT_falign_functions_: check_alignment_argument (loc, arg, "functions"); + // fix PR96247 + if (0 == atoi(arg)) { + opts->x_flag_align_functions = true; + opts->x_str_align_functions = NULL; + } break; case OPT_ftabstop_: -- 2.17.1