Reverted reversal of order of bytewise return value assignments
authorspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 30 Mar 2008 12:22:13 +0000 (12:22 +0000)
committerspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 30 Mar 2008 12:22:13 +0000 (12:22 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5128 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/z80/gen.c

index ae532ce8b1d9a7c95d10d01f8cb0dc1ff4975906..b59e62bf6e4b36ad06ddafec3d75afb830fea348 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-30 Philipp Klaus Krause <pkk AT spth.de>
+       * src/z80/gen.c (assignResultValue):
+         Reverted reversal of order of bytewise return value assignments introduced in last commit.
+
 2008-03-30 Philipp Klaus Krause <pkk AT spth.de>
        * src/z80/gen.c (emitDebug, assignResultValue, genPlus, genMinus, genMult, genJumpTab):
          Use 16-bit instructions for addition in some additional cases,
index 8ecdaaab36ee51deae469ece058ccc4903acbad1..4d9d0ffbd471438b67ae36a3f074a399e85eb99d 100644 (file)
@@ -2508,7 +2508,6 @@ void
 assignResultValue (operand * oper)
 {
   int size = AOP_SIZE (oper);
-  int i;
   bool topInA = 0;
 
   wassertl (size <= 4, "Got a result that is bigger than four bytes");
@@ -2527,7 +2526,7 @@ assignResultValue (operand * oper)
   else
     {
       if ((AOP_TYPE (oper) == AOP_REG) && (AOP_SIZE (oper) == 4) &&
-          !strcmp (AOP (oper)->aopu.aop_reg[size-2]->name, _fReturn[size-1]))
+          !strcmp (AOP (oper)->aopu.aop_reg[size-1]->name, _fReturn[size-2]))
         {
           size--;
           _emitMove ("a", _fReturn[size-1]);
@@ -2536,9 +2535,9 @@ assignResultValue (operand * oper)
           aopPut (AOP (oper), _fReturn[size], size-1);
           size--;
         }
-      for (i = 0; i < size; i++)
+      while(size--)
         {
-          aopPut (AOP (oper), _fReturn[i], i);
+          aopPut (AOP (oper), _fReturn[size], size);
         }
     }
 }
@@ -3278,7 +3277,7 @@ genFunction (iCode * ic)
     emit2 ("!enterxl", sym->stack);
   else if (sym->stack)
     {
-      if (optimize.codeSize && sym->stack <= 8 || sym->stack <= 4)
+      if ((optimize.codeSize && sym->stack <= 8) || sym->stack <= 4)
         {
           int stack = sym->stack;
           emit2 ("!enter");