3 ms·
Great post. In particular: "remove some of the undefined behaviors" I think the confusion caused by this is not nearly worth the optimization gained. Compiler
by Upvoter33 7y ago
Great post.
In particular: "remove some of the undefined behaviors"
I think the confusion caused by this is not nearly worth the optimization gained.
Compiler folks will say "but look, this loop is 58% faster!" but ignore the fact that slow code can be optimized through other means, including profiling, restructuring, etc.
- beached_whale 7y agoOr avoid them when your compiler hasn't documented if they support it. Such as gcc supporting union type punning in c++. Many compilers allow for reinterpret_cast'ing too, e.g. gcc and -fno-strict-aliasing This is more of knowing your language and tools. UB isn't some magic beast either, it's where it isn't really feasible for a language that runs on many platforms to dictate what happens. What should the std's say when you shift a signed int too far? Often the HW will have a way of doing it and others will not, so either don't do that or know your implementation
- deleted 7y ago[deleted]