+2018-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/84999
+ * c-typeck.c (build_binary_op): If c_common_type_for_size fails when
+ building vector comparison, diagnose it and return error_mark_node.
+
2018-03-15 Jakub Jelinek <jakub@redhat.com>
PR c/84853
intt = c_common_type_for_size (GET_MODE_BITSIZE
(SCALAR_TYPE_MODE
(TREE_TYPE (type0))), 0);
+ if (!intt)
+ {
+ error_at (location, "could not find an integer type "
+ "of the same size as %qT",
+ TREE_TYPE (type0));
+ return error_mark_node;
+ }
result_type = build_opaque_vector_type (intt,
TYPE_VECTOR_SUBPARTS (type0));
converted = 1;
intt = c_common_type_for_size (GET_MODE_BITSIZE
(SCALAR_TYPE_MODE
(TREE_TYPE (type0))), 0);
+ if (!intt)
+ {
+ error_at (location, "could not find an integer type "
+ "of the same size as %qT",
+ TREE_TYPE (type0));
+ return error_mark_node;
+ }
result_type = build_opaque_vector_type (intt,
TYPE_VECTOR_SUBPARTS (type0));
converted = 1;
--- /dev/null
+/* PR c/84999 */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "" } */
+
+typedef __float128 V __attribute__ ((__vector_size__ (2 * sizeof (__float128))));
+V a;
+typeof (a != 0) b; /* { dg-error "could not find an integer type of the same size as" "" { target ia32 } } */
+typeof (a == 0) c; /* { dg-error "could not find an integer type of the same size as" "" { target ia32 } } */
+typeof (a < 0) d; /* { dg-error "could not find an integer type of the same size as" "" { target ia32 } } */
+typeof (a <= 0) e; /* { dg-error "could not find an integer type of the same size as" "" { target ia32 } } */
+typeof (a > 0) f; /* { dg-error "could not find an integer type of the same size as" "" { target ia32 } } */
+typeof (a >= 0) g; /* { dg-error "could not find an integer type of the same size as" "" { target ia32 } } */