re PR c++/18073 (mmintrin.h rejected by C++ frontend)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Thu, 9 Dec 2004 10:34:21 +0000 (10:34 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Thu, 9 Dec 2004 10:34:21 +0000 (10:34 +0000)
PR c++/18073
* typeck.c (build_reinterpret_cast_1): Allow cast from vector type.

* g++.dg/other/mmintrin.C: New test.

From-SVN: r91929

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/mmintrin.C [new file with mode: 0644]

index 2d73639bce1433cc824553b4d862c494fd5a1584..202e416cb571d4d70a317934f8bf61f52acce7cf 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/18073
+       * typeck.c (build_reinterpret_cast_1): Allow cast from vector type.
+
 2004-12-09  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/16681
index a26bff4b56108f1e8c68be3f08c9bf8ee247445d..74380d36a92bdcc1fcfa188b4b2498301f60257e 100644 (file)
@@ -4956,6 +4956,8 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
     }
   else if (TREE_CODE (type) == VECTOR_TYPE)
     return fold_if_not_in_template (convert_to_vector (type, expr));
+  else if (TREE_CODE (intype) == VECTOR_TYPE)
+    return fold_if_not_in_template (convert_to_integer (type, expr));
   else
     {
       if (valid_p)
index d8ad0adbf58a070b3c5933600490020c12da2247..54b1dfe9da3d51c28605172e5b06c8f8b3933c17 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/18073
+       * g++.dg/other/mmintrin.C: New test.
+
 2004-12-09  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/16681
diff --git a/gcc/testsuite/g++.dg/other/mmintrin.C b/gcc/testsuite/g++.dg/other/mmintrin.C
new file mode 100644 (file)
index 0000000..417a1ac
--- /dev/null
@@ -0,0 +1,4 @@
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-options "-msse" }
+
+#include <xmmintrin.h>