* fixed GCC 4.4.0 mingw compilation:
[fw/sdcc] / src / pic16 / gen.c
index 358a2e266e2c18fa9f460776978fbc946a6e114b..461b8b2d27aa5113f15b541c4f1018a86a75118a 100644 (file)
@@ -1163,7 +1163,7 @@ void pic16_freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
                   }
                 }
 
-                {
+                if (_G.sregsAllocSet) {
                   regs *sr;
 
                     _G.sregsAllocSet = reverseSet( _G.sregsAllocSet );
@@ -8199,7 +8199,7 @@ static void genNearPointerGet (operand *left,
 
 #if 1
     if(IS_BITFIELD( retype )
-      && (SPEC_BLEN(operandType(result))==1)
+      && (SPEC_BLEN(retype)==1)
     ) {
       iCode *nextic;
       pCodeOp *jop;
@@ -8224,8 +8224,8 @@ static void genNearPointerGet (operand *left,
             /* everything is ok then */
             /* find a way to optimize the genIfx iCode */
 
-            bytestrt = SPEC_BSTR(operandType(result))/8;
-            bitstrt = SPEC_BSTR(operandType(result))%8;
+            bytestrt = SPEC_BSTR(retype)/8;
+            bitstrt = SPEC_BSTR(retype)%8;
 
             jop = pic16_popCopyGPR2Bit(pic16_popGet(AOP(left), 0), bitstrt);
 
@@ -9366,8 +9366,8 @@ static void genAssign (iCode *ic)
     pic16_addSign(result, AOP_SIZE(right), !IS_UNSIGNED(operandType(right)));
 
 release:
-  pic16_freeAsmop (right,NULL,ic,FALSE);
   pic16_freeAsmop (result,NULL,ic,TRUE);
+  pic16_freeAsmop (right,NULL,ic,FALSE);
 }
 
 /*-----------------------------------------------------------------*/