HPPA merge.
[deliverable/binutils-gdb.git] / gdb / buildsym.c
index eab5e2880bbe953d7ee9accec134bb027ea4dec2..24552edf803cffe3128f94f6354057c27bcf27b9 100644 (file)
@@ -1,5 +1,6 @@
 /* Build symbol tables in GDB's internal format.
-   Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992
+             Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -24,7 +25,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    They originated in dbxread.c of gdb-4.2, and were split out to
    make xcoffread.c more maintainable by sharing code.  */
 
-#include <stdio.h>
 #include "defs.h"
 #include "obstack.h"
 #include "symtab.h"
@@ -32,7 +32,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "breakpoint.h"
 #include "gdbcore.h"           /* for bfd stuff for symfile.h */
 #include "symfile.h"           /* Needed for "struct complaint" */
-#include "aout/stab_gnu.h"             /* We always use GNU stabs, not native */
+#include "objfiles.h"
+#include "aout/stab_gnu.h"     /* We always use GNU stabs, not native */
 #include <string.h>
 #include <ctype.h>
 
@@ -66,6 +67,12 @@ cleanup_undefined_types PARAMS ((void));
 static struct type *
 read_range_type PARAMS ((char **, int [2], struct objfile *));
 
+static struct type *
+read_sun_builtin_type PARAMS ((char **, int [2], struct objfile *));
+
+static struct type *
+read_sun_floating_type PARAMS ((char **, int [2], struct objfile *));
+
 static struct type *
 read_enum_type PARAMS ((char **, struct type *, struct objfile *));
 
@@ -147,6 +154,9 @@ struct complaint invalid_member_complaint =
 
 struct complaint range_type_base_complaint =
   {"base type %d of range type is not defined", 0, 0};
+
+struct complaint reg_value_complaint =
+  {"register number too large in symbol %s", 0, 0};
 \f
 int
 hashname (name)
@@ -186,6 +196,9 @@ dbx_lookup_type (typenums)
   register int filenum = typenums[0], index = typenums[1];
   unsigned old_len;
 
+  if (filenum == -1)           /* -1,-1 is for temporary types.  */
+    return 0;
+
   if (filenum < 0 || filenum >= n_this_object_header_files)
     error ("Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
           filenum, index, symnum);
@@ -249,30 +262,19 @@ dbx_alloc_type (typenums, objfile)
      struct objfile *objfile;
 {
   register struct type **type_addr;
-  register struct type *type;
 
-  if (typenums[0] != -1)
-    {
-      type_addr = dbx_lookup_type (typenums);
-      type = *type_addr;
-    }
-  else
-    {
-      type_addr = 0;
-      type = 0;
-    }
+  if (typenums[0] == -1)
+    return alloc_type (objfile);
+
+  type_addr = dbx_lookup_type (typenums);
 
   /* If we are referring to a type not known at all yet,
      allocate an empty type for it.
      We will fill it in later if we find out how.  */
-  if (type == 0)
-    {
-      type = alloc_type (objfile);
-      if (type_addr)
-       *type_addr = type;
-    }
-  
-  return type;
+  if (*type_addr == 0)
+    *type_addr = alloc_type (objfile);
+
+  return *type_addr;
 }
 \f
 /* maintain the lists of symbols and blocks */
@@ -340,7 +342,7 @@ really_free_pendings (foo)
   for (next = free_pendings; next; next = next1)
     {
       next1 = next->next;
-      free (next);
+      free ((PTR)next);
     }
   free_pendings = 0;
 
@@ -348,7 +350,7 @@ really_free_pendings (foo)
   for (bnext = pending_blocks; bnext; bnext = bnext1)
     {
       bnext1 = bnext->next;
-      free (bnext);
+      free ((PTR)bnext);
     }
 #endif
   pending_blocks = 0;
@@ -356,14 +358,14 @@ really_free_pendings (foo)
   for (next = file_symbols; next; next = next1)
     {
       next1 = next->next;
-      free (next);
+      free ((PTR)next);
     }
   file_symbols = 0;
 
   for (next = global_symbols; next; next = next1)
     {
       next1 = next->next;
-      free (next);
+      free ((PTR)next);
     }
   global_symbols = 0;
 }
@@ -592,7 +594,6 @@ push_subfile ()
   if (current_subfile == 0 || current_subfile->name == 0)
     abort ();
   tem->name = current_subfile->name;
-  tem->prev_index = header_file_prev_index;
 }
 
 char *
@@ -606,8 +607,7 @@ pop_subfile ()
 
   name = link->name;
   subfile_stack = link->next;
-  header_file_prev_index = link->prev_index;
-  free (link);
+  free ((PTR)link);
 
   return name;
 }
@@ -689,7 +689,6 @@ start_symtab (name, dirname, start_addr)
 
   /* Leave FILENUM of 0 free for builtin types and this file's types.  */
   n_this_object_header_files = 1;
-  header_file_prev_index = -1;
 
   type_vector_length = 0;
   type_vector = (struct type **) 0;
@@ -726,7 +725,9 @@ patch_block_stabs (symbols, stabs, objfile)
          struct symbol *sym = find_symbol_in_list (symbols, name, pp-name);
          if (!sym)
            {
+#ifndef IBM6000_TARGET
              printf ("ERROR! stab symbol not found!\n");       /* FIXME */
+#endif
            }
          else
            {
@@ -818,7 +819,7 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile)
 
   if (global_stabs) {
     patch_block_stabs (global_symbols, global_stabs, objfile);
-    free (global_stabs);
+    free ((PTR)global_stabs);
     global_stabs = 0;
   }
 
@@ -880,7 +881,7 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile)
        symtab->free_code = free_linetable;
        symtab->free_ptr = 0;
 
-#if 0 /* defined(IBM6000) */
+#ifdef IBM6000_TARGET
        /* In case we need to duplicate symbol tables (to represent include
           files), and in case our system needs relocation, we want to
           relocate the main symbol table node only (for the main file,
@@ -890,17 +891,17 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile)
 #endif
       }
       if (subfile->line_vector)
-       free (subfile->line_vector);
+       free ((PTR)subfile->line_vector);
 
       nextsub = subfile->next;
-      free (subfile);
+      free ((PTR)subfile);
     }
 
-#if 0 /* defined(IBM6000) */
+#ifdef IBM6000_TARGET
   /* all include symbol tables are non-relocatable, except the main source
      file's. */
-  if (symtab_list)
-    symtab_list->nonreloc = FALSE;
+  if (symtab)
+    symtab->nonreloc = FALSE;
 #endif
 
   if (type_vector)
@@ -1077,6 +1078,13 @@ define_symbol (valu, string, desc, type, objfile)
   register int i;
   struct type *temptype;
 
+  /* We would like to eliminate nameless symbols, but keep their types.
+     E.g. stab entry ":t10=*2" should produce a type 10, which is a pointer
+     to type 2, but, should not creat a symbol to address that type. Since
+     the symbol will be nameless, there is no way any user can refer to it. */
+
+  int nameless;
+
   /* Ignore syms with empty names.  */
   if (string[0] == 0)
     return 0;
@@ -1085,6 +1093,10 @@ define_symbol (valu, string, desc, type, objfile)
   if (p == 0)
     return 0;
 
+  /* If a nameless stab entry, all we need is the type, not the symbol.
+     e.g. ":t10=*2" */
+  nameless = (p == string);
+
   sym = (struct symbol *)obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
 
   if (processing_gcc_compilation) {
@@ -1143,7 +1155,16 @@ define_symbol (valu, string, desc, type, objfile)
      Handle Sun-style local fortran array types 'ar...' . 
      (gnu@cygnus.com) -- this strchr() handles them properly?
      (tiemann@cygnus.com) -- 'C' is for catch.  */
+
+#ifdef IBM6000_TARGET
+
+  /* 'R' is for register parameters. */
+
+  if (!strchr ("cfFGpPrStTvVXCR", *p))
+#else
+
   if (!strchr ("cfFGpPrStTvVXC", *p))
+#endif
     deftype = 'l';
   else
     deftype = *p++;
@@ -1221,6 +1242,12 @@ define_symbol (valu, string, desc, type, objfile)
       SYMBOL_TYPE (sym)
        = lookup_pointer_type (lookup_function_type (read_type (&p, objfile)));
     }
