From 4a739655b9d81efc3155fdd9326ac1f55d415253 Mon Sep 17 00:00:00 2001 From: MaartenBrock Date: Sun, 29 Apr 2007 08:36:30 +0000 Subject: [PATCH 1/1] * src/mcs51/gen.c (genRet): fixed bug 1707003 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4775 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++++ src/mcs51/gen.c | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 767387cf..6dc95f5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-04-29 Maarten Brock + + * src/mcs51/gen.c (genRet): fixed bug 1707003 + 2007-04-27 Raphael Neider * src/pic16/pcode.c (pBlockRemoveUnusedLabels,pic16_pBlockAddInval, diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index f99fa6a0..f9fc2e1b 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -4039,7 +4039,7 @@ genRet (iCode * ic) if (IS_BIT(_G.currentFunc->etype)) { - if (!OP_SYMBOL (IC_LEFT (ic))->ruonly) + if (!(IS_SYMOP (IC_LEFT (ic)) && OP_SYMBOL (IC_LEFT (ic))->ruonly)) toCarry (IC_LEFT (ic)); } else @@ -5459,7 +5459,7 @@ genDiv (iCode * ic) D (emitcode (";", "genDiv")); - /* assign the amsops */ + /* assign the asmops */ aopOp (left, ic, FALSE); aopOp (right, ic, FALSE); aopOp (result, ic, TRUE); @@ -5978,7 +5978,7 @@ genCmpGt (iCode * ic, iCode * ifx) retype = getSpec (operandType (right)); sign = !((SPEC_USIGN (letype) && !(IS_CHAR (letype) && IS_LITERAL (letype))) || (SPEC_USIGN (retype) && !(IS_CHAR (retype) && IS_LITERAL (retype)))); - /* assign the amsops */ + /* assign the asmops */ aopOp (result, ic, TRUE); aopOp (left, ic, FALSE); aopOp (right, ic, FALSE); @@ -6008,7 +6008,7 @@ genCmpLt (iCode * ic, iCode * ifx) retype = getSpec (operandType (right)); sign = !((SPEC_USIGN (letype) && !(IS_CHAR (letype) && IS_LITERAL (letype))) || (SPEC_USIGN (retype) && !(IS_CHAR (retype) && IS_LITERAL (retype)))); - /* assign the amsops */ + /* assign the asmops */ aopOp (result, ic, TRUE); aopOp (left, ic, FALSE); aopOp (right, ic, FALSE); @@ -7374,6 +7374,7 @@ genXor (iCode * ic, iCode * ifx) right = left; left = tmp; } + if (AOP_TYPE (right) == AOP_LIT) lit = (unsigned long) floatFromVal (AOP (right)->aopu.aop_lit); -- 2.30.2