Most of the top questions I've asked on Stack Overflow are related to missed optimizations in C (or C++, but I'll skip those here):
- https://stackoverflow.com/questions/45052282/why-is-memcmpa-...
- https://stackoverflow.com/questions/23055704/why-cant-gcc-op...
- https://stackoverflow.com/questions/26052640/why-does-gcc-im...
- https://stackoverflow.com/questions/18951520/gcc-optimizatio...
But my favorite is this one:
- https://stackoverflow.com/questions/26053934/is-it-feasible-...
That one is now optimized in GCC and Clang: (isnan(x) || isnan(y)) becomes a single instruction on x86.
Some of these are very tricky, but the isnan pairing one is simple, and quite useful for some math routines whose first order of business is finding NaNs.