http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59600
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Comment on attachment 31516 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31516 New patch based on Andrew's review No this wrong in two ways. Move the check to before the check of the target attribute table. And second you should compare the current function attribute to fndecl attribute.