From: tecodev Date: Thu, 21 Jul 2005 17:39:06 +0000 (+0000) Subject: * src/pic/gen.c (aopOp): do not generate AOP_ACC operands as pic14 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=9eadc1d28a7826eca9f07b8c274a76a45c98b5d4;p=fw%2Fsdcc * src/pic/gen.c (aopOp): do not generate AOP_ACC operands as pic14 architecture cannot handle them efficiently, fixes bug #1235003 * src/pic16/device.c (pic16_dump_{u,i}section,pic16_dump_int_registers): check for empty sets before using them (fixes bug #1232190) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3805 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 5be3170a..be621fd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-07-21 Raphael Neider + + * src/pic/gen.c (aopOp): do not generate AOP_ACC operands as pic14 + architecture cannot handle them efficiently, fixes bug #1235003 + * src/pic16/device.c (pic16_dump_{u,i}section,pic16_dump_int_registers): + check for empty sets before using them (fixes bug #1232190) + 2005-07-19 Maarten Brock * as/mcs51/lkarea.c (lnkarea, lnkarea2): improved BSEG size calculation, diff --git a/src/pic/gen.c b/src/pic/gen.c index 90392721..d37b6e59 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -77,7 +77,7 @@ char *fReturnpic14[] = {"temp1","temp2","temp3","temp4" }; unsigned fReturnSizePic = 4; /* shared with ralloc.c */ static char **fReturn = fReturnpic14; -static char *accUse[] = {"a","b"}; +//static char *accUse[] = {"a","b"}; //static short rbank = -1; @@ -853,6 +853,10 @@ void aopOp (operand *op, iCode *ic, bool result) return; } +#if 0 + /* WREG is not usable as an ordinary operand with PIC architecture, + * one might introduce a scratch register that can be used to make + * WREG accesible as an operand... disable WREG for now */ if (sym->accuse) { int i; aop = op->aop = sym->aop = newAsmop(AOP_ACC); @@ -862,6 +866,7 @@ void aopOp (operand *op, iCode *ic, bool result) DEBUGpic14_emitcode(";","%d size=%d",__LINE__,aop->size); return; } +#endif if (sym->ruonly ) { if(sym->isptr) { // && sym->uptr diff --git a/src/pic16/device.c b/src/pic16/device.c index 8ab5595c..a2617244 100644 --- a/src/pic16/device.c +++ b/src/pic16/device.c @@ -681,6 +681,7 @@ void pic16_dump_usection(FILE *of, set *section, int fix) regs *r1; /* put all symbols in an array */ + if (!elementsInSet(section)) return; rlist = Safe_calloc(elementsInSet(section), sizeof(regs *)); r = rlist[0]; i = 0; for(rprev = setFirstItem(section); rprev; rprev = setNextItem(section)) { @@ -779,6 +780,7 @@ void pic16_dump_isection(FILE *of, set *section, int fix) symbol **slist; /* put all symbols in an array */ + if (!elementsInSet(section)) return; slist = Safe_calloc(elementsInSet(section), sizeof(symbol *)); s = slist[0]; i = 0; for(sprev = setFirstItem(section); sprev; sprev = setNextItem(section)) { @@ -863,6 +865,7 @@ void pic16_dump_int_registers(FILE *of, set *section) regs **rlist; /* put all symbols in an array */ + if (!elementsInSet(section)) return; rlist = Safe_calloc(elementsInSet(section), sizeof(regs *)); r = rlist[0]; i = 0; for(rprev = setFirstItem(section); rprev; rprev = setNextItem(section)) {