https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77475
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 39565 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39565&action=edit gcc7-pr77475.patch Given the number of targets that use targetm.target_options.override hook and the amount of error/warning/sorry calls in them and that lots of targets also use the same functions for pragma/target attribute handling, I think it is much better to tweak toplev.c for this. Bet it will have significant testsuite fallout though.