https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 49916 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49916&action=edit gcc11-pr98585.patch Untested fix. The problem is that if we have TargetSave or something without Save attribute and use it in opts_set->x_* or global_options_set.x_* tests, the generic code doesn't save/restore those, so either the target save/restore options hook needs to save/restore not just the options (which it does for some of them), but also the opts_set-> for that. Either it can do that manually, or by changing TargetSave to TargetVariable we can just leave to the generic code to do it for us.