https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106192
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |matz at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Keywords| |needs-bisection Known to work| |10.3.0 Priority|P3 |P2 Known to fail| |11.3.0, 12.1.0, 13.0 Last reconfirmed| |2022-07-05 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. LOOP_REQUIRES_VERSIONING_FOR_SIMD_IF_COND is _15 and we have the loop header <bb 4> [local count: 696725737]: # i.2_29 = PHI <1(3), i.2_22(11)> # ivtmp_24 = PHI <100(3), ivtmp_16(11)> .GOMP_SIMD_LANE (simduid.6_17(D), 0, _12); _13 = i.2_29 + -1; _18 = (integer(kind=8)) _13; _19 = a[_18]; _20 = _19 + 1; a[_18] = _20; i.2_22 = i.2_29 + 1; _3 = j.0_28 + 1; _15 = _3 <= 59; .GOMP_SIMD_LANE (simduid.6_17(D), 0, _15); _8 = _19 + 2; a[_18] = _8; ivtmp_16 = ivtmp_24 - 1; if (ivtmp_16 != 0) goto <bb 11>; [87.50%] else goto <bb 12>; [12.50%] so the bb != loop->header part of the assert already fires. The condition is loop invariant but it wasn't hoisted for some reason. Or rather it looks like we unrolled the loop once which we might not do to .GOMP_SIMD_LANE bbs IIRC. unroll-and-jam does this.