dwarf2out.c (gen_array_type_die, [...]): For Fortran multi-dimensional arrays use...
authorJakub Jelinek <jakub@redhat.com>
Mon, 10 Dec 2007 13:05:15 +0000 (14:05 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 10 Dec 2007 13:05:15 +0000 (14:05 +0100)
* dwarf2out.c (gen_array_type_die, gen_descr_array_type_die): For
Fortran multi-dimensional arrays use DW_AT_ordering
DW_ORD_col_major.

From-SVN: r130742

gcc/ChangeLog
gcc/dwarf2out.c

index 9d6a077ff7d31869616727bd04caa8ca655b39d5..d9dbd4910fc1dff86afeffb2ce28267df0b36987 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-10  Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf2out.c (gen_array_type_die, gen_descr_array_type_die): For
+       Fortran multi-dimensional arrays use DW_AT_ordering
+       DW_ORD_col_major.
+
 2007-12-10  Paolo Bonzini  <bonzini@gnu.org>
 
        PR target/32086
index d818f0d998958314def39671a81c205edac1fd99..785d0fa9691301610cd1051187ad266b1d7fcd71 100644 (file)
@@ -11636,6 +11636,12 @@ gen_array_type_die (tree type, dw_die_ref context_die)
       add_AT_flag (array_die, DW_AT_GNU_vector, 1);
     }
 
+  /* For Fortran multidimensional arrays use DW_ORD_col_major ordering.  */
+  if (is_fortran ()
+      && TREE_CODE (type) == ARRAY_TYPE
+      && TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE)
+    add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);
+
 #if 0
   /* We default the array ordering.  SDB will probably do
      the right things even if DW_AT_ordering is not present.  It's not even
@@ -11787,6 +11793,11 @@ gen_descr_array_type_die (tree type, struct array_descr_info *info,
   add_name_attribute (array_die, type_tag (type));
   equate_type_number_to_die (type, array_die);
 
+  /* For Fortran multidimensional arrays use DW_ORD_col_major ordering.  */
+  if (is_fortran ()
+      && info->ndimensions >= 2)
+    add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);
+
   if (info->data_location)
     add_descr_info_field (array_die, DW_AT_data_location, info->data_location,
                          info->base_decl);