+
+#ifdef IBM6000_TARGET
+  else if (deftype == 'R')
+      SYMBOL_TYPE (sym) = read_type (&p, objfile);
+#endif
+
   else
     {
       struct type *type_read;
@@ -1242,13 +1269,27 @@ define_symbol (valu, string, desc, type, objfile)
         save away the name so that far away from here in read_range_type,
         we can examine it to decide between "int" and "long".  FIXME.  */
       long_kludge_name = SYMBOL_NAME (sym);
+
       type_read = read_type (&p, objfile);
 
+      if ((deftype == 'F' || deftype == 'f') && *p == ';') {
+       /* Sun acc puts declared types of aguments here.  We don't care
+          about their actual types (FIXME -- we should remember the whole
+          function prototype), but the list
+          may define some new types that we have to remember, so we must
+          scan them now.  */
+        while (*p == ';') {
+          p++;
+          read_type (&p, objfile);
+       }
+      }
+
       if ((deftype == 'F' || deftype == 'f')
          && TYPE_CODE (type_read) != TYPE_CODE_FUNC)
       {
 #if 0
 /* This code doesn't work -- it needs to realloc and can't.  */
+/* Attempt to set up to record a function prototype... */
        struct type *new = (struct type *)
          obstack_alloc (&objfile -> type_obstack,
                         sizeof (struct type));
@@ -1391,17 +1432,42 @@ define_symbol (valu, string, desc, type, objfile)
 #endif /* no BELIEVE_PCC_PROMOTION_TYPE.  */
 
     case 'P':
+      /* Parameter which is in a register.  */
+
+      /* acc seems to use P to delare the types of functions that
+         are called by this file.  gdb is not prepared to deal
+         with this extra information.  */
+      if (processing_acc_compilation)
+       break;
+
       SYMBOL_CLASS (sym) = LOC_REGPARM;
       SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
+      if (SYMBOL_VALUE (sym) >= NUM_REGS)
+       {
+         complain (&reg_value_complaint, SYMBOL_NAME (sym));
+         SYMBOL_VALUE (sym) = SP_REGNUM;  /* Known safe, though useless */
+       }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       add_symbol_to_list (sym, &local_symbols);
       break;
 
+#ifdef IBM6000_TARGET
+    case 'R':
+#endif
     case 'r':
+      /* Register variable (either global or local).  */
       SYMBOL_CLASS (sym) = LOC_REGISTER;
       SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
+      if (SYMBOL_VALUE (sym) >= NUM_REGS)
+       {
+         complain (&reg_value_complaint, SYMBOL_NAME (sym));
+         SYMBOL_VALUE (sym) = SP_REGNUM;  /* Known safe, though useless */
+       }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-      add_symbol_to_list (sym, &local_symbols);
+      if (within_function)
+        add_symbol_to_list (sym, &local_symbols);
+      else
+        add_symbol_to_list (sym, &file_symbols);
       break;
 
     case 'S':
@@ -1413,19 +1479,19 @@ define_symbol (valu, string, desc, type, objfile)
       break;
 
     case 't':
+      /* For a nameless type, we don't want a create a symbol, thus we
+        did not use `sym'. Return without further processing. */
+      if (nameless) return NULL;
+
       SYMBOL_CLASS (sym) = LOC_TYPEDEF;
       SYMBOL_VALUE (sym) = valu;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-      if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL)
-       TYPE_NAME (SYMBOL_TYPE (sym)) =
-         obsavestring (SYMBOL_NAME (sym),
-                       strlen (SYMBOL_NAME (sym)),
-                       &objfile -> symbol_obstack);
-       /* C++ vagaries: we may have a type which is derived from
-        a base type which did not have its name defined when the
-        derived class was output.  We fill in the derived class's
-        base part member's name here in that case.  */
-       else if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
+      /* C++ vagaries: we may have a type which is derived from
+       a base type which did not have its name defined when the
+       derived class was output.  We fill in the derived class's
+       base part member's name here in that case.  */
+      if (TYPE_NAME (SYMBOL_TYPE (sym)) != NULL)
+        if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
                 || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION)
                && TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)))
         {
@@ -1440,6 +1506,10 @@ define_symbol (valu, string, desc, type, objfile)
       break;
 
     case 'T':
+      /* For a nameless type, we don't want a create a symbol, thus we
+        did not use `sym'. Return without further processing. */
+      if (nameless) return NULL;
+
       SYMBOL_CLASS (sym) = LOC_TYPEDEF;
       SYMBOL_VALUE (sym) = valu;
       SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
@@ -1858,23 +1928,30 @@ read_type (pp, objfile)
        *dbx_lookup_type (typenums) = type;
       break;
 
+    /* In the following types, we must be sure to overwrite any existing
+       type that the typenums refer to, rather than allocating a new one
+       and making the typenums point to the new one.  This is because there
+       may already be pointers to the existing type (if it had been
+       forward-referenced), and we must change it to a pointer, function,
+       reference, or whatever, *in-place*.  */
+
     case '*':
       type1 = read_type (pp, objfile);
-/* FIXME -- we should be doing smash_to_XXX types here.  */
-#if 0
-    /* postponed type decoration should be allowed. */
-    if (typenums[1] > 0 && typenums[1] < type_vector_length &&
-       (type = type_vector[typenums[1]])) {
-      smash_to_pointer_type (type, type1);
+      type = make_pointer_type (type1, dbx_lookup_type (typenums));
       break;
-    }
-#endif
-      type = lookup_pointer_type (type1);
-      if (typenums[0] != -1)
-       *dbx_lookup_type (typenums) = type;
+
+    case '&':                          /* Reference to another type */
+      type1 = read_type (pp, objfile);
+      type = make_reference_type (type1, dbx_lookup_type (typenums));
+      break;
+
+    case 'f':                          /* Function returning another type */
+      type1 = read_type (pp, objfile);
+      type = make_function_type (type1, dbx_lookup_type (typenums));
       break;
 
-    case '@':
+/* FIXME -- we should be doing smash_to_XXX types here.  */
+    case '@':                          /* Member (class & variable) type */
       {
        struct type *domain = read_type (pp, objfile);
        struct type *memtype;
@@ -1890,7 +1967,7 @@ read_type (pp, objfile)
       }
       break;
 
-    case '#':
+    case '#':                          /* Method (class & fn) type */
       if ((*pp)[0] == '#')
        {
          /* We'll get the parameter types from the name.  */
@@ -1921,33 +1998,31 @@ read_type (pp, objfile)
        }
       break;
 
-    case '&':
-      type1 = read_type (pp, objfile);
-      type = lookup_reference_type (type1);
+    case 'r':                          /* Range type */
+      type = read_range_type (pp, typenums, objfile);
       if (typenums[0] != -1)
        *dbx_lookup_type (typenums) = type;
       break;
 
-    case 'f':
-      type1 = read_type (pp, objfile);
-      type = lookup_function_type (type1);
+    case 'b':                          /* Sun ACC builtin int type */
+      type = read_sun_builtin_type (pp, typenums, objfile);
       if (typenums[0] != -1)
        *dbx_lookup_type (typenums) = type;
       break;
 
-    case 'r':
-      type = read_range_type (pp, typenums, objfile);
+    case 'R':                          /* Sun ACC builtin float type */
+      type = read_sun_floating_type (pp, typenums, objfile);
       if (typenums[0] != -1)
        *dbx_lookup_type (typenums) = type;
       break;
-
-    case 'e':
+    
+    case 'e':                          /* Enumeration type */
       type = dbx_alloc_type (typenums, objfile);
       type = read_enum_type (pp, type, objfile);
       *dbx_lookup_type (typenums) = type;
       break;
 
-    case 's':
+    case 's':                          /* Struct type */
       type = dbx_alloc_type (typenums, objfile);
       if (!TYPE_NAME (type))
         TYPE_NAME (type) = type_synonym_name;
@@ -1955,7 +2030,7 @@ read_type (pp, objfile)
       type = read_struct_type (pp, type, objfile);
       break;
 
-    case 'u':
+    case 'u':                          /* Union type */
       type = dbx_alloc_type (typenums, objfile);
       if (!TYPE_NAME (type))
        TYPE_NAME (type) = type_synonym_name;
@@ -1964,7 +2039,7 @@ read_type (pp, objfile)
       TYPE_CODE (type) = TYPE_CODE_UNION;
       break;
 
-    case 'a':
+    case 'a':                          /* Array type */
       if (**pp != 'r')
        return error_type (pp);
       ++*pp;
@@ -1982,18 +2057,6 @@ read_type (pp, objfile)
   if (type == 0)
     abort ();
 
-#if 0
-  /* If this is an overriding temporary alteration for a header file's
-     contents, and this type number is unknown in the global definition,
-     put this type into the global definition at this type number.  */
-  if (header_file_prev_index >= 0)
-    {
-      register struct type **tp
-        = explicit_lookup_type (header_file_prev_index, typenums[1]);
-      if (*tp == 0)
-       *tp = type;
-    }
-#endif
   return type;
 }
 \f
