https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125670

--- Comment #4 from Robin Dapp <rdapp at gcc dot gnu.org> ---
> We call the has_vl method.  That pulls out (const_int 4) and promptly ICEs
> because of the assert that indicates VL can only be NULL_RTX or a REG.  The
> predicate is vector_length_operand which allows small constants via
> const_csr_operand.  So it's a bit odd that a predicate like has_vl aborts
> when encountering the constant.

Yeah it is odd but mostly due to us overloading operands or their meaning in
the vsetvl pass :)  m_vl is NULL if m_avl is a legitimate immediate.  Of
course, m_vl and m_avl refer to the same operand and their meaning also depends
on whether it's a vlmax insn or not.  We definitely have more obvious code in
our codebase :)

So I think the problem is a split in autovec-opt.md that uses a wrong index and
we erroneously turn the insn into a VLMAX insn that needs to have a real VL
operand but has none.  Testing a fix.

Reply via email to