* src/mcs51/peep.c (): fixed bug 1712928
[fw/sdcc] / src / mcs51 / peep.c
index 872dded4c587274b8ad5e31274e45c073aaad6cb..ad52c518e46b959fdd5d1a114eff8779363f050f 100644 (file)
@@ -216,7 +216,7 @@ isFunc (const lineNode *pl)
 
 /*-----------------------------------------------------------------*/
 /* isCallerSaveFunc - returns TRUE if it's a 'normal' function     */
-/* call and it's a 'caller save' (not 'callee save')               */
+/* call and it's a 'caller save' (not 'callee save' or 'naked')    */
 /*-----------------------------------------------------------------*/
 static bool
 isCallerSaveFunc (const lineNode *pl)
@@ -225,6 +225,8 @@ isCallerSaveFunc (const lineNode *pl)
     return FALSE;
   if (FUNC_CALLEESAVES(OP_SYM_TYPE(IC_LEFT(pl->ic))))
     return FALSE;
+  if (FUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT(pl->ic))))
+    return FALSE;
   return TRUE;
 }