Commit b989ffb2 by Jakub Jelinek Committed by Jakub Jelinek

genrecog.c (validate_pattern): For VEC_SELECT verify that CONST_INT selectors…

genrecog.c (validate_pattern): For VEC_SELECT verify that CONST_INT selectors are 0 to GET_MODE_NUNITS (imode) - 1.

	* genrecog.c (validate_pattern): For VEC_SELECT verify that
	CONST_INT selectors are 0 to GET_MODE_NUNITS (imode) - 1.

From-SVN: r253676
parent 712716d2
2017-10-12 Jakub Jelinek <jakub@redhat.com>
* genrecog.c (validate_pattern): For VEC_SELECT verify that
CONST_INT selectors are 0 to GET_MODE_NUNITS (imode) - 1.
2017-10-12 Aldy Hernandez <aldyh@redhat.com>
* Makefile.in (TAGS): Merge all the *.def files into one pattern.
......@@ -751,6 +751,21 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code)
error_at (info->loc,
"vec_select parallel with %d elements, expected %d",
XVECLEN (XEXP (pattern, 1), 0), expected);
else if (VECTOR_MODE_P (imode))
{
unsigned int nelems = GET_MODE_NUNITS (imode);
int i;
for (i = 0; i < expected; ++i)
if (CONST_INT_P (XVECEXP (XEXP (pattern, 1), 0, i))
&& (UINTVAL (XVECEXP (XEXP (pattern, 1), 0, i))
>= nelems))
error_at (info->loc,
"out of bounds selector %u in vec_select, "
"expected at most %u",
(unsigned)
UINTVAL (XVECEXP (XEXP (pattern, 1), 0, i)),
nelems - 1);
}
}
if (imode != VOIDmode && !VECTOR_MODE_P (imode))
error_at (info->loc, "%smode of first vec_select operand is not a "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment