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: 51586 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id DD5BD214B7 for ; Tue, 28 Jul 2015 12:00:55 +0000 (UTC) Received: by wilm20 with SMTP id m20sf37935581wil.2 for ; Tue, 28 Jul 2015 05:00:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type:x-original-sender :x-original-authentication-results; bh=rEWwCIuOtwEWgapfODzYRri63iXkeO6QAwHuYEZ9W2Q=; b=VESCv1flJvAzm1+wU61fvhb499wqQzFTEmr0aNbFonACW3hASpecMO2cDoPjZEmXTV 100GXOBk5Bq2udOQv1gvp7veEJ8Vu8vaLD3SojR3/P/j6gSD6pgNLIQaXyAwDnMu1Ykm r1btvF21qWSskZYr+OjzKCmcRRy44qqYlpatXvC8HqHGp8fCyu+SytUwm70kRE4QDNjj bfW90+jwkQ8WQZXIsz7oqJmUlXv2hO40jer0wHuODQo2Yozew6U5oelCsmGRK7p3NKTX cZFmI7r39BXNQi85f/8+J6V2NLC5OejzWW0dk0kTx1BpN3O8OBICn2H0f8jkFvoZmbiX xDHA== X-Gm-Message-State: ALoCoQk3CS9OYM0hYpXh6yBOfDua3005g1J8IZJuE8AC3MAx9/+KyZ4zUaWV5OeO1DXqRA6+dJX1 X-Received: by 10.112.9.100 with SMTP id y4mr13869778lba.20.1438084855010; Tue, 28 Jul 2015 05:00:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.74 with SMTP id g10ls782039lab.92.gmail; Tue, 28 Jul 2015 05:00:54 -0700 (PDT) X-Received: by 10.152.203.233 with SMTP id kt9mr28266290lac.99.1438084854581; Tue, 28 Jul 2015 05:00:54 -0700 (PDT) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com. [2a00:1450:4010:c04::22f]) by mx.google.com with ESMTPS id q10si18126028lbp.109.2015.07.28.05.00.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 05:00:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) client-ip=2a00:1450:4010:c04::22f; Received: by lbbyj8 with SMTP id yj8so72995408lbb.0 for ; Tue, 28 Jul 2015 05:00:54 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr33001914laf.32.1438084854115; Tue, 28 Jul 2015 05:00:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2094642lba; Tue, 28 Jul 2015 05:00:52 -0700 (PDT) X-Received: by 10.50.43.227 with SMTP id z3mr6100691igl.22.1438084852030; Tue, 28 Jul 2015 05:00:52 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c132si18433045ioc.69.2015.07.28.05.00.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 05:00:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-404111-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 77673 invoked by alias); 28 Jul 2015 12:00:39 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 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-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 X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 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])