From 9adc1e115a66d97399e92f57a9298cdfbe68564a Mon Sep 17 00:00:00 2001 From: sandeep Date: Wed, 21 Nov 2001 17:11:55 +0000 Subject: [PATCH] functions containing only __builtin functions can overlay variables git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1628 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCmem.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 613de3e2..4eeca0f5 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -1016,8 +1016,13 @@ canOverlayLocals (eBBlock ** ebbs, int count) iCode *ic; for (ic = ebbs[i]->sch; ic; ic = ic->next) - if (ic && (ic->op == CALL || ic->op == PCALL)) - return FALSE; + if (ic) { + if (ic->op == CALL) { + sym_link *ftype = operandType(IC_LEFT(ic)); + /* builtins only can use overlays */ + if (!IFFUNC_ISBUILTIN(ftype)) return FALSE; + } else if (ic->op == PCALL) return FALSE; + } } /* no function calls found return TRUE */ -- 2.39.5