}
/*------------------------------------------------------------------*/
-/* inCalleeSaveList - return 1 if found in calle save list */
+/* inCalleeSaveList - return 1 if found in callee save list */
/*------------------------------------------------------------------*/
bool
inCalleeSaveList (char *s)
if (SPEC_INTRTN (csym->etype) != SPEC_INTRTN (sym->etype))
{
werror (E_PREV_DEF_CONFLICT, csym->name, "interrupt");
- return 0;
}
if (SPEC_BANK (csym->etype) != SPEC_BANK (sym->etype))
{
werror (E_PREV_DEF_CONFLICT, csym->name, "using");
- return 0;
+ }
+
+ if (SPEC_NAKED (csym->etype) != SPEC_NAKED (sym->etype))
+ {
+ werror (E_PREV_DEF_CONFLICT, csym->name, "_naked");
}
/* compare expected agrs with actual args */
/* if the registers have been saved already then
do nothing */
- if (ic->regsSaved || (OP_SYMBOL (IC_LEFT (ic))->calleeSave))
+ if (ic->regsSaved || (OP_SYMBOL (IC_LEFT (ic))->calleeSave) ||
+ SPEC_NAKED(OP_SYM_ETYPE(IC_LEFT(ic))))
return;
/* find the registers in use at this time
}
detype = getSpec (operandType (IC_LEFT (ic)));
-
-#if 0 // why should we do this here??? jwk20011105
- if (detype &&
- (SPEC_BANK (currFunc->etype) != SPEC_BANK (detype)) &&
- IS_ISR (currFunc->etype) &&
- !ic->bankSaved)
- saveRBank (SPEC_BANK (detype), ic, TRUE);
-#endif
-
}
+
/*-----------------------------------------------------------------*/
/* unsaveRegisters - pop the pushed registers */
/*-----------------------------------------------------------------*/
D (emitcode (";", "genCall "););
- /* if we are calling a function that is not using
+ /* if we are calling a not _naked function that is not using
the same register bank then we need to save the
destination registers on the stack */
detype = getSpec (operandType (IC_LEFT (ic)));
- if (detype &&
+ if (detype && !SPEC_NAKED(detype) &&
(SPEC_BANK (currFunc->etype) != SPEC_BANK (detype)) &&
IS_ISR (currFunc->etype))
{
/* make sure the right side does not have any definitions
inbetween */
dbv = OP_DEFS(IC_RIGHT(dic));
- for (lic = ic; lic != dic ; lic = lic->prev) {
+ for (lic = ic; lic && lic != dic ; lic = lic->prev) {
if (bitVectBitValue(dbv,lic->key)) return ;
}
/* make sure they have the same type */
return;
}
- /* if the registers have been saved already then
+ /* if the registers have been saved already or don't need to be then
do nothing */
- if (ic->regsSaved || (OP_SYMBOL (IC_LEFT (ic))->calleeSave))
+ if (ic->regsSaved || (OP_SYMBOL (IC_LEFT (ic))->calleeSave) ||
+ SPEC_NAKED(OP_SYM_ETYPE(IC_LEFT (ic))))
return;
/* find the registers in use at this time
detype = getSpec (operandType (IC_LEFT (ic)));
-#if 0 // why should we do this here??? jwk20011105
- if (detype &&
- (SPEC_BANK (currFunc->etype) != SPEC_BANK (detype)) &&
- IS_ISR (currFunc->etype) &&
- !ic->bankSaved)
- saveRBank (SPEC_BANK (detype), ic, TRUE);
-#endif
-
}
/*-----------------------------------------------------------------*/
/* unsaveRegisters - pop the pushed registers */
_G.sendSet = NULL;
}
- /* if we are calling a function that is not using
+ /* if we are calling a not _naked function that is not using
the same register bank then we need to save the
destination registers on the stack */
detype = getSpec (operandType (IC_LEFT (ic)));
- if (detype &&
+ if (detype && !SPEC_NAKED(detype) &&
(SPEC_BANK (currFunc->etype) != SPEC_BANK (detype)) &&
IS_ISR (currFunc->etype))
{