------- Comment #2 from pinskia at gcc dot gnu dot org 2006-08-18 03:54 -------
Here is a patch (though I have looked to see if it works with templates yet):
Index: init.c
===================================================================
--- init.c (revision 116236)
+++ init.c (working copy)
@@ -178,7 +178,8 @@ build_zero_init (tree type, tree nelts,
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,
/* 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);
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-08-18 03:54:40
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28450