Added option --all-callee-saves will force all functions
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 15 Nov 2001 22:50:53 +0000 (22:50 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 15 Nov 2001 22:50:53 +0000 (22:50 +0000)
to act as callee saves

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1599 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCglobl.h
src/SDCClrange.c
src/SDCCmain.c
src/SDCCsymt.c

index f13160684eead29d08b92d19535638ffa2e804d4..0c1f440f7a367f6cd2a2ee92e5a4bb02b09873c1 100644 (file)
@@ -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 */
index 254202a815178bbaf37e03ec5f71abf67bc49698..df34ff86633348204b3f8350b4e6b50aa09774b6 100644 (file)
@@ -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
        }
     }
 }
index baed73f45a9296a14cdd84d08e17e2feaf59bdb2..371d33b7e0bb4a9981113750eae1bbe42b0f96ea 100644 (file)
@@ -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"}
 };
 
index 8074d2224fde75eb0120f2915b3db3ebc3e7ff98..c3f14c47ed5e3ba624ab4153c44748ef225630fc 100644 (file)
@@ -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;