From 25f7990b26e956f51525151bb0ecbbd1edd15b21 Mon Sep 17 00:00:00 2001 From: kvigor Date: Mon, 18 Sep 2000 21:41:31 +0000 Subject: [PATCH] Allow optimizer to replace params/locals in far space with registers for DS390 port git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@377 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCcse.c | 4 +--- src/SDCCicode.c | 7 ++++--- src/SDCCsymt.c | 3 +-- src/port.h | 4 ++++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/SDCCcse.c b/src/SDCCcse.c index 952a3050..a23e391b 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -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; diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 2704b942..3b89daff 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -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 ; diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index c91eb6a6..0879b882 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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 ) ; } diff --git a/src/port.h b/src/port.h index 8a3e6401..f59c124a 100644 --- a/src/port.h +++ b/src/port.h @@ -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 -- 2.39.2