This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Avoid explicit use of machine modes (7/n) [NOT APPLIED YET]dbxout.c


dbxout.c uses machine mode numbers to decide which R-numbers to attach
to complex types.  gdb does not use this information in detail; it
looks to see whether the R-number indicates some kind of complex type,
and then it gets the rest of what it needs from the size.  Comments in
dbxout.c and include/aout/stabs_gnu.h suggest that gdb is the only
debugger we care about for complex types.  Furthermore, stabs is
obsolescent.  Therefore I propose to rip out all of the code for this
and just generate R3 (NF_COMPLEX) always.  Thoughts?

zw

        * dbxout.c (dbxout_fptype_value): Delete.
        (dbxout_type): Emit R3 for all COMPLEX_TYPEs.

===================================================================
Index: dbxout.c
--- dbxout.c	26 Sep 2003 19:38:26 -0000	1.161
+++ dbxout.c	29 Sep 2003 22:41:29 -0000
@@ -328,7 +328,6 @@ static void dbxout_finish (const char *)
 static void dbxout_start_source_file (unsigned, const char *);
 static void dbxout_end_source_file (unsigned);
 static void dbxout_typedefs (tree);
-static void dbxout_fptype_value (tree);
 static void dbxout_type_index (tree);
 #if DBX_CONTIN_LENGTH > 0
 static void dbxout_continue (void);
@@ -806,60 +805,6 @@ dbxout_finish (const char *filename ATTR
   debug_free_queue ();
 }
 
-/* Output floating point type values used by the 'R' stab letter.
-   These numbers come from include/aout/stab_gnu.h in binutils/gdb.
-
-   There are only 3 real/complex types defined, and we need 7/6.
-   We use NF_SINGLE as a generic float type, and NF_COMPLEX as a generic
-   complex type.  Since we have the type size anyways, we don't really need
-   to distinguish between different FP types, we only need to distinguish
-   between float and complex.  This works fine with gdb.
-
-   We only use this for complex types, to avoid breaking backwards
-   compatibility for real types.  complex types aren't in ISO C90, so it is
-   OK if old debuggers don't understand the debug info we emit for them.  */
-
-/* ??? These are supposed to be IEEE types, but we don't check for that.
-   We could perhaps add additional numbers for non-IEEE types if we need
-   them.  */
-
-static void
-dbxout_fptype_value (tree type)
-{
-  char value = '0';
-  enum machine_mode mode = TYPE_MODE (type);
-
-  if (TREE_CODE (type) == REAL_TYPE)
-    {
-      if (mode == SFmode)
-	value = '1';
-      else if (mode == DFmode)
-	value = '2';
-      else if (mode == TFmode || mode == XFmode)
-	value = '6';
-      else
-	/* Use NF_SINGLE as a generic real type for other sizes.  */
-	value = '1';
-    }
-  else if (TREE_CODE (type) == COMPLEX_TYPE)
-    {
-      if (mode == SCmode)
-	value = '3';
-      else if (mode == DCmode)
-	value = '4';
-      else if (mode == TCmode || mode == XCmode)
-	value = '5';
-      else
-	/* Use NF_COMPLEX as a generic complex type for other sizes.  */
-	value = '3';
-    }
-  else
-    abort ();
-
-  putc (value, asmfile);
-  CHARS (1);
-}
-
 /* Output the index of a type.  */
 
 static void
@@ -1542,15 +1487,14 @@ dbxout_type (tree type, int full)
       break;
 
     case COMPLEX_TYPE:
-      /* Differs from the REAL_TYPE by its new data type number */
+      /* Differs from the REAL_TYPE by its new data type number.
+	 R3 is NF_COMPLEX.  We don't try to use any of the other NF_*
+	 codes since gdb doesn't care anyway.  */
 
       if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE)
 	{
-	  putc ('R', asmfile);
-	  CHARS (1);
-	  dbxout_fptype_value (type);
-	  putc (';', asmfile);
-	  CHARS (1);
+	  fputs ("R3;", asmfile);
+	  CHARS (3);
 	  print_wide_int (2 * int_size_in_bytes (TREE_TYPE (type)));
 	  fputs (";0;", asmfile);
 	  CHARS (3);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]