https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95778
--- Comment #4 from Yichao Yu <yyc1992 at gmail dot com> --- Yeah, after digging further the two issue are indeed the same. I initially didn't think they are since I didn't realize PR95786 (that the visibility attribute is simply ignored completely...) and thought static was handled specially.... It also seems that when target attribute is used directly the inlining can work. Maybe a pass order issue? and that's certainly a different issue so I'll file another one if there isn't one already when I have time.