From: sandeep Date: Thu, 15 Nov 2001 22:50:53 +0000 (+0000) Subject: Added option --all-callee-saves will force all functions X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ea2533ccb113d26311e88d2fbbf606ea26357a25;p=fw%2Fsdcc Added option --all-callee-saves will force all functions to act as callee saves git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1599 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index f1316068..0c1f440f 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -229,7 +229,7 @@ struct options int useAccelerator; /* use ds390 Arithmetic Accelerator */ char *calleeSaves[128]; /* list of functions using callee save */ char *excludeRegs[32]; /* registers excluded from saving */ - + int all_callee_saves; /* callee saves for all functions */ /* starting address of the segments */ int xstack_loc; /* initial location of external stack */ int stack_loc; /* initial value of internal stack pointer */ diff --git a/src/SDCClrange.c b/src/SDCClrange.c index 254202a8..df34ff86 100644 --- a/src/SDCClrange.c +++ b/src/SDCClrange.c @@ -582,6 +582,7 @@ rlivePoint (eBBlock ** ebbs, int count) ic->rlive = bitVectSetBit (ic->rlive, lrange->key); } } +#if 0 /* overlapping live ranges should be eliminated */ if (ASSIGN_ITEMP_TO_ITEMP (ic)) { if (SPIL_LOC(IC_RIGHT(ic)) == SPIL_LOC(IC_RESULT(ic)) && /* left & right share the same spil location */ @@ -592,6 +593,7 @@ rlivePoint (eBBlock ** ebbs, int count) SPIL_LOC(IC_RIGHT(ic)) = NULL; /* then cannot share */ } } +#endif } } } diff --git a/src/SDCCmain.c b/src/SDCCmain.c index baed73f4..371d33b7 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -206,6 +206,7 @@ optionsTable[] = { { 0, OPTION_SHORT_IS_8BITS, NULL, "Make short 8bits (for old times sake)" }, { 0, "--profile", &options.profile, "On supported ports, generate extra profiling information" }, { 0, "--fommit-frame-pointer", &options.ommitFramePtr, "Leave out the frame pointer." }, + { 0, "--all-callee-saves", &options.all_callee_saves, "callee will always save registers used" }, { 0, "--use-accelerator", &options.useAccelerator,"generate code for DS390 Arithmetic Accelerator"} }; diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 8074d222..c3f14c47 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1541,6 +1541,7 @@ inCalleeSaveList (char *s) { int i; + if (options.all_callee_saves) return 1; for (i = 0; options.calleeSaves[i]; i++) if (strcmp (options.calleeSaves[i], s) == 0) return 1;