re PR c++/30016 (internal compiler error: in convert_move, at expr.c:362)

2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C++/30016
        * typeck.c (build_reinterpret_cast_1): Only allow conversion to
        integeral types from vectors types.

2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C++/30016
        * g++.dg/ext/vector6.C: New test.

From-SVN: r124208
This commit is contained in:
Andrew Pinski 2007-04-27 01:31:25 +00:00 committed by Andrew Pinski
parent 45e6714b9a
commit d333b74f94
4 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/30016
* typeck.c (build_reinterpret_cast_1): Only allow conversion to
integeral types from vectors types.
2007-04-26 Jakub Jelinek <jakub@redhat.com>
PR c++/31598

View file

@ -5341,7 +5341,7 @@ 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)
else if (TREE_CODE (intype) == VECTOR_TYPE && INTEGRAL_TYPE_P (type))
return fold_if_not_in_template (convert_to_integer (type, expr));
else
{

View file

@ -1,3 +1,8 @@
2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/30016
* g++.dg/ext/vector6.C: New test.
2007-04-26 Kazu Hirata <kazu@codesourcery.com>
* gcc.c-torture/execute/ieee/20000320-1.x: New.

View file

@ -0,0 +1,12 @@
// { dg-options "" }
// { dg-do compile }
// C++/30016, we were allowing conversion between vector types
// and union types which is invalid.
typedef float __v_4F __attribute__ ((vector_size (16)));
typedef union {__v_4F v; float a[4];} __v4F;
void f(void)
{
__v_4F b;
(reinterpret_cast<__v4F>(b).a)[1] = 1; // { dg-error "" }
}