Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Missed optimization- using undefined symbol to do compile-time check

$
0
0

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.

https://godbolt.org/z/SqPBZ_


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>