+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.
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 "