* src/SDCCast.c (decorateType): disabled a transformation I added in
[fw/sdcc] / src / SDCCast.c
index fcf18e220e2559e82f311c62bf240018ce02f156..a0fe596018246c8bf72eb8ab948ed580d540897f 100644 (file)
@@ -2242,6 +2242,10 @@ decorateType (ast * tree)
        break;
       }
       
+      /* This breaks with extern declarations, bitfields, and perhaps other */
+      /* cases (gcse). Let's leave this optimization disabled for now and   */
+      /* ponder if there's a safe way to do this. -- EEP                    */
+      #if 0
       if (IS_ADDRESS_OF_OP (tree->left) && IS_AST_SYM_VALUE(tree->left->left)
           && SPEC_ABSA (AST_SYMBOL (tree->left->left)->etype))
         {
@@ -2274,7 +2278,8 @@ decorateType (ast * tree)
             tree->left = NULL;
             tree->right = NULL;
         }
-
+      #endif
+      
       return tree;
 
       /*------------------------------------------------------------------*/
@@ -5696,3 +5701,23 @@ void PA(ast *t)
 {
        ast_print(t,stdout,0);
 }
+
+
+
+/*-----------------------------------------------------------------*/
+/* astErrors : returns non-zero if errors present in tree          */
+/*-----------------------------------------------------------------*/
+int astErrors(ast *t)
+{
+  int errors=0;
+  
+  if (t)
+    {
+      if (t->isError)
+        errors++;
+      errors += astErrors(t->left);
+      errors += astErrors(t->right);
+    }
+    
+  return errors;
+}