From 68c83ccf905e3c825ff2909f11ed27199ed9f37b Mon Sep 17 00:00:00 2001 From: johanknol Date: Sat, 17 Nov 2001 11:18:54 +0000 Subject: [PATCH] Although a one byte char array has size==1, it can't be accuse git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1609 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/ds390/ralloc.c | 5 +++++ src/mcs51/ralloc.c | 5 +++++ src/pic/ralloc.c | 6 ++++++ src/z80/ralloc.c | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index ca8e0ab3..2a17ebf2 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -2157,6 +2157,11 @@ packRegsForAccUse (iCode * ic) { iCode *uic; + /* if this is an aggregate, e.g. a one byte char array */ + if (IS_AGGREGATE(operandType(IC_RESULT(ic)))) { + return; + } + /* if + or - then it has to be one byte result */ if ((ic->op == '+' || ic->op == '-') && getSize (operandType (IC_RESULT (ic))) > 1) diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index df7f6657..5d679226 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -2056,6 +2056,11 @@ packRegsForAccUse (iCode * ic) { iCode *uic; + /* if this is an aggregate, e.g. a one byte char array */ + if (IS_AGGREGATE(operandType(IC_RESULT(ic)))) { + return; + } + /* if + or - then it has to be one byte result */ if ((ic->op == '+' || ic->op == '-') && getSize (operandType (IC_RESULT (ic))) > 1) diff --git a/src/pic/ralloc.c b/src/pic/ralloc.c index 4fc0b827..89d6f82f 100644 --- a/src/pic/ralloc.c +++ b/src/pic/ralloc.c @@ -2560,6 +2560,12 @@ packRegsForAccUse (iCode * ic) iCode *uic; debugLog ("%s\n", __FUNCTION__); + + /* if this is an aggregate, e.g. a one byte char array */ + if (IS_AGGREGATE(operandType(IC_RESULT(ic)))) { + return; + } + /* if + or - then it has to be one byte result */ if ((ic->op == '+' || ic->op == '-') && getSize (operandType (IC_RESULT (ic))) > 1) diff --git a/src/z80/ralloc.c b/src/z80/ralloc.c index 936d8b77..71a1e2c4 100644 --- a/src/z80/ralloc.c +++ b/src/z80/ralloc.c @@ -1892,6 +1892,11 @@ packRegsForAccUse (iCode * ic) { iCode *uic; + /* if this is an aggregate, e.g. a one byte char array */ + if (IS_AGGREGATE(operandType(IC_RESULT(ic)))) { + return; + } + /* if + or - then it has to be one byte result */ if ((ic->op == '+' || ic->op == '-') && getSize (operandType (IC_RESULT (ic))) > 1) -- 2.47.2