https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106945 --- Comment #3 from anlauf at gcc dot gnu.org --- It is -fcheck=bounds that is required to trigger the failure. Replacing -ftrapv by -fsanitize=undefined produces the same error.