This is not a problem with a usual compiler configuration, but LLVM/clang detects it when compiled with: -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -ftrapv