]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (reshape_init_vector): For VECTOR_TYPEs...
authorRichard Biener <rguenth@gcc.gnu.org>
Fri, 10 Sep 2010 15:37:13 +0000 (15:37 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 10 Sep 2010 15:37:13 +0000 (15:37 +0000)
2010-09-10  Richard Guenther  <rguenther@suse.de>

* decl.c (reshape_init_vector): For VECTOR_TYPEs, use
TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.

From-SVN: r164191

gcc/cp/ChangeLog
gcc/cp/decl.c

index 54d0ef625ed3ab831f43cccf1b05b7689c5d9905..a5d46a8d679b911c49ee8a528e59778a8bc15327 100644 (file)
@@ -1,7 +1,13 @@
+2010-09-10  Richard Guenther  <rguenther@suse.de>
+
+       * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
+       TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
+
 2010-09-10  Jan Hubicka  <jh@suse.cz>
 
        PR tree-optimization/45605
-       * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in ADDR_EXPR
+       * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
+       ADDR_EXPR.
 
 2010-09-08  Jakub Jelinek  <jakub@redhat.com>
 
index ad4a0973d9d52afddb67b8b41695f66725b3f06f..8ca69da2866e162548fd95d9ebf3731809d613f3 100644 (file)
@@ -4891,7 +4891,6 @@ static tree
 reshape_init_vector (tree type, reshape_iter *d)
 {
   tree max_index = NULL_TREE;
-  tree rtype;
 
   gcc_assert (TREE_CODE (type) == VECTOR_TYPE);
 
@@ -4908,12 +4907,9 @@ reshape_init_vector (tree type, reshape_iter *d)
       return value;
     }
 
-  /* For a vector, the representation type is a struct
-      containing a single member which is an array of the
-      appropriate size.  */
-  rtype = TYPE_DEBUG_REPRESENTATION_TYPE (type);
-  if (rtype && TYPE_DOMAIN (TREE_TYPE (TYPE_FIELDS (rtype))))
-    max_index = array_type_nelts (TREE_TYPE (TYPE_FIELDS (rtype)));
+  /* For a vector, we initialize it as an array of the appropriate size.  */
+  if (TREE_CODE (type) == VECTOR_TYPE)
+    max_index = size_int (TYPE_VECTOR_SUBPARTS (type) - 1);
 
   return reshape_init_array_1 (TREE_TYPE (type), max_index, d);
 }