https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96939
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So I think this bug has been introduced with https://gcc.gnu.org/legacy-ml/gcc-patches/2016-12/msg01390.html I think the right change is: --- gcc/config/arm/arm.c.jj 2020-07-30 15:04:38.136293101 +0200 +++ gcc/config/arm/arm.c 2020-09-07 10:43:54.809561852 +0200 @@ -3037,10 +3037,6 @@ arm_override_options_after_change_1 (str static void arm_override_options_after_change (void) { - arm_configure_build_target (&arm_active_target, - TREE_TARGET_OPTION (target_option_default_node), - &global_options_set, false); - arm_override_options_after_change_1 (&global_options); } @@ -32338,6 +32334,8 @@ arm_set_current_function (tree fndecl) cl_target_option_restore (&global_options, TREE_TARGET_OPTION (new_tree)); save_restore_target_globals (new_tree); + + arm_override_options_after_change_1 (&global_options); } /* Implement TARGET_OPTION_PRINT. */ because random Optimization option changes, even just temporary, shouldn't change what arm_arch_string etc. is, only option parsing or set_current_function which invokes cl_target_option_restore -> arm_option_restore.