From: sandeep Date: Wed, 21 Nov 2001 17:11:55 +0000 (+0000) Subject: functions containing only __builtin functions can overlay variables X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=9adc1e115a66d97399e92f57a9298cdfbe68564a;hp=6829053c2534aed16a8141dcf0651a4d33932a37;p=fw%2Fsdcc 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 --- 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 */