From patchwork Fri Apr 17 16:32:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 462154 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 145EC140213 for ; Sat, 18 Apr 2015 02:32:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=vsMTzN7Y; dkim-adsp=none (unprotected policy); 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:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; q=dns; s= default; b=Y2FaHr2HDxdiWb+ESpLbOR/wMPXHZyLfBzUb9xA46jN2bfM+A/Skb gRl1CLWhjhxWNmhAwXprMGItOoB65hXuz2Xquw4gxigv51NTKJxIBlF2HYdd6rH4 3THPD3AJ8F/mTzyU6O7bWSMg/mgResbwDXsWS3TIH17S1icCZtTL3g= 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:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; s=default; bh=VdZIqraRmUD9/ssI3H5HeThFBNo=; b=vsMTzN7YNKE7VrStmr9Bqj5sbMrQ 9lRZyJjAgIaxN8cZzp4WCkSo+th71oQIKxBNKnHc2lg3swnQ1DCtptvU3DxKy8iF RVT0MVIUBgmKy6jjMBaRTDK+Gy7yGBWBIH6zqU4OokWHl6xEyukA+X1Q5G6PIF+w 3XGtBR66Kg8MMEo= Received: (qmail 9811 invoked by alias); 17 Apr 2015 16:32:50 -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 9801 invoked by uid 89); 17 Apr 2015 16:32:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e37.co.us.ibm.com Received: from e37.co.us.ibm.com (HELO e37.co.us.ibm.com) (32.97.110.158) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 17 Apr 2015 16:32:48 +0000 Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Apr 2015 10:32:46 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 17 Apr 2015 10:32:45 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 546981FF0025 for ; Fri, 17 Apr 2015 10:23:55 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3HGWiXr35323946 for ; Fri, 17 Apr 2015 09:32:44 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3HGWibh011374 for ; Fri, 17 Apr 2015 10:32:44 -0600 Received: from [9.65.140.82] (sig-9-65-140-82.ibm.com [9.65.140.82]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t3HGWhbo011306; Fri, 17 Apr 2015 10:32:43 -0600 Message-ID: <1429288364.20720.17.camel@gnopaine> Subject: Re: [PATCH, 5.1, rs6000] Fix PR65787 From: Bill Schmidt To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Date: Fri, 17 Apr 2015 11:32:44 -0500 In-Reply-To: <1429282924.20720.13.camel@gnopaine> References: <1429220775.20720.4.camel@gnopaine> <1429273663.20720.6.camel@gnopaine> <1429277282.20720.8.camel@gnopaine> <20150417144938.GR1725@tucnak.redhat.com> <1429282924.20720.13.camel@gnopaine> Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15041716-0025-0000-0000-000009F50392 X-IsSubscribed: yes Hi, On Fri, 2015-04-17 at 10:02 -0500, Bill Schmidt wrote: > On Fri, 2015-04-17 at 16:49 +0200, Jakub Jelinek wrote: > > You have actually mailed the original patch again, not the revised one. > > > That said, PARALLEL seems to be already handled by rtx_is_swappable_p, > > so if it isn't handled correctly, perhaps there is a bug in that function. > > Quite right. I've fixed this as you suggested in the attached patch. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this version ok? Sorry for apparently not knowing my own code as well as I should... :/ Thanks, Bill 2015-04-17 Bill Schmidt PR target/65787 * config/rs6000/rs6000.c (rtx_is_swappable_p): Remove previous fix; ensure that a subsequent SH_NONE operand does not overwrite an existing *special value. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 222182) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -34204,17 +34204,6 @@ rtx_is_swappable_p (rtx op, unsigned int *special) else return 0; - case PARALLEL: - /* A vec_extract operation may be wrapped in a PARALLEL with a - clobber, so account for that possibility. */ - if (XVECLEN (op, 0) != 2) - return 0; - - if (GET_CODE (XVECEXP (op, 0, 1)) != CLOBBER) - return 0; - - return rtx_is_swappable_p (XVECEXP (op, 0, 0), special); - case UNSPEC: { /* Various operations are unsafe for this optimization, at least @@ -34308,6 +34297,8 @@ rtx_is_swappable_p (rtx op, unsigned int *special) { unsigned int special_op = SH_NONE; ok &= rtx_is_swappable_p (XVECEXP (op, i, j), &special_op); + if (special_op == SH_NONE) + continue; /* Ensure we never have two kinds of special handling for the same insn. */ if (*special != SH_NONE && special_op != SH_NONE