[PATCH][C++] Don't use TYPE_DEBUG_REPRESENTATION_TYPE

Richard Guenther rguenther@suse.de
Thu Sep 9 15:11:00 GMT 2010


This gets rid of the only FE user of TYPE_DEBUG_REPRESENTATION_TYPE
(which I consider gross - we are re-bulding the RECORD_TYPE part of
it over and over during vectorization).  The C++ frontend can as easily use
TYPE_VECTOR_SUBPARTS for determining the maximum index for an
initializer.

Bootstrap and regtest running on x86_64-unknonw-linux-gnu, ok if
that succeeds?

Thanks,
Richard.

2010-09-09  Richard Guenther  <rguenther@suse.de>

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

Index: gcc/cp/decl.c
===================================================================
*** gcc/cp/decl.c	(revision 164000)
--- gcc/cp/decl.c	(working copy)
*************** static tree
*** 4891,4897 ****
  reshape_init_vector (tree type, reshape_iter *d)
  {
    tree max_index = NULL_TREE;
-   tree rtype;
  
    gcc_assert (TREE_CODE (type) == VECTOR_TYPE);
  
--- 4891,4896 ----
*************** reshape_init_vector (tree type, reshape_
*** 4908,4919 ****
        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)));
  
    return reshape_init_array_1 (TREE_TYPE (type), max_index, d);
  }
--- 4907,4915 ----
        return value;
      }
  
!   /* 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);
  }



More information about the Gcc-patches mailing list