From: spth Date: Sun, 30 Mar 2008 12:22:13 +0000 (+0000) Subject: Reverted reversal of order of bytewise return value assignments X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c6517790839092f32d9837cc2648171a44e69177;hp=51eefdbe8b7ec82630a97151845a8eae2325c899;p=fw%2Fsdcc Reverted reversal of order of bytewise return value assignments git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5128 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index ae532ce8..b59e62bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-03-30 Philipp Klaus Krause + * src/z80/gen.c (assignResultValue): + Reverted reversal of order of bytewise return value assignments introduced in last commit. + 2008-03-30 Philipp Klaus Krause * src/z80/gen.c (emitDebug, assignResultValue, genPlus, genMinus, genMult, genJumpTab): Use 16-bit instructions for addition in some additional cases, diff --git a/src/z80/gen.c b/src/z80/gen.c index 8ecdaaab..4d9d0ffb 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -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");