Hmmm, didn't do that in my early days just because ... but this is better
[fw/sdcc] / src / SDCCcse.c
index 1d6b3d9cba682b76ef8667e6c35744af0e862245..2af50769e65be213ac7b005587f9922374f485d4 100644 (file)
@@ -301,8 +301,9 @@ DEFSETFUNC (findCheaperOp)
     *opp = IC_RESULT (cdp->diCode);
 
   if ((*opp) && 
-      //(SPEC_USIGN(operandType (cop))==SPEC_USIGN(operandType (*opp))) &&
-      (SPEC_LONG(operandType (cop))==SPEC_LONG(operandType (*opp))))
+      (isOperandLiteral(*opp) ||
+       (SPEC_USIGN(operandType (cop))==SPEC_USIGN(operandType (*opp)) &&
+       (SPEC_LONG(operandType (cop))==SPEC_LONG(operandType (*opp))))))
     {
 
       if ((isGlobalInNearSpace (cop) &&