From 61aa86e7161c5166edd81c01d0ff3e707eff8ff3 Mon Sep 17 00:00:00 2001 From: tecodev Date: Sun, 16 Mar 2008 21:38:08 +0000 Subject: [PATCH] * src/pic/gen.c (SetIrp,genNearPointerGet,genNearPointerSet): 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 | 5 +++++ src/pic/gen.c | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a858d844..8bb1e392 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-16 Raphael Neider + + * src/pic/gen.c (SetIrp,genNearPointerGet,genNearPointerSet): + fixed code bloat regression using a variant of patch #1915618 + 2008-03-16 Borut Razem * support/scripts/sdcc.nsi: added section debugging macros, added SDCC diff --git a/src/pic/gen.c b/src/pic/gen.c index d6da6c63..6ff00ac7 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -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; } -- 2.47.2