Printing rIdx on internal verbose debug.
authorslade_rich <slade_rich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 11 Aug 2004 01:17:18 +0000 (01:17 +0000)
committerslade_rich <slade_rich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 11 Aug 2004 01:17:18 +0000 (01:17 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3432 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/pic/gen.c
src/pic/pcode.c
src/pic/ralloc.c
src/pic/ralloc.h

index 176ac52b438a570cabdae9d2ab50d9a79412a58c..8c10f0ac5bf9a0bc3a4d560638f3b03e40e05a53 100644 (file)
@@ -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;
                }
                
index db50767e50614e7c96e8e24523b3fab5e8573db9..79ae012e896a6738fd72b69e7756fd73010c0e8f 100644 (file)
@@ -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;
 }
index 768f19090189aae1df2f30b8bf7cfb4058ad2b12..fcf1260820594cd05fc0c2d6948f3ee2f1b5c0f5 100644 (file)
@@ -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 */
index 234d4f2a0b9bba4c1940b8b664e053556517271e..9bf058defdcd1f578373538d00023193dd206d36 100644 (file)
@@ -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 */