* src/pic16/pcode.c: declaring variables other than at the start of a
authormaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 24 Dec 2004 14:54:36 +0000 (14:54 +0000)
committermaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 24 Dec 2004 14:54:36 +0000 (14:54 +0000)
  block is not supported in C by VC6.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3610 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/pic16/pcode.c

index 10651a5474e8c248e33c22b575a13847bc98ac2b..46b6dc2ed3a300e390cfd9eafad29a308fac2db0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-24 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * src/pic16/pcode.c: declaring variables other than at the start of a
+         block is not supported in C by VC6.
+
 2004-12-22 Vangelis Rokas <vrokas AT otenet.gr>
 
        * applied a previous patch from Raphael Neider that wasn't included
index 085d7e94e303fbdf8933d807fe5e431052799151..b85f6987564ed1127861753e26c7cdea97887d80 100644 (file)
@@ -7207,8 +7207,8 @@ void pic16_OptimizeJumps ()
   //fprintf (stderr, "%s:%d: %s\n", __FILE__, __LINE__, __FUNCTION__);
   
   for (pb = the_pFile->pbHead; pb != NULL; pb = pb->next) {
-    iteration = 1;
     int matchedInvertRule = 1;
+    iteration = 1;
     do {
       //fprintf (stderr, "%s:%d: iterating over pBlock %p\n", __FUNCTION__, __LINE__, pb);
       change = 0;
@@ -7248,9 +7248,10 @@ void pic16_OptimizeJumps ()
 
 
        if (IS_GOTO(pc)) {
-         label = PCI(pc)->pcop->name;
+         int dist;
          int condBraType = isSkipOnStatus(pc_prev);
-         int dist = findpCodeLabel(pc, label, MAX_DIST_BRA, &target);
+         label = PCI(pc)->pcop->name;
+         dist = findpCodeLabel(pc, label, MAX_DIST_BRA, &target);
          if (dist < 0) dist = -dist;
          //fprintf (stderr, "distance: %d (", dist); pc->print(stderr, pc);fprintf (stderr, ")\n");
          isHandled = 0;