From patchwork Thu May 21 12:38:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 474996 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7F80E14016A for ; Thu, 21 May 2015 22:39:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Z1f6BRtc; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:in-reply-to:references :content-type:mime-version; q=dns; s=default; b=Tc7PnDrnLzNHqtNN xXTkhOEfcbuPnvxe8wjn7RuHiCMH59DTS3CiSI22qZu8eOltNTovd/zMPuPSKZ4o b55KE6DPfOdVt18kXNbo1KQ2+ydTzKJ3fYUvldFtFkDOQ5mI0xKySqldmF/Y/W8B Waz5+QmbD+SUgtSKUqeZbJWPcG4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:in-reply-to:references :content-type:mime-version; s=default; bh=RsAmoh7RIF7sUAjRwn9Hud 5v608=; b=Z1f6BRtcBSMrxOxK7UqKVDTMjI2OgPw7IWqGkmo0+HH3Wqmxn7nRq4 t43yepcRAsVGAS54PKZt8P4DPjwmyWTaWyL+vPoJY28iDTYeuMS5QGH8h21JoSrk Ur5fnpnWLDaiib/zihZ5x53FB2NuBAFJfwLsuxGS18lZaCg4Em22E= Received: (qmail 42810 invoked by alias); 21 May 2015 12:38:53 -0000 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 Received: (qmail 42801 invoked by uid 89); 21 May 2015 12:38:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mailout03.t-online.de Received: from mailout03.t-online.de (HELO mailout03.t-online.de) (194.25.134.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 May 2015 12:38:50 +0000 Received: from fwd16.aul.t-online.de (fwd16.aul.t-online.de [172.20.26.243]) by mailout03.t-online.de (Postfix) with SMTP id 25F9F1084C8 for ; Thu, 21 May 2015 14:38:47 +0200 (CEST) Received: from [192.168.0.107] (rfpNtuZVghl3I3WrzohUUvDIj8eCmmZKE3ifH-DSS1YLaCmGv-r+mdnc10RepafQxz@[84.180.117.138]) by fwd16.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1YvPkL-43K9Nw0; Thu, 21 May 2015 14:38:45 +0200 Message-ID: <1432211923.2625.255.camel@yam-132-YW-E178-FTW> Subject: Re: [SH][committed] Fix gcc.target/sh/pr54236-2.c failures From: Oleg Endo To: gcc-patches Date: Thu, 21 May 2015 14:38:43 +0200 In-Reply-To: <1432022663.2625.203.camel@yam-132-YW-E178-FTW> References: <1432022663.2625.203.camel@yam-132-YW-E178-FTW> Mime-Version: 1.0 X-IsSubscribed: yes On Tue, 2015-05-19 at 10:04 +0200, Oleg Endo wrote: > Since a recent change to the tree optimizers > https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00089.html > some related SH patterns stopped working. The attached patch fixes > this. > > Tested briefly with 'make all' and with > make -k check-gcc RUNTESTFLAGS="sh.exp=pr54236* --target_board=sh-sim > \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" > > Committed as r223346. This is a follow up patch which fixes two oversights in the above change. Tested as above, Committed as r223479. Cheers, Oleg gcc/ChangeLog: PR target/54236 * config/sh/sh.md (*round_int_even): Reject pattern if operands[0] and operands[1] are the same. testsuite/ChangeLog: PR target/54236 * gcc.target/sh/pr54236-2.c: Fix typo in comment. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 223478) +++ gcc/config/sh/sh.md (working copy) @@ -2011,7 +2011,8 @@ (and:SI (plus:SI (match_operand:SI 1 "arith_reg_operand") (const_int 1)) (const_int -2)))] - "TARGET_SH1 && !TARGET_SH2A && can_create_pseudo_p ()" + "TARGET_SH1 && !TARGET_SH2A && can_create_pseudo_p () + && !reg_overlap_mentioned_p (operands[0], operands[1])" "#" "&& 1" [(set (match_dup 0) (const_int -2)) Index: gcc/testsuite/gcc.target/sh/pr54236-2.c =================================================================== --- gcc/testsuite/gcc.target/sh/pr54236-2.c (revision 223478) +++ gcc/testsuite/gcc.target/sh/pr54236-2.c (working copy) @@ -133,7 +133,7 @@ test_016 (int a, int b, int c, int d) { // non-SH2A: 1x add #1, 1x mov #-2, 1x and - // SH2A: 1x add #1, 1x blcr #0 + // SH2A: 1x add #1, 1x bclr #0 return a + (a & 1); }