Fix stabs bug with C array ranges.
authorJim Wilson <wilson@cygnus.com>
Thu, 23 Jul 1998 19:14:18 +0000 (19:14 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 23 Jul 1998 19:14:18 +0000 (12:14 -0700)
* dbxout.c (dbxout_range_type): Only call dbxout_type_index for
already defined type.

From-SVN: r21355

gcc/ChangeLog
gcc/dbxout.c

index f3e1fcc07161eedb60a4fb82cb1ea36932f49460..97b5457f128c433344bd95655e13f028c330af1c 100644 (file)
@@ -1,3 +1,8 @@
+Thu Jul 23 18:53:20 1998  Jim Wilson  <wilson@cygnus.com>
+
+       * dbxout.c (dbxout_range_type): Only call dbxout_type_index for
+       already defined type.
+
 Thu Jul 23 13:49:41 1998  Jeffrey A Law  (law@cygnus.com)
 
        * expr.c (check_max_integer_computation_mode): Allow conversions
index 9cdcef00474c493e09da51e6a41a2b1a65c0ee32..5e6f2a9d874e7e4e176476c0edc0af8de82e95af 100644 (file)
@@ -954,8 +954,18 @@ dbxout_range_type (type)
         were defined to be sub-ranges of int.  Unfortunately, this
         does not allow us to distinguish true sub-ranges from integer
         types.  So, instead we define integer (non-sub-range) types as
-        sub-ranges of themselves.  */
-      dbxout_type_index (type);
+        sub-ranges of themselves.  This matters for Chill.  If this isn't
+        a subrange type, then we want to define it in terms of itself.
+        However, in C, this may be an anonymous integer type, and we don't
+        want to emit debug info referring to it.  Just calling
+        dbxout_type_index won't work anyways, because the type hasn't been
+        defined yet.  We make this work for both cases by checked to see
+        whether this is a defined type, referring to it if it is, and using
+        'int' otherwise.  */
+      if (TYPE_SYMTAB_ADDRESS (type) != 0)
+       dbxout_type_index (type);
+      else
+       dbxout_type_index (integer_type_node);
     }
   if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST)
     {