X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCpeeph.c;h=7a1f3f258f5531de16371a58fd1f0e28f986a412;hb=6cb515b98c5977589446a39a6271958383d0a3da;hp=871ca6768d519e3dc632224f70bb0f54f576ffda;hpb=1e40748d55945b89eef6825943a29a31a05bb1f4;p=fw%2Fsdcc diff --git a/src/SDCCpeeph.c b/src/SDCCpeeph.c index 871ca676..7a1f3f25 100644 --- a/src/SDCCpeeph.c +++ b/src/SDCCpeeph.c @@ -61,7 +61,7 @@ void pic16_peepRules2pCode(peepRule *); #endif /*-----------------------------------------------------------------*/ -/* pcDistance - afinds a label back ward or forward */ +/* pcDistance - finds a label backward or forward */ /*-----------------------------------------------------------------*/ static int @@ -74,16 +74,19 @@ pcDistance (lineNode * cpos, char *lbl, bool back) SNPRINTF (buff, sizeof(buff), "%s:", lbl); while (pl) { - if (pl->line && !pl->isComment && !pl->isLabel && - !pl->isDebug) { - if (port->peep.getSize) { - dist += port->peep.getSize(pl); - } else { - dist += 3; - } + !pl->isDebug) + { + if (port->peep.getSize) + { + dist += port->peep.getSize(pl); + } + else + { + dist += 3; + } } if (strncmp (pl->line, buff, strlen (buff)) == 0) @@ -155,7 +158,7 @@ FBYNAME (labelInRange) return FALSE; /* calculate the label distance : the jump for reladdr can be - +/- 127 bytes, here Iam assuming that an average 8051 + +/- 127 bytes, here I am assuming that an average 8051 instruction is 2 bytes long, so if the label is more than 63 intructions away, the label is considered out of range for a relative jump. we could get more precise this will @@ -1045,6 +1048,9 @@ operandBaseName (const char *op) return "a"; if (!strncmp (op, "ar", 2) && ISCHARDIGIT(*(op+2)) && !*(op+3)) return op+1; + // bug 1739475, temp fix + if (op[0] == '@') + return operandBaseName(op+1); } return op; @@ -1202,8 +1208,8 @@ ftab[] = // sorted on the number of times used static int callFuncByName (char *fname, hTab * vars, - lineNode * currPl, - lineNode * endPl, + lineNode * currPl, /* first source line matched */ + lineNode * endPl, /* last source line matched */ lineNode * head) { int i;