* src/SDCCast.c (decorateType): fixed bug #870781
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 5 Jan 2004 20:51:59 +0000 (20:51 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 5 Jan 2004 20:51:59 +0000 (20:51 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3083 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCast.c

index cf4d5f845256bde366d163092b169898967f2191..3c08cc4049187057dd191660c5331f5666119d93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
        * sim/ucsim/gui.src/Makefile.in: fixed an old typo
        * src/mcs51/gen.c (genRightShift): fixed bug #870788
        * src/ds390/gen.c (genRightShift): fixed bug #870788
+       * src/SDCCast.c (decorateType): fixed bug #870781
 
 2004-01-06 Vangelis Rokas <vrokas@otenet.gr>
 
@@ -19,7 +20,7 @@
        genFunction,genEndFunction: setup stack frame for the
        generated function,
        genAddrOf: will be changed according to bug 863624
-       
+
        * added files genutils.c and genutils.h which contain gen*
        debugged and optimised functions extracted from gen.c
        
index 6974206c47e9d53b3f4177ffa9b000a9af4ec418..91cda09b09ff762c04ccb830c32b2bdfce40a991 100644 (file)
@@ -1594,7 +1594,7 @@ astHasSymbol (ast * tree, symbol * sym)
       else
        return FALSE;
     }
-  
+
   return astHasSymbol (tree->left, sym) ||
     astHasSymbol (tree->right, sym);
 }
@@ -2509,8 +2509,6 @@ decorateType (ast * tree)
        wtree = optimizeSWAP (tree);
        if (wtree != tree)
          return decorateType (wtree);
-        
-       // fall through
       }
 
       /* if left is a literal exchange left & right */
@@ -2537,6 +2535,8 @@ decorateType (ast * tree)
              decorateType (parent);
            }
         }
+      /* fall through */
+
       /*------------------------------------------------------------------*/
       /*----------------------------*/
       /*  bitwise xor               */
@@ -2578,7 +2578,8 @@ decorateType (ast * tree)
       /* if right is a literal and */
       /* we can find a 2nd literal in a xor-tree then */
       /* rearrange the tree */
-      if (IS_LITERAL (RTYPE (tree)))
+      if (IS_LITERAL (RTYPE (tree)) &&
+          tree->opval.op == '^') /* the same source is used by 'bitwise or' */
        {
          ast *parent;
          ast *litTree = searchLitOp (tree, &parent, "^");
@@ -2598,6 +2599,8 @@ decorateType (ast * tree)
                                            RTYPE (tree),
                                            FALSE));
 
+      return tree;
+
       /*------------------------------------------------------------------*/
       /*----------------------------*/
       /*  division                  */