(alter_cond): If CC_NOT_SIGNED, convert signed conditions to unsigned.
authorJames Van Artsdalen <jrv@gnu.org>
Mon, 12 Oct 1992 21:37:11 +0000 (21:37 +0000)
committerJames Van Artsdalen <jrv@gnu.org>
Mon, 12 Oct 1992 21:37:11 +0000 (21:37 +0000)
From-SVN: r2413

gcc/final.c

index 49df7b0e3189d5e1fdf802f1eb849fffa3c3a9b1..16da27dbc89086ee4dc1e9f81994dc02ec8fd091 100644 (file)
@@ -1940,7 +1940,33 @@ alter_cond (cond)
        value = 2;
        break;
       }
-  
+
+  if (cc_status.flags & CC_NOT_SIGNED)
+    /* The flags are valid if signed condition operators are converted
+       to unsigned.  */
+    switch (GET_CODE (cond))
+      {
+      case LE:
+       PUT_CODE (cond, LEU);
+       value = 2;
+       break;
+
+      case LT:
+       PUT_CODE (cond, LTU);
+       value = 2;
+       break;
+
+      case GT:
+       PUT_CODE (cond, GTU);
+       value = 2;
+       break;
+
+      case GE:
+       PUT_CODE (cond, GEU);
+       value = 2;
+       break;
+      }
+
   return value;
 }
 #endif