From patchwork Sun Sep 2 16:55:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 181201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AA3CB2C0091 for ; Mon, 3 Sep 2012 02:55:38 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1347209740; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Subject:From:To:Date:Content-Type:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=0C+pjEyKELu0YcZoazbh Lmgsf0Y=; b=QqKZsXD5/8J1rSxeKPUbS4ElvwrLnAfu4C/Oeo91Ww8RgxTuozab qVZqIjpFhKvgCcDR0b5wNJ8Y7KDSZ31UAYkmIx9aQqVdxrbX6IxzgdUNnsMAFEPy Q/8jK7Sdw1KqbgqcoxDQYOOOBs4OzJ4nM9LLDmRG42Ud58+Z3euRDCg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Subject:From:To:Date:Content-Type:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TzMsN/K3DzY54vlOnH+gq6s692DG6BJfRm261gLzW5MxNbN9m08AKWX87RKXKZ HxkXrqoWWjhmk0ELu791CUiuB21N/eeOQRmCoNOMdtAjx8Jb2hqIyGIYG7dIKfPh vmyr1wYtBqEutLWC1LgnjqjlXlX83yzB0IHlmAieA/phA=; Received: (qmail 13162 invoked by alias); 2 Sep 2012 16:55:34 -0000 Received: (qmail 13152 invoked by uid 22791); 2 Sep 2012 16:55:34 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD, SUBJ_ALL_CAPS, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout11.t-online.de (HELO mailout11.t-online.de) (194.25.134.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 Sep 2012 16:55:20 +0000 Received: from fwd00.aul.t-online.de (fwd00.aul.t-online.de ) by mailout11.t-online.de with smtp id 1T8DSA-0002zO-J1; Sun, 02 Sep 2012 18:55:18 +0200 Received: from [192.168.0.100] (Xpy-pZZEwheWJSoCC+JF2mc3cx4R-O2raqxKba9LVdS9Dn4occWv8DDZYoFBHj7g1d@[87.157.54.121]) by fwd00.t-online.de with esmtp id 1T8DS0-1bxHE00; Sun, 2 Sep 2012 18:55:08 +0200 Message-ID: <1346604902.2200.52.camel@yam-132-YW-E178-FTW> Subject: [SH] PR 54418 From: Oleg Endo To: gcc-patches Date: Sun, 02 Sep 2012 18:55:02 +0200 Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello, This is the patch for this issue as mentioned in the PR. Tested on rev 190840 with make -k check RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" and no new failures. OK? Cheers, Oleg ChangeLog: PR target/54418 * config/sh/sh.md (cmpgeusi_t): Remove N alternative. Check operands[1] in split condition instead of operands[0]. Add comments. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 190840) +++ gcc/config/sh/sh.md (working copy) @@ -1043,13 +1043,19 @@ ;; SImode unsigned integer comparisons ;; ------------------------------------------------------------------------- +;; Usually comparisons of 'unsigned int >= 0' are optimized away completely. +;; However, especially when optimizations are off (e.g. -O0) such comparisons +;; might remain and we have to handle them. If the '>= 0' case wasn't +;; handled here, something else would just load a '0' into the second operand +;; and do the comparison. We can do slightly better by just setting the +;; T bit to '1'. (define_insn_and_split "cmpgeusi_t" [(set (reg:SI T_REG) (geu:SI (match_operand:SI 0 "arith_reg_operand" "r") - (match_operand:SI 1 "arith_reg_or_0_operand" "rN")))] + (match_operand:SI 1 "arith_reg_or_0_operand" "r")))] "TARGET_SH1" "cmp/hs %1,%0" - "&& satisfies_constraint_Z (operands[0])" + "&& satisfies_constraint_Z (operands[1])" [(set (reg:SI T_REG) (const_int 1))] "" [(set_attr "type" "mt_group")])