From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13468 invoked by alias); 26 Sep 2011 16:01:36 -0000 Received: (qmail 13425 invoked by uid 22791); 26 Sep 2011 16:01:32 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,TW_HR,TW_RQ X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Sep 2011 16:01:13 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (klopstock mo43) (RZmta 26.7) with ESMTPA id Q00b09n8QFltBJ ; Mon, 26 Sep 2011 17:57:03 +0200 (MEST) Message-ID: <4E80A0CF.2030806@gjlay.de> Date: Mon, 26 Sep 2011 17:34:00 -0000 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Denis Chertykov , Anatoly Sokolov , Eric Weddington Subject: [Patch,AVR]: Housekeeping: Clean-up notice_update_cc Content-Type: multipart/mixed; boundary="------------090308040702080803000802" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg01624.txt.bz2 This is a multi-part message in MIME format. --------------090308040702080803000802 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 555 This patchlet represents the impact of insn ashrqi3 on CC by means of attribute "cc" instead of hard-coding it in notice_update_cc. Testsuite passes fine. Moreover, tested against code like char c; void func_1 (char a) { a = a >> 7; if (a) c = a; } that triggered PR39633. Ok? Johann * config/avr/avr.md (ashrqi3): Split alternative "n" into its remaining parts C03, C04, C05, C06, C07 and describe impact on CC by attribute "cc" appropriately. * config/avr/avr.c (notice_update_cc): Clean-up: Don't patch CC0 by digging RTX. --------------090308040702080803000802 Content-Type: text/x-patch; name="cleanup-update-cc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cleanup-update-cc.diff" Content-length: 1990 Index: config/avr/avr.md =================================================================== --- config/avr/avr.md (revision 179191) +++ config/avr/avr.md (working copy) @@ -2820,14 +2820,14 @@ (define_insn "*ashlsi3_const" ;; arithmetic shift right (define_insn "ashrqi3" - [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r,r") - (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0") - (match_operand:QI 2 "general_operand" "r,L,P,K,n,Qm")))] + [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r ,r ,r") + (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0 ,0 ,0") + (match_operand:QI 2 "general_operand" "r,L,P,K,C03 C04 C05,C06 C07,Qm")))] "" "* return ashrqi3_out (insn, operands, NULL);" - [(set_attr "length" "5,0,1,2,5,9") + [(set_attr "length" "5,0,1,2,5,5,9") (set_attr "adjust_len" "ashrqi") - (set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber")]) + (set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,clobber,clobber")]) (define_insn "ashrhi3" [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r,r") Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 179191) +++ config/avr/avr.c (working copy) @@ -1574,26 +1574,6 @@ notice_update_cc (rtx body ATTRIBUTE_UNU case CC_CLOBBER: /* Insn doesn't leave CC in a usable state. */ CC_STATUS_INIT; - - /* Correct CC for the ashrqi3 with the shift count as CONST_INT < 6 */ - set = single_set (insn); - if (set) - { - rtx src = SET_SRC (set); - - if (GET_CODE (src) == ASHIFTRT - && GET_MODE (src) == QImode) - { - rtx x = XEXP (src, 1); - - if (CONST_INT_P (x) - && IN_RANGE (INTVAL (x), 1, 5)) - { - cc_status.value1 = SET_DEST (set); - cc_status.flags |= CC_OVERFLOW_UNUSABLE; - } - } - } break; } } --------------090308040702080803000802--