@@ -2190,7 +2253,7 @@ read_struct_type (pp, type, objfile)
              if (name == 0)
                {
                  complain (&invalid_cpp_type_complaint, (char *) symnum);
-                 TYPE_NAME (context) = name;
+                 name = "FOO";
                }
              list->field.name = obconcat (&objfile -> type_obstack,
                                           prefix, name, "");
@@ -2577,6 +2640,7 @@ read_struct_type (pp, type, objfile)
          mainlist = new_mainlist;
          nfn_fields++;
          total_length += length;
+         if (**pp == '\\') *pp = next_symbol_text ();
        }
       while (**pp != ';');
     }
@@ -2628,7 +2692,9 @@ read_struct_type (pp, type, objfile)
             for the derived classes, but for the fact that by then,
             we don't remember who needs what.  */
 
+#if 0
          int predicted_fieldno = -1;
+#endif
 
          /* Now we must record the virtual function table pointer's
             field information.  */
@@ -2812,9 +2878,14 @@ read_enum_type (pp, type, objfile)
   struct pending *osyms, *syms;
   int o_nsyms;
 
+#if 0
+  /* FIXME!  The stabs produced by Sun CC merrily define things that ought
+     to be file-scope, between N_FN entries, using N_LSYM.  What's a mother
+     to do?  For now, force all enum values to file scope.  */
   if (within_function)
     symlist = &local_symbols;
   else
