From: sandeep Date: Mon, 26 Nov 2001 00:57:16 +0000 (+0000) Subject: Previous fix was BADDD . this should do it X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=23ff63c7ce648660a0cf2f003d80fa27b4ecd86e;p=fw%2Fsdcc Previous fix was BADDD . this should do it git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1647 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/avr/gen.c b/src/avr/gen.c index c2cb6e27..638182ab 100644 --- a/src/avr/gen.c +++ b/src/avr/gen.c @@ -724,7 +724,7 @@ aopOp (operand * op, iCode * ic, bool result) } /* if already has a asmop then continue */ - if (op->aop && aop->size == getSize(sym->type)) + if (op->aop) return; /* if the underlying symbol has a aop */ @@ -783,6 +783,10 @@ aopOp (operand * op, iCode * ic, bool result) } /* else spill location */ + if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) { + /* force a new aop if sizes differ */ + sym->usl.spillLoc->aop = NULL; + } sym->aop = op->aop = aop = aopForSym (ic, sym->usl.spillLoc, result); aop->size = getSize (sym->type); diff --git a/src/ds390/gen.c b/src/ds390/gen.c index ff42baaa..cc4aab11 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -746,7 +746,7 @@ aopOp (operand * op, iCode * ic, bool result, bool useDP2) } /* if already has a asmop then continue */ - if (op->aop && aop->size == getSize(sym->type)) + if (op->aop) return; /* if the underlying symbol has a aop */ @@ -827,6 +827,10 @@ aopOp (operand * op, iCode * ic, bool result, bool useDP2) } /* else spill location */ + if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) { + /* force a new aop if sizes differ */ + sym->usl.spillLoc->aop = NULL; + } sym->aop = op->aop = aop = aopForSym (ic, sym->usl.spillLoc, result, useDP2); aop->size = getSize (sym->type); diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 29d17115..6ea17c48 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -554,7 +554,7 @@ aopOp (operand * op, iCode * ic, bool result) } /* if already has a asmop then continue */ - if (op->aop && aop->size == getSize(sym->type)) + if (op->aop ) return; /* if the underlying symbol has a aop */ @@ -626,6 +626,10 @@ aopOp (operand * op, iCode * ic, bool result) } /* else spill location */ + if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) { + /* force a new aop if sizes differ */ + sym->usl.spillLoc->aop = NULL; + } sym->aop = op->aop = aop = aopForSym (ic, sym->usl.spillLoc, result); aop->size = getSize (sym->type); diff --git a/src/pic/gen.c b/src/pic/gen.c index 981eec6e..19197447 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -710,7 +710,7 @@ void aopOp (operand *op, iCode *ic, bool result) } /* if already has a asmop then continue */ - if (op->aop && aop->size == getSize(sym->type)) + if (op->aop) return ; /* if the underlying symbol has a aop */ @@ -780,6 +780,10 @@ void aopOp (operand *op, iCode *ic, bool result) } /* else spill location */ + if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) { + /* force a new aop if sizes differ */ + sym->usl.spillLoc->aop = NULL; + } DEBUGpic14_emitcode(";","%s %d %s",__FUNCTION__,__LINE__,sym->usl.spillLoc->rname); sym->aop = op->aop = aop = aopForSym(ic,sym->usl.spillLoc,result); diff --git a/src/z80/gen.c b/src/z80/gen.c index 2892942d..0f9a24c4 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -825,7 +825,7 @@ aopOp (operand * op, iCode * ic, bool result, bool requires_a) } /* if already has a asmop then continue */ - if (op->aop && aop->size == getSize(sym->type)) + if (op->aop) { return; } @@ -920,6 +920,10 @@ aopOp (operand * op, iCode * ic, bool result, bool requires_a) } /* else spill location */ + if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) { + /* force a new aop if sizes differ */ + sym->usl.spillLoc->aop = NULL; + } op->aop = aop = aopForSym (ic, sym->usl.spillLoc, result, requires_a); wassertl (aop->size >= getSize (sym->type), "Operand doesn't fit in the spill location");