3 ms·
"You only really need to know one case where the compiler will, if the prevent-optimisation compiler magic isn't sprinkled on it." If you do that, the best you
by Someone 13y ago
"You only really need to know one case where the compiler will, if the prevent-optimisation compiler magic isn't sprinkled on it."
If you do that, the best you can get is a test that works with one specific version of one specific compiler used with one specific set of compiler flags. It probably is easier to just inspect the resulting binary.
And you may not even get that, as the optimizer may use some fairly complex heuristics to choose whether to optimize away a call, such as register pressure (for example, in a three level deep for loop, it may not make sense to try and get extra stuff into registers)