OSDN Git Service

2010-09-10 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Sep 2010 15:38:20 +0000 (15:38 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Sep 2010 15:38:20 +0000 (15:38 +0000)
* dwarf2out.c (gen_array_type_die): Output DW_TAG_subrange_type
for VECTOR_TYPEs using TYPE_VECTOR_SUBPARTS.
* dbxout.c (dbxout_type): Manually deal with VECTOR_TYPE
using TYPE_VECTOR_SUBPARTS, not TYPE_DEBUG_REPRESENTATION_TYPE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164192 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dbxout.c
gcc/dwarf2out.c

index bda4cda..05fd825 100644 (file)
@@ -1,3 +1,10 @@
+2010-09-10  Richard Guenther  <rguenther@suse.de>
+
+       * dwarf2out.c (gen_array_type_die): Output DW_TAG_subrange_type
+       for VECTOR_TYPEs using TYPE_VECTOR_SUBPARTS.
+       * dbxout.c (dbxout_type): Manually deal with VECTOR_TYPE
+       using TYPE_VECTOR_SUBPARTS, not TYPE_DEBUG_REPRESENTATION_TYPE.
+
 2010-09-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR middle-end/45634
index d43a4bf..0b4c050 100644 (file)
@@ -1677,17 +1677,8 @@ static void
 dbxout_type (tree type, int full)
 {
   static int anonymous_type_number = 0;
-  bool vector_type = false;
   tree tem, main_variant, low, high;
 
-  if (TREE_CODE (type) == VECTOR_TYPE)
-    {
-      /* The frontend feeds us a representation for the vector as a struct
-        containing an array.  Pull out the array type.  */
-      type = TREE_TYPE (TYPE_FIELDS (TYPE_DEBUG_REPRESENTATION_TYPE (type)));
-      vector_type = true;
-    }
-
   if (TREE_CODE (type) == INTEGER_TYPE)
     {
       if (TREE_TYPE (type) == 0)
@@ -2020,9 +2011,6 @@ dbxout_type (tree type, int full)
          break;
        }
 
-      if (use_gnu_debug_info_extensions && vector_type)
-       stabstr_S ("@V;");
-
       /* Output "a" followed by a range type definition
         for the index type of the array
         followed by a reference to the target-type.
@@ -2049,6 +2037,22 @@ dbxout_type (tree type, int full)
       dbxout_type (TREE_TYPE (type), 0);
       break;
 
+    case VECTOR_TYPE:
+      /* Make vectors look like an array.  */
+      if (use_gnu_debug_info_extensions)
+       stabstr_S ("@V;");
+
+      /* Output "a" followed by a range type definition
+        for the index type of the array
+        followed by a reference to the target-type.
+        ar1;0;N;M for a C array of type M and size N+1.  */
+      stabstr_C ('a');
+      dbxout_range_type (integer_type_node, size_zero_node,
+                        size_int (TYPE_VECTOR_SUBPARTS (type) - 1));
+
+      dbxout_type (TREE_TYPE (type), 0);
+      break;
+
     case RECORD_TYPE:
     case UNION_TYPE:
     case QUAL_UNION_TYPE:
index d124f22..52632da 100644 (file)
@@ -17941,12 +17941,7 @@ gen_array_type_die (tree type, dw_die_ref context_die)
   equate_type_number_to_die (type, array_die);
 
   if (TREE_CODE (type) == VECTOR_TYPE)
-    {
-      /* The frontend feeds us a representation for the vector as a struct
-        containing an array.  Pull out the array type.  */
-      type = TREE_TYPE (TYPE_FIELDS (TYPE_DEBUG_REPRESENTATION_TYPE (type)));
-      add_AT_flag (array_die, DW_AT_GNU_vector, 1);
-    }
+    add_AT_flag (array_die, DW_AT_GNU_vector, 1);
 
   /* For Fortran multidimensional arrays use DW_ORD_col_major ordering.  */
   if (is_fortran ()
@@ -17969,10 +17964,20 @@ gen_array_type_die (tree type, dw_die_ref context_die)
 #ifdef MIPS_DEBUGGING_INFO
   /* The SGI compilers handle arrays of unknown bound by setting
      AT_declaration and not emitting any subrange DIEs.  */
-  if (! TYPE_DOMAIN (type))
+  if (TREE_CODE (type) == ARRAY_TYPE
+      && ! TYPE_DOMAIN (type))
     add_AT_flag (array_die, DW_AT_declaration, 1);
   else
 #endif
+  if (TREE_CODE (type) == VECTOR_TYPE)
+    {
+      /* For VECTOR_TYPEs we use an array die with appropriate bounds.  */
+      dw_die_ref subrange_die = new_die (DW_TAG_subrange_type, array_die, NULL);
+      add_bound_info (subrange_die, DW_AT_lower_bound, size_zero_node);
+      add_bound_info (subrange_die, DW_AT_upper_bound,
+                     size_int (TYPE_VECTOR_SUBPARTS (type) - 1));
+    }
+  else
     add_subscript_info (array_die, type, collapse_nested_arrays);
 
   /* Add representation of the type of the elements of this array type and