From: epetrich Date: Fri, 7 Nov 2003 07:01:10 +0000 (+0000) Subject: * src/SDCC.y: fixed bug #837365 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c5ab913103340a0b5bdfa93dbc7be5a14ca204cd;p=fw%2Fsdcc * src/SDCC.y: fixed bug #837365 * support/regression/tests/bitopcse.c * src/hc08/gen.c (genPointerGet): Don't assume pointer operand is a symbol (might be valop instead) * device/lib/Makefile.in: added errno.c to HC08SOURCES * device/lib/clean.mk: added hc08 to the cleaning list git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2998 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 1e0cda7b..fd42d82d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-11-07 Erik Petrich + + * src/SDCC.y: fixed bug #837365 + * support/regression/tests/bitopcse.c + * src/hc08/gen.c (genPointerGet): Don't assume pointer operand is + a symbol (might be valop instead) + * device/lib/Makefile.in: added errno.c to HC08SOURCES + * device/lib/clean.mk: added hc08 to the cleaning list + 2003-11-04 Borut Razem * configure, configure.in, sdcc_vc_in.h, sdcconf_in.h: reverted changes, diff --git a/device/lib/Makefile.in b/device/lib/Makefile.in index a9c3d533..d6a81b09 100644 --- a/device/lib/Makefile.in +++ b/device/lib/Makefile.in @@ -140,7 +140,7 @@ HC08SOURCES = _atof.c _atoi.c _atol.c _schar2fs.c \ fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \ cosf.c logf.c log10f.c sqrtf.c tancotf.c tanf.c cotf.c \ asincosf.c asinf.c acosf.c atanf.c atan2f.c sincoshf.c \ - sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c + sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c errno.c HC08OBJECTS = $(patsubst %.c,$(PORTDIR)/%.rel,$(HC08SOURCES)) diff --git a/device/lib/clean.mk b/device/lib/clean.mk index 07d1c96d..dd98ff7a 100644 --- a/device/lib/clean.mk +++ b/device/lib/clean.mk @@ -13,6 +13,7 @@ clean: make -C ds390 clean make -C z80 clean make -C gbz80 clean + make -C hc08 clean # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- diff --git a/src/SDCC.y b/src/SDCC.y index 0dc2de06..91eb6aec 100644 --- a/src/SDCC.y +++ b/src/SDCC.y @@ -976,16 +976,20 @@ declarator2 sym_link *p ; value *tval; - p = (tval = constExprValue($3,TRUE))->etype; + tval = constExprValue($3,TRUE); /* if it is not a constant then Error */ - if ( SPEC_SCLS(p) != S_LITERAL) + p = newLink (DECLARATOR); + DCL_TYPE(p) = ARRAY ; + if ( !tval || (SPEC_SCLS(tval->etype) != S_LITERAL)) { werror(E_CONST_EXPECTED) ; + /* Assume a single item array to limit the cascade */ + /* of additional errors. */ + DCL_ELEM(p) = 1; + } else { - p = newLink (DECLARATOR); - DCL_TYPE(p) = ARRAY ; DCL_ELEM(p) = (int) floatFromVal(tval) ; - addDecl($1,0,p); } + addDecl($1,0,p); } | declarator2 '(' ')' { addDecl ($1,FUNCTION,NULL) ; } | declarator2 '(' { NestLevel++ ; currBlockno++; } parameter_type_list ')' diff --git a/src/hc08/gen.c b/src/hc08/gen.c index 12a0982c..9f60de19 100644 --- a/src/hc08/gen.c +++ b/src/hc08/gen.c @@ -6491,7 +6491,7 @@ genPointerGet (iCode * ic, iCode *pi) } /* special case when cast remat */ - if (p_type == GPOINTER && OP_SYMBOL(left)->remat && + if (p_type == GPOINTER && IS_SYMOP(left) && OP_SYMBOL(left)->remat && IS_CAST_ICODE(OP_SYMBOL(left)->rematiCode)) { left = IC_RIGHT(OP_SYMBOL(left)->rematiCode); type = operandType (left); diff --git a/support/regression/tests/bitopcse.c b/support/regression/tests/bitopcse.c index e12dcc56..f8e58241 100644 --- a/support/regression/tests/bitopcse.c +++ b/support/regression/tests/bitopcse.c @@ -10,7 +10,7 @@ #define _{type} -#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) +#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) || defined(SDCC_hc08) # define NO_BIT_TYPE #endif @@ -32,10 +32,10 @@ #elif defined(_long) # define MASK 0xffffffff #else -# warning Unknow type +# warning Unknown type #endif -#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) +#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80) || defined(SDCC_hc08) # define idata # define code #endif