https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66348
--- Comment #5 from Sebastiano Vigna <sebastiano.vigna at unimi dot it> --- Fantastic tool! I didn't know about it. But it doesn't fire. There is no undefined behaviour in that code--it's just that the optimizer at -O1 does something wrong. I tried a binary search over the single options induced by -O1, but it turns out it's a combination of things--when I split the options in two half, the problem did not show up with either half. The code is 30-40 lines of assembly--I guess someone proficient with the output of the compiler could easily spot what's going wrong.