https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113676
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aldyh at gcc dot gnu.org, | |amacleod at redhat dot com, | |jakub at gcc dot gnu.org Keywords|needs-bisection | --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Bisection with -O2 -ftree-vrp #include <vector> unsigned bit_ceil (unsigned x) { if (x <= 1) return 1U; int w = 32 - __builtin_clz (x - 1); return 1U << w; } int main (int argc, char **) { unsigned rounded_n = bit_ceil ((unsigned) (argc + 1)); auto a = std::vector<int> (2UL * rounded_n); for (long unsigned int i = rounded_n; i-- > 1;) { if (!(0 < i && i < rounded_n)) __builtin_unreachable(); a[i] = 0; } } shows this started with r12-155-gd8e1f1d24179690fd9c0f63c27b12e030010d9ea and went away with r13-3596-ge7310e24b1c0ca67b1bb507c1330b2bf39e59e32 so nothing really backportable.