]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/11895 (ICE in reshape_init on "attribute(vector_size(16)) int")
authorAldy Hernandez <aldyh@redhat.com>
Fri, 30 Jan 2004 00:42:22 +0000 (00:42 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Fri, 30 Jan 2004 00:42:22 +0000 (00:42 +0000)
2004-01-29  Aldy Hernandez  <aldyh@redhat.com>

        Backport:

        2004-01-17  Fred Fish  <fnf@intrinsity.com>

        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
gcc/cp/decl.c

index d6368f4b484e6fabd3e762ad83d4f264f34be877..65a2fb5c6bc7e7eb23a5dfbdadd5b3cfed0a48e1 100644 (file)
@@ -1,3 +1,13 @@
+2004-01-29  Aldy Hernandez  <aldyh@redhat.com>
+                                                                                
+        Backport:
+                                                                                
+        2004-01-17  Fred Fish  <fnf@intrinsity.com>
+                                                                                
+        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  <aldyh@redhat.com>
 
        Backport:
index cbf6d0c40738892fdbffd38086bd87a678432080..6fa881247b4c45c48bb529cc6d1f6c0ca67a0b61 100644 (file)
@@ -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;