* src/SDCCopt.c (killDeadCode): fixed bug #907733
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 21 May 2004 07:09:29 +0000 (07:09 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 21 May 2004 07:09:29 +0000 (07:09 +0000)
* support/Util/SDCCerr: reworded E_AUTO_ASSUMED diagnostic to clarify
that the variable, not the function, should be static
* src/SDCCval.c (valCastLiteral): fixed bit initialization from literal
to be consistent with non-literal case

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

ChangeLog
src/SDCCopt.c
src/SDCCval.c
support/Util/SDCCerr.c

index f1cd2ef04ab9a9151f7e346ede4e7a5f23bafc6d..a48e4aea68f726faf41e4a0a652007bc167c48f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-05-21 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+       * src/SDCCopt.c (killDeadCode): fixed bug #907733
+       * support/Util/SDCCerr.c: reworded E_AUTO_ASSUMED diagnostic to clarify
+       that the variable, not the function, should be static
+       * src/SDCCval.c (valCastLiteral): fixed bit initialization from literal
+       to be consistent with non-literal case
+
 2004-05-19 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
 
        * src/SDCCast.c (isConformingBody): fixed bug #949967
index e76e30f39cd97ae71a17c880b6970b9eb28030d3..94ee6e187b5d0231dc418575b510578387eb20cd 100644 (file)
@@ -883,7 +883,8 @@ killDeadCode (eBBlock ** ebbs, int count)
              if (IC_RESULT (ic) && POINTER_SET (ic))
                continue;
               
-              if (POINTER_GET (ic) && IS_VOLATILE (operandType (IC_LEFT (ic))->next))
+              if (POINTER_GET (ic) && IS_VOLATILE (operandType (IC_LEFT (ic))->next)
+                 && !SPIL_LOC (IC_RESULT (ic)))
                 continue;
 
              /* if the result is used in the remainder of the */
@@ -947,6 +948,16 @@ killDeadCode (eBBlock ** ebbs, int count)
                        volRight = FALSE;
                    }
                  
+                 if (POINTER_GET (ic) && IS_VOLATILE (operandType (IC_LEFT (ic))->next))
+                   {
+                     if (SPIL_LOC (IC_RESULT (ic)))
+                       {
+                         IC_RESULT (ic) = newiTempFromOp (IC_RESULT (ic));
+                         SPIL_LOC (IC_RESULT (ic)) = NULL;
+                       }
+                     continue;
+                   }
+                 
                  change = 1;
                  gchange++;
                  
index 96c962a5168666fb795e20001f2d3c4ac515eb31..6b18f5ea2815b08c7c1d0b3692e0989e3a1d8baf 100644 (file)
@@ -1574,7 +1574,7 @@ valCastLiteral (sym_link * dtype, double fval)
       SPEC_CVAL (val->etype).v_float = fval;
   else if (SPEC_NOUN (val->etype) == V_BIT ||
            SPEC_NOUN (val->etype) == V_SBIT)
-    SPEC_CVAL (val->etype).v_uint = l & 1;   
+    SPEC_CVAL (val->etype).v_uint = l ? 1 : 0;
   else if (SPEC_NOUN (val->etype) == V_BITFIELD)
     SPEC_CVAL (val->etype).v_uint = l &
                                    (0xffffu >> (16 - SPEC_BLEN (val->etype)));
index 7f3b8a76556232d1f3ab376f249b4ef5df85f1c2..ac00fa6cd2abe0b327cc1164f605ee85a0d84fcf 100644 (file)
@@ -85,7 +85,7 @@ struct
 { W_INIT_IGNORED, ERROR_LEVEL_WARNING,
    "Variable in the storage class cannot be initialized.'%s'" },
 { E_AUTO_ASSUMED, ERROR_LEVEL_ERROR,
-   "storage class not allowed for automatic variable '%s' in reentrant function unless static" },
+   "variable '%s' must be static to have storage class in reentrant function" },
 { E_AUTO_ABSA, ERROR_LEVEL_ERROR,
    "absolute address not allowed for automatic var '%s' in reentrant function " },
 { W_INIT_WRONG, ERROR_LEVEL_WARNING,