[PATCH] Disallow bitwise operations (&, ^, and |) on vector float types (PR 30428)

Andrew Pinski pinskia@gmail.com
Tue Aug 14 00:37:00 GMT 2007


Hi,
  Currently both the C and C++ allow binary bitwise operations on the
vector float types.  This does not make sense as the standard does not
allow it for floating point types, vector types should follow what is
allowed for the base types also.

This patch disallows binary bitwise operations on vector float types
like what is done for floating point types.

OK?  Bootstrapped and tested on i386-apple-darwin8.10 with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
* c-typeck.c (build_binary_op): Disallow vector float types with
BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.

cp/ChangeLog:
* typeck.c (build_binary_op): Disallow vector float types with
BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.

testsuite/ChangeLog:
* gcc.dg/vector-2.c: New test.
* g++.dg/ext/vector8.C: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixpr30428.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070814/8e3cd1b1/attachment.txt>


More information about the Gcc-patches mailing list