2 ms·
You'd still have to find a way to get the compiler not to eliminate the whole thing. So if you attempt to trash the registers with stuff but don't "mix it in"
by boulos 11y ago
You'd still have to find a way to get the compiler not to eliminate the whole thing. So if you attempt to trash the registers with stuff but don't "mix it in" to the return value, the compiler is free to elude the whole thing.
Perhaps if you write it out to a dummy output parameter though, combined with noinline that would sufficiently defeat this.