* src/SDCC.y: fixed bug #837365
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 7 Nov 2003 07:01:10 +0000 (07:01 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 7 Nov 2003 07:01:10 +0000 (07:01 +0000)
* 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

ChangeLog
device/lib/Makefile.in
device/lib/clean.mk
src/SDCC.y
src/hc08/gen.c
support/regression/tests/bitopcse.c

index 1e0cda7bce9383ed30f9fbc69959da1e3a880668..fd42d82da688a7c07c9a94ce615847968c28ad14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-11-07 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * 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 <borut.razem@siol.net>
 
        * configure, configure.in, sdcc_vc_in.h, sdcconf_in.h: reverted changes,
index a9c3d53382ce870fd214097c7506ef9ba3dc8988..d6a81b098f3a1065203d9e21de960bbd1578d87e 100644 (file)
@@ -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))
 
index 07d1c96d51e824ad700f982afcd6eadf184ebe4a..dd98ff7a6c7367fc2fd49b043a395814cec5b2f0 100644 (file)
@@ -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
 # -----------------------------------------------------------------
index 0dc2de06b448b06d379f157f2ef97bae04339bb1..91eb6aecdf5b45b0eb80ab64b13c253cce43b1e9 100644 (file)
@@ -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 ')'
index 12a0982cf362782cbc708af03a466d44c7f08f21..9f60de19fee3f42678e15669bdb3b8adaf1fbea3 100644 (file)
@@ -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);
index e12dcc5658e3deef4582075d8fe20ee69f092fdc..f8e5824148e71a2fb6c3b6b356b4e46b3480aa02 100644 (file)
@@ -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
 
 #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