This is sort of a trick to get an optimizing compiler to prove an interesting property of some code; we insert a call to an nonexistent extern function along the code path we want to have proven is impossible. If the optimizer fails to prove that the code path is never taken, the code fails to link. I tried to use this in a Vec3/Point implementation and was surprised to see that icc doesn't manage to prove the extern function is never called (clang and gcc do manage this). The runtime performance of this code isn't really the point, what I'd like is the optimizer's proof.
↧