Commit 9ef0c8d9 by Andrew Pinski Committed by Andrew Pinski

re PR c/30428 (vector float | vector float is accepted)

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

From-SVN: r127477
parent ab6328d0
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> 2007-08-14 Maxim Kuvyrkov <maxim@codesourcery.com>
* sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'.
......
...@@ -7892,7 +7892,11 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, ...@@ -7892,7 +7892,11 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case BIT_XOR_EXPR: case BIT_XOR_EXPR:
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
shorten = -1; 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; common = 1;
break; 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> 2007-08-11 Ian Lance Taylor <iant@google.com>
* cp-objcp-common.c (cxx_get_alias_set): Change return type to * cp-objcp-common.c (cxx_get_alias_set): Change return type to
......
...@@ -3214,7 +3214,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, ...@@ -3214,7 +3214,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case BIT_IOR_EXPR: case BIT_IOR_EXPR:
case BIT_XOR_EXPR: case BIT_XOR_EXPR:
if ((code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) 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; shorten = -1;
break; 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> 2007-08-13 Dan Hipschman <dsh@google.com>
PR c/32953 PR c/32953
/* { 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;
}
/* { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment