According to the the initial analysis of PR117878, the ice comes from
the out-of-range operand access for recog_data.operand[]. Thus, add
one assert here to expose this explicitly.
PR target/117878
gcc/ChangeLog:
* config/riscv/riscv-v.cc (vlmax_avl_type_p): Add assert for
out of range access.
(nonvlmax_avl_type_p): Ditto.
Signed-off-by: Pan Li <pan2.li@intel.com>
int index = get_attr_avl_type_idx (rinsn);
if (index == INVALID_ATTRIBUTE)
return false;
+
+ gcc_assert (index < recog_data.n_operands);
+
rtx avl_type = recog_data.operand[index];
return INTVAL (avl_type) == VLMAX;
}
int index = get_attr_avl_type_idx (rinsn);
if (index == INVALID_ATTRIBUTE)
return false;
+
+ gcc_assert (index < recog_data.n_operands);
+
rtx avl_type = recog_data.operand[index];
return INTVAL (avl_type) == NONVLMAX;
}