From ca79bdce9a86b192bb9b450d598cc6ee939680dc Mon Sep 17 00:00:00 2001 From: johanknol Date: Sat, 3 Nov 2001 10:21:43 +0000 Subject: [PATCH] fixed fig #471059 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1492 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/mcs51/gen.c | 10 ++++++++-- src/mcs51/ralloc.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 0e6d7091..76add3aa 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -3420,14 +3420,20 @@ genMult (iCode * ic) } /* if both are of size == 1 */ - if (AOP_SIZE (left) == 1 && - AOP_SIZE (right) == 1) +#if 0 // one of them can be a sloc shared with the result + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) +#else + if (getSize(operandType(left)) == 1 && + getSize(operandType(right)) == 1) +#endif { genMultOneByte (left, right, result); goto release; } /* should have been converted to function call */ + fprintf (stderr, "left: %d right: %d\n", getSize(OP_SYMBOL(left)->type), + getSize(OP_SYMBOL(right)->type)); assert (0); release: diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index bcb0fa36..a6a34641 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1182,10 +1182,15 @@ serialRegAssign (eBBlock ** ebbs, int count) else sym->regs[j] = getRegGpr (ic, ebbs[i], sym); - /* if the allocation falied which means + /* if the allocation failed which means this was spilt then break */ - if (!sym->regs[j]) - break; + if (!sym->regs[j]) { + if (j) { + fprintf (stderr, "%d reg(s) lost in %s:%d\n", + j, __FILE__,__LINE__); + } + break; + } } /* if it shares registers with operands make sure -- 2.47.2