From 0ffd5b8214ce00fda7ad9b7aa08d9c7e920f540f Mon Sep 17 00:00:00 2001 From: epetrich Date: Wed, 17 Sep 2003 03:24:28 +0000 Subject: [PATCH] * src/SDCCopt.c (cnvFromFloatCast, cnvToFloatCast): fixed bug #613775 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2894 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 2 +- src/SDCCopt.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51ef040f..91fa0b01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2003-09-17 Erik Petrich - * src/SDCCicode.c (cnvFromFloatCast, cnvToFloatCast): fixed + * src/SDCCopt.c (cnvFromFloatCast, cnvToFloatCast): fixed bug #613775 2003-09-16 Erik Petrich diff --git a/src/SDCCopt.c b/src/SDCCopt.c index ce59ec57..34e0e78a 100644 --- a/src/SDCCopt.c +++ b/src/SDCCopt.c @@ -148,7 +148,8 @@ cnvToFcall (iCode * ic, eBBlock * ebp) { newic = newiCode (IPUSH, right, NULL); newic->parmPush = 1; - bytesPushed+=4; + //bytesPushed+=4; + bytesPushed += getSize(operandType(right)); } addiCodeToeBBlock (ebp, newic, ip); @@ -164,7 +165,8 @@ cnvToFcall (iCode * ic, eBBlock * ebp) { newic = newiCode (IPUSH, left, NULL); newic->parmPush = 1; - bytesPushed+=4; + //bytesPushed+=4; + bytesPushed += getSize(operandType(left)); } addiCodeToeBBlock (ebp, newic, ip); newic->lineno = lineno; @@ -188,6 +190,7 @@ cnvToFloatCast (iCode * ic, eBBlock * ebp) sym_link *type = operandType (IC_RIGHT (ic)); int linenno = ic->lineno; int bwd, su; + int bytesPushed=0; ip = ic->next; /* remove it from the iCode */ @@ -236,6 +239,7 @@ found: { newic = newiCode (IPUSH, IC_RIGHT (ic), NULL); newic->parmPush = 1; + bytesPushed += getSize(operandType(IC_RIGHT(ic))); } addiCodeToeBBlock (ebp, newic, ip); newic->lineno = linenno; @@ -245,6 +249,7 @@ found: /* make the call */ newic = newiCode (CALL, operandFromSymbol (func), NULL); IC_RESULT (newic) = IC_RESULT (ic); + newic->parmBytes+=bytesPushed; addiCodeToeBBlock (ebp, newic, ip); newic->lineno = linenno; @@ -261,6 +266,7 @@ cnvFromFloatCast (iCode * ic, eBBlock * ebp) sym_link *type = operandType (IC_LEFT (ic)); int lineno = ic->lineno; int bwd, su; + int bytesPushed=0; ip = ic->next; /* remove it from the iCode */ @@ -310,6 +316,7 @@ found: { newic = newiCode (IPUSH, IC_RIGHT (ic), NULL); newic->parmPush = 1; + bytesPushed += getSize(operandType(IC_RIGHT(ic))); } addiCodeToeBBlock (ebp, newic, ip); newic->lineno = lineno; @@ -319,6 +326,7 @@ found: /* make the call */ newic = newiCode (CALL, operandFromSymbol (func), NULL); IC_RESULT (newic) = IC_RESULT (ic); + newic->parmBytes+=bytesPushed; addiCodeToeBBlock (ebp, newic, ip); newic->lineno = lineno; -- 2.30.2