We've traditionally allowed vectors of enums (not sure if that's
deliberate) but vector_types_compatible_elements_p checked for
INTEGER_TYPE rather than INTEGRAL_TYPE_P.
2018-10-08 Richard Sandiford <richard.sandiford@arm.com>
gcc/c-family/
PR c/87286
* c-common.c (vector_types_compatible_elements_p): Use
INTEGRAL_TYPE_P instead of checking only for INTEGER_TYPE.
gcc/testsuite/
PR c/87286
* gcc.dg/pr87286.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264913
138bc75d-0d04-0410-961f-
82ee72b054a4
+2018-10-08 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR c/87286
+ * c-common.c (vector_types_compatible_elements_p): Use
+ INTEGRAL_TYPE_P instead of checking only for INTEGER_TYPE.
+
2018-10-04 Vinay Kumar <vinay.kumar@blackfigtech.com>
* c-attribs.c (get_priority): Add a warning flag warn_prio_ctor_dtor
enum tree_code c1 = TREE_CODE (t1), c2 = TREE_CODE (t2);
- gcc_assert ((c1 == INTEGER_TYPE || c1 == REAL_TYPE || c1 == FIXED_POINT_TYPE)
- && (c2 == INTEGER_TYPE || c2 == REAL_TYPE
+ gcc_assert ((INTEGRAL_TYPE_P (t1)
+ || c1 == REAL_TYPE
+ || c1 == FIXED_POINT_TYPE)
+ && (INTEGRAL_TYPE_P (t2)
+ || c2 == REAL_TYPE
|| c2 == FIXED_POINT_TYPE));
t1 = c_common_signed_type (t1);
if (t1 == t2)
return true;
if (opaque && c1 == c2
- && (c1 == INTEGER_TYPE || c1 == REAL_TYPE)
+ && (INTEGRAL_TYPE_P (t1) || c1 == REAL_TYPE)
&& TYPE_PRECISION (t1) == TYPE_PRECISION (t2))
return true;
return false;
+2018-10-08 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR c/87286
+ * gcc.dg/pr87286.c: New test.
+
2018-10-06 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/86111
--- /dev/null
+enum foo { F };
+typedef enum foo vec_foo __attribute__((vector_size (16)));
+vec_foo add (vec_foo x, vec_foo y) { return x + y; }