* src/pic16/glue.c (pic16_initPointer): avoid assertion, emit better
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 21 May 2007 21:16:14 +0000 (21:16 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 21 May 2007 21:16:14 +0000 (21:16 +0000)
  error message instead
* src/pic/pcoderegs.c (pCodeOptime2pCodes): keep register state intact

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4810 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/pic/pcoderegs.c
src/pic16/glue.c

index 94899640b213d408d3037136595ae596dfe05fcb..9c9826d63906e287ee5dff7d56862510e3917e54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-21 Raphael Neider <rneider AT web.de>
+
+       * src/pic16/glue.c (pic16_initPointer): avoid assertion, emit better
+         error message instead
+       * src/pic/pcoderegs.c (pCodeOptime2pCodes): keep register state intact
+
 2007-05-21 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/mcs51/peeph.def (257.b): disabled to fix bug 1721024
index 25cdf421b3fd3768ca094091d91c707960944a83..8713a30d4003aabf51265e7cae330a07d254d058 100644 (file)
@@ -565,7 +565,8 @@ int pCodeOptime2pCodes(pCode *pc1, pCode *pc2, pCode *pcfl_used, regs *reg, int
                        newpc->seq = pc2->seq;
                        
                        //fprintf (stderr, "%s:%d(%s): Remove2pcodes (CLRF reg, ..., MOVF reg,W)\n", __FILE__, __LINE__, __FUNCTION__);
-                       Remove2pcodes(pcfl_used, pc2, NULL, reg, 0);
+                       //Remove2pcodes(pcfl_used, pc2, NULL, reg, 0);
+                       pc2->destruct(pc2);
                        //total_registers_saved++;  // debugging stats.
                }
        } else if((PCI(pc1)->op == POC_CLRF) && (PCI(pc2)->op == POC_IORFW) ){
index 02447f32891d8f9e76b5fa2c6bd738f494ed523e..158aa8a5eb842663a1c7e847caa277d8c9c8dd6c 100644 (file)
@@ -391,7 +391,7 @@ value *pic16_initPointer (initList * ilist, sym_link *toType)
     goto wrong;
   
   /* try it the old way first */
-  if ((val = constExprValue (expr, FALSE)))
+  if (expr->etype && (val = constExprValue (expr, FALSE)))
     return val;
   
   /* ( ptr + constant ) */
@@ -422,7 +422,7 @@ value *pic16_initPointer (initList * ilist, sym_link *toType)
      a variable or address of an array element */
   if (IS_AST_OP (expr) && expr->opval.op == '&') {
     /* address of symbol */
-    if (IS_AST_SYM_VALUE (expr->left)) {
+    if (IS_AST_SYM_VALUE (expr->left) && expr->left->etype) {
       val = AST_VALUE (expr->left);
       val->type = newLink (DECLARATOR);
       if(SPEC_SCLS (expr->left->etype) == S_CODE) {