This patch applies equivalent changes from ix86_set_current_function to rs6000_set_current_function. The example in the Bugzilla report does not fail, but I hope that the reporter can confirm this is fixed.
Bootstrapped on powerpc64-linux-gnu. Committed. Thanks, David PR target/64047 * config/rs6000/rs6000.c (rs6000_set_current_function): Handle explicit default options. Index: rs6000.c =================================================================== --- rs6000.c (revision 220329) +++ rs6000.c (working copy) @@ -32625,7 +32625,7 @@ if (old_tree == new_tree) ; - else if (new_tree) + else if (new_tree && new_tree != target_option_default_node) { cl_target_option_restore (&global_options, TREE_TARGET_OPTION (new_tree)); @@ -32636,7 +32636,7 @@ = save_target_globals_default_opts (); } - else if (old_tree) + else if (old_tree && old_tree != target_option_default_node) { new_tree = target_option_current_node; cl_target_option_restore (&global_options,