+#endif
     symlist = &file_symbols;
   osyms = *symlist;
   o_nsyms = osyms ? osyms->nsyms : 0;
@@ -2895,6 +2966,110 @@ read_enum_type (pp, type, objfile)
   return type;
 }
 
+/* this is for the initial typedefs in every file (for int, long, etc) */
+static struct type *
+read_sun_builtin_type (pp, typenums, objfile)
+     char **pp;
+     int typenums[2];
+     struct objfile *objfile;
+{
+  int nbits;
+  int signed_type;
+
+  switch (**pp) {
+  case 's':
+    signed_type = 1;
+    break;
+  case 'u':
+    signed_type = 0;
+    break;
+  default:
+    return error_type (pp);
+  }
+  (*pp)++;
+
+  /* The first number appears to be the number of bytes occupied
+     by this type, except that unsigned short is 4 instead of 2.
+     Since this information is redundant with the third number,
+     we will ignore it.  */
+  read_number (pp, ';');
+
+  /* The second number is always 0, so ignore it too. */
+  read_number (pp, ';');
+
+  /* The third number is the number of bits for this type. */
+  nbits = read_number (pp, 0);
+
+  /* FIXME.  Here we should just be able to make a type of the right
+     number of bits and signedness.  FIXME.  */
+
+  if (nbits == TARGET_LONG_LONG_BIT)
+    return (lookup_fundamental_type (objfile,
+                signed_type? FT_LONG_LONG: FT_UNSIGNED_LONG_LONG));
+  
+  if (nbits == TARGET_INT_BIT) {
+    /* FIXME -- the only way to distinguish `int' from `long'
+       is to look at its name!  */
+    if (signed_type) {
+      if (long_kludge_name && long_kludge_name[0] == 'l' /* long */)
+       return lookup_fundamental_type (objfile, FT_LONG);
+      else
+       return lookup_fundamental_type (objfile, FT_INTEGER);
+    } else {
+      if (long_kludge_name
+         && ((long_kludge_name[0] == 'u' /* unsigned */ &&
+              long_kludge_name[9] == 'l' /* long */)
+             || (long_kludge_name[0] == 'l' /* long unsigned */)))
+       return lookup_fundamental_type (objfile, FT_UNSIGNED_LONG);
+      else
+       return lookup_fundamental_type (objfile, FT_UNSIGNED_INTEGER);
+    }
+  }
+    
+  if (nbits == TARGET_SHORT_BIT)
+    return (lookup_fundamental_type (objfile,
+                signed_type? FT_SHORT: FT_UNSIGNED_SHORT));
+  
+  if (nbits == TARGET_CHAR_BIT)
+    return (lookup_fundamental_type (objfile,
+                signed_type? FT_CHAR: FT_UNSIGNED_CHAR));
+  
+  if (nbits == 0)
+    return lookup_fundamental_type (objfile, FT_VOID);
+  
+  return error_type (pp);
+}
+
+static struct type *
+read_sun_floating_type (pp, typenums, objfile)
+     char **pp;
+     int typenums[2];
+     struct objfile *objfile;
+{
+  int nbytes;
+
+  /* The first number has more details about the type, for example
+     FN_COMPLEX.  See the sun stab.h.  */
+  read_number (pp, ';');
+
+  /* The second number is the number of bytes occupied by this type */
+  nbytes = read_number (pp, ';');
+
+  if (**pp != 0)
+    return error_type (pp);
+
+  if (nbytes == TARGET_FLOAT_BIT / TARGET_CHAR_BIT)
+    return lookup_fundamental_type (objfile, FT_FLOAT);
+
+  if (nbytes == TARGET_DOUBLE_BIT / TARGET_CHAR_BIT)
+    return lookup_fundamental_type (objfile, FT_DBL_PREC_FLOAT);
+
+  if (nbytes == TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT)
+    return lookup_fundamental_type (objfile, FT_EXT_PREC_FLOAT);
+
+  return error_type (pp);
+}
+
 /* Read a number from the string pointed to by *PP.
    The value of *PP is advanced over the number.
    If END is nonzero, the character that ends the
@@ -3008,9 +3183,6 @@ read_huge_number (pp, end, valu, bits)
     }
 }
 
-#define        MAX_OF_C_TYPE(t)        ((1 << (sizeof (t)*8 - 1)) - 1)
-#define        MIN_OF_C_TYPE(t)        (-(1 << (sizeof (t)*8 - 1)))
-
 static struct type *
 read_range_type (pp, typenums, objfile)
      char **pp;
@@ -3164,15 +3336,15 @@ read_range_type (pp, typenums, objfile)
       /* a signed type */
       /* FIXME -- the only way to distinguish `int' from `long' is to look
         at its name!  */
