https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85416
--- Comment #13 from Alexander Monakov <amonakov at gcc dot gnu.org> --- This is most likely a variant of https://bugzilla.redhat.com/show_bug.cgi?id=1421121 so hitting this bug requires a specific CPU model. It looks as if SSE-AVX transition penalties appear when switching between pure-SSE sinf code and VEX-prefixed SSE code in the main program after the ld.so runtime resolver affects AVX state tracking in the CPU. I'm not sure if any patches have landed on Glibc side to avoid this, but in any case this should be re-reported against Glibc if needed, GCC cannot improve the situation. An easy workaround would be to pass -Wl,-z,now when linking.