https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122212
--- Comment #1 from Sam James <sjames at gcc dot gnu.org> --- At least the real version checks `val` first: https://github.com/facebook/zstd/blob/23dae4bf49a8b36ab88509c85137b49f74bbc76d/lib/common/bits.h#L52.
