Hacker News new | ask | show | jobs
by gary_0 1945 days ago
GCC optimizations are also smart enough to remove memcpy calls for small numbers of bytes entirely and just output the unrolled movs/loads inline. If you're memcpy'ing a struct from a byte buffer and reading some fields, the optimizer is usually smart enough to output the minimum instructions necessary. As I recall, MSVC's optimizations perform similarly.