From: Aldy Hernandez Date: Fri, 30 Jan 2004 00:42:22 +0000 (+0000) Subject: backport: re PR c++/11895 (ICE in reshape_init on "attribute(vector_size(16)) int") X-Git-Tag: releases/gcc-3.3.3~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f54f8afeda3e08943e26dc2f11eefbd9c9c2233;p=thirdparty%2Fgcc.git backport: re PR c++/11895 (ICE in reshape_init on "attribute(vector_size(16)) int") 2004-01-29 Aldy Hernandez Backport: 2004-01-17 Fred Fish PR c++/11895 * cp/decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE, except don't call array_type_nelts() with a VECTOR_TYPE. From-SVN: r76914 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d6368f4b484e..65a2fb5c6bc7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2004-01-29 Aldy Hernandez + + Backport: + + 2004-01-17 Fred Fish + + PR c++/11895 + * cp/decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE, + except don't call array_type_nelts() with a VECTOR_TYPE. + 2004-01-29 Aldy Hernandez Backport: diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index cbf6d0c40738..6fa881247b4c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8373,14 +8373,14 @@ reshape_init (tree type, tree *initp) } } } - else if (TREE_CODE (type) == ARRAY_TYPE) + else if ((TREE_CODE (type) == ARRAY_TYPE)|| (TREE_CODE (type) == VECTOR_TYPE)) { tree index; tree max_index; /* If the bound of the array is known, take no more initializers than are allowed. */ - max_index = (TYPE_DOMAIN (type) + max_index = ((TYPE_DOMAIN (type) && (TREE_CODE (type) == ARRAY_TYPE)) ? array_type_nelts (type) : NULL_TREE); /* Loop through the array elements, gathering initializers. */ for (index = size_zero_node;