From 64b70d26ad7a49b6b0eaedafea75472807ba6ab4 Mon Sep 17 00:00:00 2001 From: rth Date: Thu, 30 Oct 2003 00:55:15 +0000 Subject: [PATCH] * config/m68k/m68k.c (notice_update_cc): Clear cc status for shifts and rotates. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73073 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/config/m68k/m68k.c | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c71967e1776..dbb059ecbd9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-10-29 Richard Henderson + + * config/m68k/m68k.c (notice_update_cc): Clear cc status for + shifts and rotates. + 2003-10-30 Alan Modra * config/rs6000/rs6000.md: Remove duplicate pattern. diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 565e41ff7cd..ee41fc67d2f 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -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; -- 2.11.0