The following re-orders checks to make sure we check TYPE_PRECISION
on an integral type.
PR tree-optimization/110506
* tree-vect-patterns.cc (vect_recog_rotate_pattern): Re-order
TYPE_PRECISION access with INTEGRAL_TYPE_P check.
* gcc.dg/pr110506-2.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef unsigned uint32_t;
+typedef uint32_t uint32x4 __attribute__((vector_size(16)));
+typedef struct {
+ uint32x4 b, d;
+} prng_t;
+prng_t prng_rand_128_r_x;
+int main_flags;
+int main() {
+ uint32_t ref_crc[] = {7, 3};
+ uint32x4 e = (prng_rand_128_r_x.b << 27) + (prng_rand_128_r_x.b >> 32 - 27);
+ prng_rand_128_r_x.d = e;
+ if (ref_crc[main_flags])
+ __builtin_abort ();
+ return 0;
+}
return NULL;
if (TREE_CODE (oprnd0) != SSA_NAME
- || TYPE_PRECISION (TREE_TYPE (lhs)) != TYPE_PRECISION (type)
- || !INTEGRAL_TYPE_P (type))
+ || !INTEGRAL_TYPE_P (type)
+ || TYPE_PRECISION (TREE_TYPE (lhs)) != TYPE_PRECISION (type))
return NULL;
stmt_vec_info def_stmt_info;