From patchwork Tue Jul 28 12:00:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 501181 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 83F3D140E10 for ; Tue, 28 Jul 2015 22:00:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=McxKfIOC; 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:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=UGy+mHoUvlsTy856d L2wxkulwRfFiCUWJecRqQ6sfrWaQryaFm4Egf3qqOjxW/LAqEgnKPVieaijVIxkR gHmp3L876VwRnzG7yRVpMlxOjd3NlMiBEFMTg0SL9eaBn0//8K9igYgtgcYmbXwb OQ42nEH2wmm79Qn1X6RHf/T9UY= 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:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=9+MOEe0ptFcgN2ucbiyXX+F 2Zl4=; b=McxKfIOCpoxMn45YdU7F1TU6ATFD2XZ83Qxvmo++A77UGlYPJ+TrOfK gJbmLVg/YY7Ju7xsDKz0QXU7EKw6xABpnugXBrpQFwfA+4rG1Tr07D9U3SwjR6SE 0qNE9ZyOsddV+7G8bEKWbjnQKajabV76JlKSmpqLneEUeVK7uK2Q= Received: (qmail 77673 invoked by alias); 28 Jul 2015 12:00:39 -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 77663 invoked by uid 89); 28 Jul 2015 12:00:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f46.google.com Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 28 Jul 2015 12:00:36 +0000 Received: by pachj5 with SMTP id hj5so68917408pac.3 for ; Tue, 28 Jul 2015 05:00:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=rEWwCIuOtwEWgapfODzYRri63iXkeO6QAwHuYEZ9W2Q=; b=joN6PX0tag1lMa+41wi9UdMUe1GsF2hv18VJy0/nMRfqB44rPQLnHwMcVkaIHXpDfl 16/xRHux19HAPGDnw/VtpPyl98f/Q7B98O3cQMY5T64BNkjaVZRK5FJ6DxEtHCtWV9VT vF07on5j8riimdQ5/pjYebx1xiSiq0zN5lHwmnTPc1uJKWT1l/d+Xj2hD4bzgmWXceoN e6Dd66fKxM8ThG9pkeLmaa/GyzUJCMS0vIVXpHFNAb4UUJNXrbkTlBx3jmGZWxLq0t/S e6kqwK2FFoFVrAF6T/zdNroJe7ifDIzE2niFtZ06scLLEwhdRMVDufqb0j0u7ca1fA8J yPiQ== X-Gm-Message-State: ALoCoQlH3JyyED0zrFvrc5wHkrdKxQCX/I7D0JC9R+WzEJEcK6WxclOBpiNc/o+VeV31fafJOsVS X-Received: by 10.66.62.133 with SMTP id y5mr81297274par.8.1438084834751; Tue, 28 Jul 2015 05:00:34 -0700 (PDT) Received: from [10.1.1.8] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by smtp.googlemail.com with ESMTPSA id bo10sm34885611pdb.83.2015.07.28.05.00.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 05:00:33 -0700 (PDT) Message-ID: <55B76ED9.8050108@linaro.org> Date: Tue, 28 Jul 2015 22:00:25 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andreas Schwab CC: Jeff Law , Maxim Kuvyrkov , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH 1/2] Allow REG_EQUAL for ZERO_EXTRACT References: <558FD9D5.9070703@linaro.org> <558FDA78.9030606@linaro.org> <559212EF.7080301@linaro.org> <44190061-8CD0-417F-8592-23EC3C0BB9A3@linaro.org> <5599BAE4.80103@linaro.org> <559AEF4C.6060506@redhat.com> <55AC685A.8080906@linaro.org> <87vbd6aevl.fsf@igel.home> In-Reply-To: <87vbd6aevl.fsf@igel.home> X-IsSubscribed: yes On 27/07/15 05:38, Andreas Schwab wrote: > Kugan writes: > >> * cse.c (cse_insn): Fix missing check for STRICT_LOW_PART and minor >> clean up. > > This breaks > > gcc.target/m68k/tls-ie-xgot.c scan-assembler jsr __m68k_read_tp > gcc.target/m68k/tls-ie.c scan-assembler jsr __m68k_read_tp > gcc.target/m68k/tls-le-xtls.c scan-assembler jsr __m68k_read_tp > gcc.target/m68k/tls-le.c scan-assembler jsr __m68k_read_tp > > Andreas. > Sorry for the breakage. My patch to add ZERO_EXTRACT unfortunately restricts the behaviour in one other case. That is, even when REG_EQUAL note and src are same, we were setting src_eqv to src when it is STRICT_LOW_PART. Not sure why but restored the old behaviour. I could reproduce this issue by inspecting the generated asm and made sure that it is fixed. However I could not run regression for m68k (Sorry I don’t have access to the set-up). I bootstrapped and regression tested on x86_64-linux-gnu and arm-none-linux-gnu with no new regressions. Thanks, Kugan gcc/ChangeLog: 2015-07-27 Kugan Vivekanandarajah * cse.c (cse_insn): Restoring old behaviour for src_eqv when dest and value in the REG_EQUAL are same and dest is STRICT_LOW_PART. diff --git a/gcc/cse.c b/gcc/cse.c index 96adf18..17c0954 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -4529,12 +4529,13 @@ cse_insn (rtx_insn *insn) this case, and if it isn't set, then there will be no equivalence for the destination. */ if (n_sets == 1 && REG_NOTES (insn) != 0 - && (tem = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0 - && (! rtx_equal_p (XEXP (tem, 0), SET_SRC (sets[0].rtl)))) + && (tem = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0) { - if (GET_CODE (SET_DEST (sets[0].rtl)) == STRICT_LOW_PART) - src_eqv = copy_rtx (XEXP (tem, 0)); + if (GET_CODE (SET_DEST (sets[0].rtl)) != ZERO_EXTRACT + && (! rtx_equal_p (XEXP (tem, 0), SET_SRC (sets[0].rtl)) + || GET_CODE (SET_DEST (sets[0].rtl)) == STRICT_LOW_PART)) + src_eqv = copy_rtx (XEXP (tem, 0)); /* If DEST is of the form ZERO_EXTACT, as in: (set (zero_extract:SI (reg:SI 119) (const_int 16 [0x10])