From 757f865299d9aa9336b99b0ef09f79303a81e76f Mon Sep 17 00:00:00 2001 From: sandeep Date: Sun, 25 Nov 2001 23:24:55 +0000 Subject: [PATCH] Fixed problem where slocs can be shared by two operands, in which case then should go to different aops if the sizes differ git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1645 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/avr/gen.c | 2 +- src/mcs51/gen.c | 2 +- src/pic/gen.c | 2 +- src/z80/gen.c | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/avr/gen.c b/src/avr/gen.c index 7a453019..c2cb6e27 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) + if (op->aop && aop->size == getSize(sym->type)) return; /* if the underlying symbol has a aop */ diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 26ffca96..29d17115 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) + if (op->aop && aop->size == getSize(sym->type)) return; /* if the underlying symbol has a aop */ diff --git a/src/pic/gen.c b/src/pic/gen.c index afc8beb3..981eec6e 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) + if (op->aop && aop->size == getSize(sym->type)) return ; /* if the underlying symbol has a aop */ diff --git a/src/z80/gen.c b/src/z80/gen.c index ee1ddaad..2892942d 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) + if (op->aop && aop->size == getSize(sym->type)) { return; } @@ -924,8 +924,6 @@ aopOp (operand * op, iCode * ic, bool result, bool requires_a) aopForSym (ic, sym->usl.spillLoc, result, requires_a); wassertl (aop->size >= getSize (sym->type), "Operand doesn't fit in the spill location"); aop->size = getSize (sym->type); - /* PENDING: HACK. Can have different sizes in the same AOP. */ - sym->usl.spillLoc->aop = NULL; return; } -- 2.30.2