https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
ktkachov at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ktkachov at gcc dot gnu.org --- Comment #1 from ktkachov at gcc dot gnu.org --- GCC provides the Function Multiversioning feature that's supported on some architectures: https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html That seems to do what you want?