https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92749
--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> --- This is intentional, we got less aggressive at inlining inline functions for -O2 (since we do not need to do all inlining we want for -O3 when we have independent set of attributes). Indeed -Winline -Werror is not the best idea - if you want that there is always_inline attribute.