https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70002
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The problem I see e.g. in aarch64 or rs6000 is that it in some cases uses NULL_TREE for old_tree or new_tree, and in that case doesn't change anything. But in reality, not changing anything if old_tree != new_tree is just wrong. If #pragma GCC target is supported, then there are 3 cases for old_tree, DECL_FUNCTION_SPECIFIC_TARGET of the old function decl, or target_option_current_node (the current #pragma GCC target at that point), or target_option_default_node (state at the beginning of the TU). For new_tree, you have just 2 possibilities, the new function has DECL_FUNCTION_SPECIFIC_TARGET, then set to that, or it doesn't, then the function should use target_option_default_node.