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:
parent
45e6714b9a
commit
d333b74f94
4 changed files with 24 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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.
|
||||
|
|
12
gcc/testsuite/g++.dg/ext/vector6.C
Normal file
12
gcc/testsuite/g++.dg/ext/vector6.C
Normal 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 "" }
|
||||
}
|
Loading…
Add table
Reference in a new issue