]> git.gag.com Git - fw/sdcc/commitdiff
everything * 1 = everything
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 24 Apr 2001 18:37:40 +0000 (18:37 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 24 Apr 2001 18:37:40 +0000 (18:37 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@756 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c

index 2aae78cb8fba2b34a68c619aea8b93fc208b9e53..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