From 6f54f8afeda3e08943e26dc2f11eefbd9c9c2233 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Fri, 30 Jan 2004 00:42:22 +0000 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 10 ++++++++++ gcc/cp/decl.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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; -- 2.47.2