On Thu, Jan 22, 2026 at 04:48:17PM +0000, Victor Do Nascimento wrote:
> --- a/gcc/tree-ssa-loop-ivopts.cc
> +++ b/gcc/tree-ssa-loop-ivopts.cc
> @@ -1825,7 +1825,8 @@ expr_invariant_in_loop_p (class loop *loop, tree expr)
>
> gcc_assert (loop_depth (loop) > 0);
>
> - if (is_gimple_min_invariant (expr))
> + if (is_gimple_min_invariant (expr)
> + && !automatically_generated_chrec_p (expr))
> return true;
As Richi wrote, neither chrec_dont_know nor chrec_known should be ever
is_gimple_min_invariant.
> --- a/gcc/tree-vect-loop.cc
> +++ b/gcc/tree-vect-loop.cc
> @@ -1555,7 +1555,8 @@ vect_analyze_loop_form (class loop *loop, gimple
> *loop_vectorized_call,
> return opt_result::failure_at (vect_location,
> "not vectorized: Bad inner loop.\n");
>
> - if (!expr_invariant_in_loop_p (loop, inner.number_of_iterations))
> + if (inner.number_of_iterations == chrec_dont_know
s/== /== /
> + || !expr_invariant_in_loop_p (loop, inner.number_of_iterations))
> return opt_result::failure_at (vect_location,
> "not vectorized: inner-loop count not"
> " invariant.\n");
Jakub