https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128704
--- Comment #3 from Robin Dapp <rdapp at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Mine. The issue is that the niter versioning condition for vectorizing the
> outer loop is not invariant in the outer loop. Caused by
>
> base_address: &a
> offset from base address: (ssizetype) i_16
> constant offset from base address: 0
> step: 1
> base alignment: 8
> base misalignment: 0
> offset alignment: 1
> step alignment: 1
> base_object: a
> nowrap bound: ~(<unnamed-unsigned:3>) i_16
> Access function 0: {{0, +, 1}_1, +, 1}_2
> t.c:3:21: note: adding no-wrap assumption: (<unnamed-unsigned:3>) i_16 <= 2
> t.c:3:21: note: Loop to be versioned with assumption (<unnamed-unsigned:3>)
> i_16 <= 2
>
> so it looks those can be problematic for outer loop vectorization which we'd
> either need to not do or try to formulate the no-wrap assumption in terms of
> the outer loop.
I haven't considered outer-loop vectorization at all :/ I guess we have a
mismatch of bound and niter (belonging to the outer loop).
It might be easiest to not allow nowrap assumptions for now for nested loops?
Like passing !loop->inner as last argument in find_data_references_in_stmt.