https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122126
--- Comment #8 from Avinash Jayakar <avinashd at gcc dot gnu.org> ---
(In reply to Avinash Jayakar from comment #7)
> Created attachment 62715 [details]
> proposed patch for pr122126 for powerpc64le
>
> In powerpc64le, I see that we generate vsx_set insn during expand pass,
> without actually checking for the index operand.
> Here is the proposed fix for the powerpc64le backend, if the approach is ok
> I can create submit the patch.
>
> Should we do a similar thing for the x86?
Please ignore this, I was doing the wrong thing. As andrew suggested I will
update the gimple_expand_vec_set_extract_expr as follows
tree op0 = TREE_OPERAND (ref, 0);
tree view_op0 = TREE_OPERAND (op0, 0);
tree op1 = TREE_OPERAND (ref, 1);
if (!TYPE_VECTOR_SUBPARTS (view_op0).is_constant ())
return false;
if (TREE_CODE (op1) == INTEGER_CST && (!tree_fits_uhwi_p (op1) ||
tree_to_uhwi (op1) > TYPE_VECTOR_SUBPARTS (view_op0).to_constant ()))
return false;