https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96882
--- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> --- Yes, the problem is related to returning values in memory and the ABI variants we have. If we have hardware floating-point we generally use registers to return values; if we don't, then we have to return in memory. However, when we have a function that is not inlinable, but is private to the compilation unit we can optimize the ABI in some circumstances. That's what is happening here. Unfortunately, it appears that function that decides whether or not the result should be returned in memory or in registers lacks important information as to whether or not the function is private and this in turn leads to two parts of the compiler making different choices - with the disastrous consequences you've discovered. I'm not sure if this is restricted to M-profile parts or if it's more wide-spread - I'm still investigating.