functions containing only __builtin functions can overlay variables
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 21 Nov 2001 17:11:55 +0000 (17:11 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 21 Nov 2001 17:11:55 +0000 (17:11 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1628 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCmem.c

index 613de3e200c8b067c76dc30f4183c54bbd74b833..4eeca0f5dbf845c51d25ec632f16fd0841cde746 100644 (file)
@@ -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 */