re PR c++/28450 (ICE with new and complex/vector types)

2006-08-21  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/28450
        * cp/init.c (build_zero_init): Handle VECTOR_TYPE and
        COMPLEX_TYPEs.


2006-08-21  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/28450
        * g++.dg/ext/vector4.C: New test.
        * g++.dg/ext/complex1.C: New test.

From-SVN: r116341
This commit is contained in:
Andrew Pinski 2006-08-23 02:56:43 +00:00 committed by Andrew Pinski
parent bee7c39239
commit c846e8cd67
5 changed files with 28 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2006-08-22 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/28450
* cp/init.c (build_zero_init): Handle VECTOR_TYPE and
COMPLEX_TYPEs.
2006-08-22 Simon Martin <simartin@users.sourceforge.net>
PR c++/28420

View file

@ -178,7 +178,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
items with static storage duration that are not otherwise
initialized are initialized to zero. */
;
else if (SCALAR_TYPE_P (type))
else if (SCALAR_TYPE_P (type)
|| TREE_CODE (type) == COMPLEX_TYPE)
init = convert (type, integer_zero_node);
else if (CLASS_TYPE_P (type))
{
@ -248,6 +249,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
/* Build a constructor to contain the initializations. */
init = build_constructor (type, v);
}
else if (TREE_CODE (type) == VECTOR_TYPE)
init = fold_convert (type, integer_zero_node);
else
gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);

View file

@ -1,3 +1,9 @@
2006-08-22 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/28450
* g++.dg/ext/vector4.C: New test.
* g++.dg/ext/complex1.C: New test.
2006-08-21 Geoffrey Keating <geoffk@apple.com>
PR debug/28692

View file

@ -0,0 +1,6 @@
/* { dg-options "" } */
/* { dg-do compile } */
// Testing if we can do a new of a complex type
// PR C++/28450
void* q = new __complex__ int ();

View file

@ -0,0 +1,6 @@
/* { dg-options "" } */
/* { dg-do compile } */
// Testing if we can do a new of a vector
// PR C++/28450
void* q = new int __attribute__((vector_size(8))) ();