m68k.c (notice_update_cc): Clear cc status for shifts and rotates.
authorRichard Henderson <rth@redhat.com>
Thu, 30 Oct 2003 00:55:15 +0000 (16:55 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 30 Oct 2003 00:55:15 +0000 (16:55 -0800)
        * config/m68k/m68k.c (notice_update_cc): Clear cc status for
        shifts and rotates.

From-SVN: r73073

gcc/ChangeLog
gcc/config/m68k/m68k.c

index c71967e177603e96aa8618b9946f2783dbaf46de..dbb059ecbd9ce6fa20205d77a5233b8c619d3ba3 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-29  Richard Henderson  <rth@redhat.com>
+
+       * config/m68k/m68k.c (notice_update_cc): Clear cc status for
+       shifts and rotates.
+
 2003-10-30  Alan Modra  <amodra@bigpond.net.au>
 
        * config/rs6000/rs6000.md: Remove duplicate pattern.
index 565e41ff7cd1909bd250443675aef8400fbc5b7c..ee41fc67d2f8064f9ed091dbf8ddd8327af8cc6c 100644 (file)
@@ -2595,12 +2595,17 @@ notice_update_cc (rtx exp, rtx insn)
   if (cc_status.value2 != 0)
     switch (GET_CODE (cc_status.value2))
       {
-      case PLUS: case MINUS: case MULT:
-      case DIV: case UDIV: case MOD: case UMOD: case NEG:
-#if 0 /* These instructions always clear the overflow bit */
       case ASHIFT: case ASHIFTRT: case LSHIFTRT:
       case ROTATE: case ROTATERT:
-#endif
+       /* These instructions always clear the overflow bit, and set
+          the carry to the bit shifted out.  */
+       /* ??? We don't currently have a way to signal carry not valid,
+          nor do we check for it in the branch insns.  */
+       CC_STATUS_INIT;
+       break;
+
+      case PLUS: case MINUS: case MULT:
+      case DIV: case UDIV: case MOD: case UMOD: case NEG:
        if (GET_MODE (cc_status.value2) != VOIDmode)
          cc_status.flags |= CC_NO_OVERFLOW;
        break;