-      if ((n3 == (1 << (8 * sizeof (long) - 1)) - 1) &&
+      if ((n3 ==(long)(((unsigned long)1 << (8 * sizeof (long)  - 1)) - 1)) &&
        long_kludge_name && long_kludge_name[0] == 'l' /* long */)
         return (lookup_fundamental_type (objfile, FT_LONG));
-      if (n3 == (1 << (8 * sizeof (int) - 1)) - 1)
+      if (n3 == (long)(((unsigned long)1 << (8 * sizeof (int)   - 1)) - 1))
        return (lookup_fundamental_type (objfile, FT_INTEGER));
-      if (n3 == (1 << (8 * sizeof (short) - 1)) - 1)
+      if (n3 ==        (               1 << (8 * sizeof (short) - 1)) - 1)
        return (lookup_fundamental_type (objfile, FT_SHORT));
-      if (n3 == (1 << (8 * sizeof (char) - 1)) - 1)
-       return (lookup_fundamental_type (objfile, FT_CHAR));
+      if (n3 ==        (               1 << (8 * sizeof (char)  - 1)) - 1)
+       return (lookup_fundamental_type (objfile, FT_SIGNED_CHAR));
     }
 
   /* We have a real range type on our hands.  Allocate space and
This page took 0.031587 seconds and 4 git commands to generate.