From 5c2990959f40ee6e532721a99c7f17969b3f6c4c Mon Sep 17 00:00:00 2001 From: slade_rich Date: Wed, 11 Aug 2004 01:17:18 +0000 Subject: [PATCH] Printing rIdx on internal verbose debug. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3432 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/pic/gen.c | 12 +----------- src/pic/pcode.c | 24 ++++++++++++++---------- src/pic/ralloc.c | 3 ++- src/pic/ralloc.h | 7 +++---- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/pic/gen.c b/src/pic/gen.c index 176ac52b..8c10f0ac 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -1342,16 +1342,6 @@ pCodeOp *popGet (asmop *aop, int offset) //, bool bit16, bool dname) pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); pcop->type = PO_DIR; - /* - if (offset) - sprintf(s,"(%s + %d)", - aop->aopu.aop_dir, - offset); - else - sprintf(s,"%s",aop->aopu.aop_dir); - pcop->name = Safe_calloc(1,strlen(s)+1); - strcpy(pcop->name,s); - */ pcop->name = Safe_calloc(1,strlen(aop->aopu.aop_dir)+1); strcpy(pcop->name,aop->aopu.aop_dir); PCOR(pcop)->r = dirregWithName(aop->aopu.aop_dir); @@ -1380,7 +1370,7 @@ pCodeOp *popGet (asmop *aop, int offset) //, bool bit16, bool dname) PCOR(pcop)->instance = offset; pcop->type = PCOR(pcop)->r->pc_type; //rs = aop->aopu.aop_reg[offset]->name; - DEBUGpic14_emitcode(";","%d regiser idx = %d ",__LINE__,rIdx); + DEBUGpic14_emitcode(";","%d rIdx = r0x%X ",__LINE__,rIdx); return pcop; } diff --git a/src/pic/pcode.c b/src/pic/pcode.c index db50767e..79ae012e 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -3122,19 +3122,18 @@ static void genericPrint(FILE *of, pCode *pc) case PC_OPCODE: // If the opcode has a label, print that first { - pBranch *pbl = PCI(pc)->label; + char str[256]; + pCodeInstruction *pci = PCI(pc); + pBranch *pbl = pci->label; while(pbl && pbl->pc) { if(pbl->pc->type == PC_LABEL) pCodePrintLabel(of, pbl->pc); pbl = pbl->next; } - } - if(PCI(pc)->cline) - genericPrint(of,PCODE(PCI(pc)->cline)); + if(pci->cline) + genericPrint(of,PCODE(pci->cline)); - { - char str[256]; pCode2str(str, 256, pc); @@ -3142,9 +3141,12 @@ static void genericPrint(FILE *of, pCode *pc) /* Debug */ if(debug_verbose) { + pCodeOpReg *pcor = PCOR(pci->pcop); fprintf(of, "\t;id=%u,key=%03x",pc->id,pc->seq); - if(PCI(pc)->pcflow) - fprintf(of,",flow seq=%03x",PCI(pc)->pcflow->pc.seq); + if(pci->pcflow) + fprintf(of,",flow seq=%03x",pci->pcflow->pc.seq); + if (pcor && pcor->pcop.type==PO_GPR_TEMP && !pcor->r->isFixed) + fprintf(of,",rIdx=r0x%X",pcor->rIdx); } } #if 0 @@ -5433,8 +5435,10 @@ void AnalyzeBanking(void) /*-----------------------------------------------------------------*/ DEFSETFUNC (resetrIdx) { - if (!((regs *)item)->isFixed) - ((regs *)item)->rIdx = 0; + regs *r = (regs *)item; + if (!r->isFixed) { + r->rIdx = 0; + } return 0; } diff --git a/src/pic/ralloc.c b/src/pic/ralloc.c index 768f1909..fcf12608 100644 --- a/src/pic/ralloc.c +++ b/src/pic/ralloc.c @@ -2066,7 +2066,8 @@ deassignLRs (iCode * ic, eBBlock * ebp) (result = OP_SYMBOL (IC_RESULT (ic))) && /* has a result */ result->liveTo > ic->seq && /* and will live beyond this */ result->liveTo <= ebp->lSeq && /* does not go beyond this block */ - result->liveFrom == ic->seq && /* does not start before here */ result->regType == sym->regType && /* same register types */ + result->liveFrom == ic->seq && /* does not start before here */ + result->regType == sym->regType && /* same register types */ result->regType == sym->regType && /* same register types */ result->nRegs && /* which needs registers */ !result->isspilt && /* and does not already have them */ diff --git a/src/pic/ralloc.h b/src/pic/ralloc.h index 234d4f2a..9bf058de 100644 --- a/src/pic/ralloc.h +++ b/src/pic/ralloc.h @@ -61,10 +61,9 @@ typedef struct regs short type; /* can have value * REG_GPR, REG_PTR or REG_CND * This like the "meta-type" */ - short pc_type; /* pcode type */ - short rIdx; /* index into register table */ - // short otype; - char *name; /* name */ + short pc_type; /* pcode type */ + short rIdx; /* index into register table */ + char *name; /* name */ unsigned isFree:1; /* is currently unassigned */ unsigned wasUsed:1; /* becomes true if register has been used */ -- 2.30.2