From 02e8a8fdb8f36bca1efae3f9b130d0489a18d6a4 Mon Sep 17 00:00:00 2001 From: slade_rich Date: Wed, 13 Oct 2004 01:24:29 +0000 Subject: [PATCH] increased count on regUsedinRange to prevent unnecessary warning. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3538 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/pic/pcoderegs.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/pic/pcoderegs.c b/src/pic/pcoderegs.c index 61ea9a97..4b37f118 100644 --- a/src/pic/pcoderegs.c +++ b/src/pic/pcoderegs.c @@ -418,13 +418,14 @@ int regUsedinRange(pCode *pc1, pCode *pc2, regs *reg) if(testreg && (testreg->rIdx == reg->rIdx)) { return 1; } + if (i++ > 1000) { + fprintf(stderr, "warning, regUsedinRange searched through too many pcodes\n"); + return 0; + } pc1 = findNextInstruction(pc1->next); - } while (pc1 && (pc1 != pc2) && (i++ < 100)) ; - - if(i >= 100) - fprintf(stderr, "warning, regUsedinRange searched through too many pcodes\n"); + } while (pc1 && (pc1 != pc2)) ; return 0; } @@ -611,17 +612,6 @@ int pCodeOptime2pCodes(pCode *pc1, pCode *pc2, pCode *pcfl_used, regs *reg, int total_registers_saved++; // debugging stats. } - /* Note this else if is same conditional as the if - DELETE ME - } else if ( (PCI(pct1)->op == POC_MOVWF) && - (PCI(pc2)->op == POC_MOVFW)) { - DFPRINTF(stderr, " optimising MOVF reg1,W MOVWF reg ... MOVF reg,W\n"); - if(optimize_level > 1 && can_free) { - pct2 = newpCode(POC_MOVFW, PCI(pc1)->pcop); - pCodeInsertAfter(pc2, pct2); - Remove2pcodes(pcfl_used, pc1, pc2, reg, 1); - total_registers_saved++; // debugging stats. - } - */ } } } -- 2.39.5