]> git.gag.com Git - fw/sdcc/commitdiff
added option --no-xinit-opt
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 27 Dec 2002 11:51:33 +0000 (11:51 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 27 Dec 2002 11:51:33 +0000 (11:51 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2121 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCglobl.h
src/SDCCmain.c
src/ds390/gen.c
src/mcs51/gen.c
src/mcs51/main.c

index 4bfc4c3294e122930a5a414bc139382585a681db..1a62ccc42351e499a2b73d785d30fd6136313549 100644 (file)
@@ -289,7 +289,8 @@ extern int nlibFiles;
 extern char *libPaths[128];
 extern int nlibPaths;
 
-extern bool verboseExec ;
+extern bool verboseExec;
+extern bool noXinitOpt;
 
 void parseWithComma (char **, char *);
 
index 1f198456ae212829e4bf8ffa80635b88844bdddb..5c3e0e2782cc8f0662ccf41009e642ac1650d6c6 100644 (file)
@@ -72,6 +72,7 @@ char *relFiles[128];
 int nrelFiles = 0;
 bool verboseExec = FALSE;
 char *preOutName;
+bool noXinitOpt = FALSE;
 
 /* uncomment JAMIN_DS390 to always override and use ds390 port
   for mcs51 work.  This is temporary, for compatibility testing. */
@@ -116,6 +117,7 @@ char DefaultExePath[128];
 #define OPTION_NO_GCSE         "--nogcse"
 #define OPTION_SHORT_IS_8BITS  "--short-is-8bits"
 #define OPTION_TINI_LIBID      "--tini-libid"
+#define OPTION_NO_XINIT_OPT     "--no-xinit-opt"
 
 static const OPTION 
 optionsTable[] = {
@@ -197,6 +199,7 @@ optionsTable[] = {
     { 0,    "--tini-libid",        NULL,"<nnnn> LibraryID used in -mTININative"},
     { 0,    "--protect-sp-update",  &options.protect_sp_update,"DS390 - will disable interrupts during ESP:SP updates"},
     { 0,    "--parms-in-bank1",            &options.parms_in_bank1,"MCS51/DS390 - use Bank1 for parameter passing"},
+    { 0,    OPTION_NO_XINIT_OPT,    &noXinitOpt, "don't memcpy initialized xram from code"},
     /* End of options */
     { 0,    NULL }
 };
index d5c29aa6505e10e8c5fc7df2e4153a306fc6392f..77bae8aaf24e441ecfdb34b5652603453148d53a 100644 (file)
@@ -9489,7 +9489,7 @@ genPointerGet (iCode * ic, iCode *pi)
   if (p_type == GPOINTER && OP_SYMBOL(left)->remat &&
       IS_CAST_ICODE(OP_SYMBOL(left)->rematiCode)) {
          left = IC_RIGHT(OP_SYMBOL(left)->rematiCode);
-         type =   type = operandType (left);
+         type = operandType (left);
          p_type = DCL_TYPE (type);
   }
   /* now that we have the pointer type we assign
@@ -10158,7 +10158,7 @@ genPointerSet (iCode * ic, iCode *pi)
   if (p_type == GPOINTER && OP_SYMBOL(result)->remat &&
       IS_CAST_ICODE(OP_SYMBOL(result)->rematiCode)) {
          result = IC_RIGHT(OP_SYMBOL(result)->rematiCode);
-         type =   type = operandType (result);
+         type = operandType (result);
          p_type = DCL_TYPE (type);
   }
 
index 86b8664954173e62dadc497c25325f8282705f4c..933951931351312aafa1f12be73272c5d91c84d3 100644 (file)
@@ -7640,7 +7640,7 @@ genPointerGet (iCode * ic, iCode *pi)
   if (p_type == GPOINTER && OP_SYMBOL(left)->remat &&
       IS_CAST_ICODE(OP_SYMBOL(left)->rematiCode)) {
          left = IC_RIGHT(OP_SYMBOL(left)->rematiCode);
-         type =   type = operandType (left);
+         type = operandType (left);
          p_type = DCL_TYPE (type);
   }
   /* now that we have the pointer type we assign
@@ -8251,7 +8251,7 @@ genPointerSet (iCode * ic, iCode *pi)
   if (p_type == GPOINTER && OP_SYMBOL(result)->remat &&
       IS_CAST_ICODE(OP_SYMBOL(result)->rematiCode)) {
          result = IC_RIGHT(OP_SYMBOL(result)->rematiCode);
-         type =   type = operandType (result);
+         type = operandType (result);
          p_type = DCL_TYPE (type);
   }
   /* now that we have the pointer type we assign
index 7423dd3202869ec2e8ba65b3b5ed61885fcaffea..b1ca1f2998027469a02908f5f2a8a6e4dda89e59 100644 (file)
@@ -105,6 +105,10 @@ _mcs51_parseOptions (int *pargc, char **argv, int *i)
 static void
 _mcs51_finaliseOptions (void)
 {
+  if (noXinitOpt /* || options.model==MODEL_SMALL */) {
+    port->genXINIT=0;
+  }
+
   if (options.model == MODEL_LARGE) {
       port->mem.default_local_map = xdata;
       port->mem.default_globl_map = xdata;