https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116126
ak at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ak at gcc dot gnu.org --- Comment #9 from ak at gcc dot gnu.org --- On x86/avx512f the first variant still fails with earch-line-fast.c:4:60: missed: couldn't vectorize loop search-line-fast.c:4:60: missed: not vectorized: number of iterations cannot be computed. and the second variant with end condition with search-line-fast-cond.c:3:18: missed: couldn't vectorize loop search-line-fast-cond.c:3:18: missed: not vectorized: unsupported control flow in loop. search-line-fast-cond.c:1:22: note: vectorized 0 loops in function. The first needs some pattern matching: having the break condition in the loop vs having it in a while header shouldn't matter. I think the later is due to vect_analyze_loop_form: | if (EDGE_COUNT (bbs[i]->succs) != 1 <bb 5> [local count: 1044213920]: # prephitmp_25 = PHI <_24(4), 0(12)> _10 = _1 == 92; _13 = _10 | prephitmp_25; if (_13 != 0) goto <bb 6>; [8.03%] else goto <bb 7>; [91.97%] <bb 6> [local count: 83800315]: # s_19 = PHI <s_15(5)> return s_19; because the return isn't a jump out of the loop. I'm not sure how arm avoids that problem.