Added test suite spec
[fw/sdcc] / src / SDCCicode.c
index 84c6123f18fc43e1c0fb103b1c3479253b47ce11..98c9da14e5e3913c73b7f7d08afecd0372b2e898 100644 (file)
@@ -1911,8 +1911,11 @@ geniCodeAdd (operand * left, operand * right)
   if (IS_PTR (ltype))
     {
       isarray = left->isaddr;
-      size  =  operandFromLit (getSize (ltype->next));
-      right = geniCodeMultiply (right, size, (getArraySizePtr(left) >= INTSIZE));
+      // there is no need to multiply with 1
+      if (getSize(ltype->next)!=1) {
+       size  = operandFromLit (getSize (ltype->next));
+       right = geniCodeMultiply (right, size, (getArraySizePtr(left) >= INTSIZE));
+      }
       resType = copyLinkChain (ltype);
     }
   else
@@ -2505,10 +2508,10 @@ geniCodeLogic (operand * left, operand * right, int op)
   ic = newiCode (op, left, right);
   IC_RESULT (ic) = newiTempOperand (newCharLink (), 1);
 
-  /* if comparing anything greater than one byte
+  /* if comparing float
      and not a '==' || '!=' || '&&' || '||' (these
      will be inlined */
-  if (getSize (ctype) > 1 &&
+  if (IS_FLOAT(ctype) &&
       op != EQ_OP &&
       op != NE_OP &&
       op != AND_OP &&