* src/pic16/gen.c (genFunction, genEndFunction): some
authorvrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 May 2006 22:52:11 +0000 (22:52 +0000)
committervrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 May 2006 22:52:11 +0000 (22:52 +0000)
beautifications, fixed bug with falsely restoring FSR2 in large
stack model, thanks to Beau E. Cox for reporting the bug

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

ChangeLog
src/pic16/gen.c

index 5ca95622b92d628ee4121d38001936f85ab6077a..55850b226d1e9a168e5a3b611014f4f3b4c781bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-28 Vangelis Rokas <vrokas AT users.sourceforge.net>
+
+       * src/pic16/gen.c (genFunction, genEndFunction): some
+       beautifications, fixed bug with falsely restoring FSR2 in large
+       stack model, thanks to Beau E. Cox for reporting the bug
+
 2006-05-26 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * debugger/mcs51/break.c,
index 14a0af8d777f04a0fb731e475b820ce9835790fa..8e10f9c341811f229d26ffec957b3554d79463bf 100644 (file)
@@ -3773,9 +3773,9 @@ static void genFunction (iCode *ic)
           pic16_pushpCodeOp(pic16_popCopyReg(pic16_framepnt_hi));
         pic16_pushpCodeOp(pic16_popCopyReg(pic16_framepnt_lo));
 
-        pic16_emitpcode(POC_MOVFF, pic16_popCombine2( pic16_stackpnt_lo, pic16_framepnt_lo, 0));
         if(STACK_MODEL_LARGE)
           pic16_emitpcode(POC_MOVFF, pic16_popCombine2( pic16_stackpnt_hi, pic16_framepnt_hi, 0));
+        pic16_emitpcode(POC_MOVFF, pic16_popCombine2( pic16_stackpnt_lo, pic16_framepnt_lo, 0));
       }
     }
 
@@ -3928,9 +3928,9 @@ static void genEndFunction (iCode *ic)
         || FUNC_HASSTACKPARM(sym->etype)
         ) {
         /* restore stack frame */
+        pic16_poppCodeOp( pic16_popCopyReg( pic16_framepnt_lo ));
         if(STACK_MODEL_LARGE)
           pic16_poppCodeOp( pic16_popCopyReg( pic16_framepnt_hi ));
-        pic16_poppCodeOp( pic16_popCopyReg( pic16_framepnt_lo ));
       }
     }