This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] fix PR c++/18073
- From: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 08 Dec 2004 17:52:56 +0100 (CET)
- Subject: [patch] fix PR c++/18073
The include file xmmintrin.h has been rejected on mainline
by the C++ frontend since Mark's casting patch
http://gcc.gnu.org/ml/gcc-cvs/2004-10/msg01166.html
which flagged casting from/to vectors as invalid.
Mark added the casting *to* vectors in
http://gcc.gnu.org/ml/gcc-cvs/2004-10/msg01279.html
but the casting *from* vectors still doesn't work.
The following patch adds the missing bit.
Bootstrapped and regtested on i686-pc-linux-gnu. Ok to commit?
Regards,
Volker
2004-12-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* typeck.c (build_reinterpret_cast_1): Allow cast from vector.
Index: gcc/gcc/cp/typeck.c
===================================================================
RCS file: /home/reichelt/GCC/CVS/gcc-cvs/gcc/gcc/cp/typeck.c,v
retrieving revision 1.600
diff -u -p -r1.600 typeck.c
--- gcc/gcc/cp/typeck.c 26 Nov 2004 15:45:47 -0000 1.600
+++ gcc/gcc/cp/typeck.c 8 Dec 2004 12:09:24 -0000
@@ -4972,6 +4972,8 @@ build_reinterpret_cast_1 (tree type, tre
}
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)
===================================================================