https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118827
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Compile at -O2 ? Or mark delay as static inline and always_inline like: __attribute__((always_inline)) static inline void delay(int ms) Basically you need to mark delay as not being able to touch the fp/vector registers as compiling at -O0 GCC does not anything about delay (or any other function). The same is true when it is a function in a different TU. I am not sure we want to have the ability to mark functions are not using vector/fp registers directly.