* src/pic16/device.h (pic16_options_t): added field use_crt,
[fw/sdcc] / src / SDCCmem.c
index dc0982b44137381faf5189e571f0a864e171194a..b2a8c7b5dfca427c88d4b93cb97839ee1f3e7356 100644 (file)
@@ -375,6 +375,7 @@ allocGlobal (symbol * sym)
       return;
     }
 
+  if(!TARGET_IS_PIC16 || (TARGET_IS_PIC16 && sym->level))
   /* register storage class ignored changed to FIXED */
   if (SPEC_SCLS (sym->etype) == S_REGISTER)
     SPEC_SCLS (sym->etype) = S_FIXED;
@@ -392,6 +393,7 @@ allocGlobal (symbol * sym)
   /* if it is fixed, then allocate depending on the  */
   /* current memory model, same for automatics        */
   if (SPEC_SCLS (sym->etype) == S_FIXED ||
+      (TARGET_IS_PIC16 && (SPEC_SCLS (sym->etype) == S_REGISTER) && (sym->level==0)) ||
       SPEC_SCLS (sym->etype) == S_AUTO) {
     if (port->mem.default_globl_map != xdata) {
       /* set the output class */
@@ -816,6 +818,7 @@ allocVariables (symbol * symChain)
          if (csym && csym->level == sym->level)
            werror (E_DUPLICATE_TYPEDEF, sym->name);
 
+         SPEC_EXTR (sym->etype) = 0;
          addSym (TypedefTab, sym, sym->name, sym->level, sym->block, 0);
          continue;             /* go to the next one         */
        }