From: johanknol Date: Thu, 20 Mar 2003 11:00:11 +0000 (+0000) Subject: An sfr/sbit can have an "at #" AND an initializer X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3631711f5675d5599c6f69632f2631b37447a6c7;p=fw%2Fsdcc An sfr/sbit can have an "at #" AND an initializer git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2401 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index a2066a19..eda10543 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -3540,7 +3540,7 @@ createBlock (symbol * decl, ast * body) ast *ex; /* if the block has nothing */ - if (!body) + if (!body && !decl) return NULL; ex = newNode (BLOCK, NULL, body); diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 54c8d012..40d422b1 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -351,14 +351,6 @@ allocGlobal (symbol * sym) SPEC_SCLS (sym->etype) == S_SBIT) { - /* if both absolute address & initial */ - /* value specified then error */ - if (IS_ABSOLUTE (sym->etype) && sym->ival) - { - werror (E_SFR_INIT, sym->name); - sym->ival = NULL; - } - SPEC_OCLS (sym->etype) = (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit); @@ -683,15 +675,6 @@ allocLocal (symbol * sym) if (SPEC_SCLS (sym->etype) == S_SFR || SPEC_SCLS (sym->etype) == S_SBIT) { - - /* if both absolute address & initial */ - /* value specified then error */ - if (IS_ABSOLUTE (sym->etype) && sym->ival) - { - werror (E_SFR_INIT, sym->name); - sym->ival = NULL; - } - SPEC_OCLS (sym->etype) = (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit); diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index c124e791..2c8926c2 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1134,21 +1134,11 @@ checkSClass (symbol * sym, int isProto) if (SPEC_SCLS (sym->etype) == S_LITERAL && !SPEC_ENUM (sym->etype)) SPEC_SCLS (sym->etype) = S_AUTO; - /* if sfr or sbit then must also be */ - /* volatile the initial value will be xlated */ - /* to an absolute address */ + /* if sfr or sbit then must also be volatile */ if (SPEC_SCLS (sym->etype) == S_SBIT || SPEC_SCLS (sym->etype) == S_SFR) { SPEC_VOLATILE (sym->etype) = 1; - /* if initial value given */ - if (sym->ival) - { - SPEC_ABSA (sym->etype) = 1; - SPEC_ADDR (sym->etype) = - (int) list2int (sym->ival); - sym->ival = NULL; - } } /* if absolute address given then it mark it as