* src/pic/gen.c (SetIrp,genNearPointerGet,genNearPointerSet):
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 16 Mar 2008 21:38:08 +0000 (21:38 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 16 Mar 2008 21:38:08 +0000 (21:38 +0000)
  fixed code bloat regression using a variant of patch #1915618

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5106 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/pic/gen.c

index a858d844a2a6f1c9097b3e69a2e20b2bf4285d6f..8bb1e392500f68f087e44e9891a467f9d8718b27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-16 Raphael Neider <rneider AT web.de>
+
+       * src/pic/gen.c (SetIrp,genNearPointerGet,genNearPointerSet):
+         fixed code bloat regression using a variant of patch #1915618
+
 2008-03-16 Borut Razem <borut.razem AT siol.net>
 
        * support/scripts/sdcc.nsi: added section debugging macros, added SDCC
index d6da6c631e982634373539feee098fe440687381..6ff00ac759ae589036a9b476b648042d516179cd 100644 (file)
@@ -6899,8 +6899,10 @@ void SetIrp(operand *result) {
         else
             emitCLRIRP;
     } else {
-        if (PCOP(AOP(result))->type == PO_LITERAL) {
-            int addrs = PCOL(AOP(result))->lit;
+        if ((AOP_TYPE(result) == AOP_PCODE)
+            && (AOP(result)->aopu.pcop->type == PO_LITERAL))
+        {
+            int addrs = PCOL(AOP(result)->aopu.pcop)->lit;
             if (addrs & 0x100)
                 emitSETIRP;
             else
@@ -7191,8 +7193,9 @@ static void genNearPointerGet (operand *left,
     aopOp (result,ic,FALSE);
 
     /* Check if can access directly instead of via a pointer */
-    if ((PCOP(AOP(left))->type == PO_LITERAL || PCOP(AOP(left))->type == PO_IMMEDIATE)
-        && AOP_SIZE(result) == 1)
+    if ((AOP_TYPE(left) == AOP_PCODE)
+        && (AOP(left)->aopu.pcop->type == PO_IMMEDIATE)
+        && (AOP_SIZE(result) == 1))
     {
         direct = 1;
     }
@@ -7740,7 +7743,10 @@ static void genNearPointerSet (operand *right,
     DEBUGpic14_AopType(__LINE__,NULL,right,result);
 
     /* Check if can access directly instead of via a pointer */
-    if (PCOP(AOP(result))->type == PO_LITERAL && AOP_SIZE(right) == 1) {
+    if ((AOP_TYPE(result) == AOP_PCODE)
+        && (AOP(result)->aopu.pcop->type == PO_IMMEDIATE)
+        && (AOP_SIZE(right) == 1))
+    {
         direct = 1;
     }