PR c/30428
* c-typeck.c (build_binary_op): Disallow vector float types with
BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
2007-08-14 Andrew Pinski <pinskia@gmail.com>
PR c++/30428
* typeck.c (build_binary_op): Disallow vector float types with
BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
2007-08-14 Andrew Pinski <pinskia@gmail.com>
PR c/30428
* gcc.dg/vector-2.c: New test.
PR c++/30428
* g++.dg/ext/vector8.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127477
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-08-14 Andrew Pinski <pinskia@gmail.com>
+
+ PR c/30428
+ * c-typeck.c (build_binary_op): Disallow vector float types with
+ BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
+
2007-08-14 Maxim Kuvyrkov <maxim@codesourcery.com>
* sched-int.h (struct _dep): Rename field 'kind' to 'type'.
case BIT_XOR_EXPR:
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
shorten = -1;
- else if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE)
+ /* Allow vector types which are not floating point types. */
+ else if (code0 == VECTOR_TYPE
+ && code1 == VECTOR_TYPE
+ && !VECTOR_FLOAT_TYPE_P (type0)
+ && !VECTOR_FLOAT_TYPE_P (type1))
common = 1;
break;
+2007-08-14 Andrew Pinski <pinskia@gmail.com>
+
+ PR c++/30428
+ * typeck.c (build_binary_op): Disallow vector float types with
+ BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
+
2007-08-11 Ian Lance Taylor <iant@google.com>
* cp-objcp-common.c (cxx_get_alias_set): Change return type to
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
if ((code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
- || (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE))
+ || (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE
+ && !VECTOR_FLOAT_TYPE_P (type0)
+ && !VECTOR_FLOAT_TYPE_P (type1)))
shorten = -1;
break;
+2007-08-14 Andrew Pinski <pinskia@gmail.com>
+
+ PR c/30428
+ * gcc.dg/vector-2.c: New test.
+
+ PR c++/30428
+ * g++.dg/ext/vector8.C: New test.
+
2007-08-13 Dan Hipschman <dsh@google.com>
PR c/32953
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Check for application of |, ^, and & on vector types. */
+#define vector __attribute__((vector_size(16) ))
+
+vector float a;
+vector int a1;
+vector float b;
+vector int b1;
+
+int f(void)
+{
+ a = a | b; /* { dg-error "" } */
+ a = a & b; /* { dg-error "" } */
+ a = a ^ b; /* { dg-error "" } */
+ a1 = a1 | b1;
+ a1 = a1 & b1;
+ a1 = a1 ^ b1;
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Check for application of |, ^, and & on vector types. */
+#define vector __attribute__((vector_size(16) ))
+
+vector float a;
+vector int a1;
+vector float b;
+vector int b1;
+
+int f(void)
+{
+ a = a | b; /* { dg-error "" } */
+ a = a & b; /* { dg-error "" } */
+ a = a ^ b; /* { dg-error "" } */
+ a1 = a1 | b1;
+ a1 = a1 & b1;
+ a1 = a1 ^ b1;
+}
+