Fix library build error introduced in last commit
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 18 Aug 2000 20:30:49 +0000 (20:30 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 18 Aug 2000 20:30:49 +0000 (20:30 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@320 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCsymt.c

index 02fad1ff6f0940058bf71e62b7c4c5b672624ee2..a60dc6b9facb2fea4084e96f2eba81e36623a4fe 100644 (file)
@@ -1016,11 +1016,21 @@ static void  checkSClass ( symbol *sym )
     /* the storage class to reflect where the var will go */
     if ( sym->level && SPEC_SCLS(sym->etype) == S_FIXED) {
        if ( options.stackAuto || (currFunc && IS_RENT(currFunc->etype)))
+       {
            SPEC_SCLS(sym->etype) = (options.useXstack  ?
                                     S_XSTACK : S_STACK ) ;
+       }
        else
-           SPEC_SCLS(sym->etype) = (options.model  ?
+       {
+           /* hack-o-matic! I see no reason why the useXstack option should ever
+            * 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;
+           SPEC_SCLS(sym->etype) = (useXdata  ?
                                     S_XDATA : S_DATA ) ;
+       }
     }
 }