Fixed a volatile optimalisation and some other small things
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 17 Mar 2001 16:17:42 +0000 (16:17 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 17 Mar 2001 16:17:42 +0000 (16:17 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@690 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCloop.c
src/SDCCsymt.c

index 453cba1fa728dfe7f359e000042d12ee5ab037f8..ef79a6b90a0df3a210ef3fb3bf002723343ff1c8 100644 (file)
@@ -447,6 +447,11 @@ loopInvariants (region * theLoop, eBBlock ** ebbs, int count)
               IS_OP_PARM (IC_RESULT (ic))))
            continue;
 
+         /* if result depends on a volatile then skip */
+         if ((IC_LEFT(ic) && isOperandVolatile(IC_LEFT(ic), TRUE)) ||
+             (IC_RIGHT(ic) && isOperandVolatile(IC_RIGHT(ic), TRUE)))
+           continue;
+
          lin = rin = 0;
 
          /* special case */
@@ -1161,7 +1166,6 @@ loopOptimizations (hTab * orderedLoops, eBBlock ** ebbs, int count)
   int change = 0;
   int k;
 
-
   /* if no loop optimizations requested */
   if (!optimize.loopInvariant &&
       !optimize.loopInduction)
index a69710cd2ab27f397fe6e719c2dac78d9e3116d8..99bb8e5a184b84788ea628ed889a76f9f965e816 100644 (file)
@@ -1725,6 +1725,9 @@ printTypeChain (sym_link * type, FILE * of)
     {
       if (IS_DECL (type))
        {
+         if (DCL_PTR_VOLATILE(type)) {
+           fprintf (of, "volatile ");
+         }
          switch (DCL_TYPE (type))
            {
            case FUNCTION:
@@ -1771,7 +1774,6 @@ printTypeChain (sym_link * type, FILE * of)
              if (DCL_PTR_CONST (type))
                fprintf (of, "const ");
              break;
-
            case ARRAY:
              fprintf (of, "array of ");
              break;