Allow optimizer to replace params/locals in far space with registers for DS390 port
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Sep 2000 21:41:31 +0000 (21:41 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Sep 2000 21:41:31 +0000 (21:41 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@377 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCcse.c
src/SDCCicode.c
src/SDCCsymt.c
src/port.h

index 952a3050d61066e45386c411547151537c878f06..a23e391b768cdbddc20f59471b090cc7017e871b 100644 (file)
@@ -1126,9 +1126,7 @@ static void fixUpTypes(iCode *ic)
 {
        link *t1 = operandType(IC_LEFT(ic)) ,*t2;
        
-       extern PORT ds390_port;
-       
-       if (port == &ds390_port)
+       if (IS_DS390_PORT)
        {
            /* hack-o-matic! */
            return;
index 2704b942ec9e9630f20e828ce24f75276b8ae070..3b89daff3965e6dcd35b6521940328d0a1b58cb2 100644 (file)
@@ -1087,7 +1087,7 @@ operand *operandFromSymbol (symbol *sym)
     /* under the following conditions create a
        register equivalent for a local symbol */
     if (sym->level && sym->etype && SPEC_OCLS(sym->etype) &&
-       IN_FARSPACE(SPEC_OCLS(sym->etype))  &&
+       (IN_FARSPACE(SPEC_OCLS(sym->etype)) && (!IS_DS390_PORT)) &&
        options.stackAuto == 0)
        ok =0;
 
@@ -2423,8 +2423,9 @@ static void geniCodeReceive (value *args)
               and before liveRange calculation */          
            if (!sym->addrtaken && !IS_VOLATILE(sym->etype)) {
 
-               if(IN_FARSPACE(SPEC_OCLS(sym->etype)) &&
-                  options.stackAuto == 0) {
+               if (IN_FARSPACE(SPEC_OCLS(sym->etype)) &&
+                  options.stackAuto == 0 &&
+                  !IS_DS390_PORT) {
                } else {
                    opl = newiTempOperand(args->type,0);
                    sym->reqv = opl ;       
index c91eb6a6f4dfa77d6c65d3114f251d7d7b8e1697..0879b882e71070e4d360265052aaaab4d75f85a4 100644 (file)
@@ -1024,8 +1024,7 @@ static void  checkSClass ( symbol *sym )
             * control this allcoation, but the code was originally that way, and
             * changing it for non-390 ports breaks the compiler badly.
             */
-           extern PORT ds390_port;
-           bool useXdata = (port == &ds390_port) ? options.model : options.useXstack;
+           bool useXdata = IS_DS390_PORT ? options.model : options.useXstack;
            SPEC_SCLS(sym->etype) = (useXdata  ?
                                     S_XDATA : S_FIXED ) ;
        }
index 8a3e6401397bfe15b3dbab94b5c33033bacf2da2..f59c124a14b8666e31ad7d46509bc2307e023534 100644 (file)
@@ -165,4 +165,8 @@ typedef struct {
 
 extern PORT *port;
 
+/* Ugly test to see if we are current compiling in DS390 mode. */
+extern PORT ds390_port;
+#define IS_DS390_PORT (port == &ds390_port)
+
 #endif