* src/mcs51/gen.c (genCpl): quick fix for bug #974835
[fw/sdcc] / src / mcs51 / gen.c
index 8e5f49cff20d9039d2c5830a34d92d8630473ea7..ecd3bf860305d963f9ca599b1542dcedb369bd9b 100644 (file)
@@ -1611,9 +1611,8 @@ genCpl (iCode * ic)
     {
       if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY)
        {
-         emitcode ("mov", "c,%s", IC_LEFT (ic)->aop->aopu.aop_dir);
-         emitcode ("cpl", "c");
-         emitcode ("mov", "%s,c", IC_RESULT (ic)->aop->aopu.aop_dir);
+         /* promotion rules are responsible for this strange result: */
+         emitcode ("setb", "%s", IC_RESULT (ic)->aop->aopu.aop_dir);
          goto release;
        }