I agree you can't trust your compiler, but you can control its behavior more reliably with __builtin_expect_with_probability
https://github.com/protocolbuffers/protobuf/commit/9f29f02a3...