@johnm @regehr Another example. testcase that (used to) breaks with
GCC -O3 on x86-64 https://github.com/Cisco-Talos/clamav/commit/c47e43ce354878de55f3521c9b8fbc887ed206f4
Attempted fix https://github.com/Cisco-Talos/clamav/commit/2b481467801751d79d1bcd40878c070e7bc03bcb
This was from ~17 years ago, and TBH I'm not convinced the "fix" avoids UB completely, but I assume someone would've found a unit test failure by now, but I see the code still looks the same now. Perhaps the only way to really avoid UB there is to use `memcpy`, and hope the compiler will be smart enough to optimize it away.