* src/SDCClrange.c (findPrevUse): fixed bug 1294475
[fw/sdcc] / src / SDCCast.c
index f3ae4175283b5039a973591c53ddbcea72da5e21..d607641a39d978a0837532d06d4de8e0bcc3d569 100644 (file)
@@ -3866,7 +3866,8 @@ decorateType (ast * tree, RESULT_TYPE resultType)
         unsigned int gptype = 0;
         unsigned int addr = SPEC_ADDR (sym->etype);
 
-        if (IS_GENPTR (LTYPE (tree)) && GPTRSIZE > FPTRSIZE)
+        if (IS_GENPTR (LTYPE (tree)) && ((GPTRSIZE > FPTRSIZE)
+                                        || TARGET_IS_PIC16) )
           {
             switch (SPEC_SCLS (sym->etype))
               {
@@ -3885,6 +3886,9 @@ decorateType (ast * tree, RESULT_TYPE resultType)
                 break;
               default:
                 gptype = 0;
+
+                if(TARGET_IS_PIC16 && (SPEC_SCLS(sym->etype) == S_FIXED))
+                    gptype = GPTYPE_NEAR;
               }
             addr |= gptype << (8*(GPTRSIZE - 1));
           }