From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77591 invoked by alias); 6 Nov 2015 12:26:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 77581 invoked by uid 89); 6 Nov 2015 12:26:48 -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_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mailout4.samsung.com Received: from mailout4.samsung.com (HELO mailout4.samsung.com) (203.254.224.34) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 06 Nov 2015 12:26:46 +0000 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXE01P417WJHT30@mailout4.samsung.com> for gcc-patches@gcc.gnu.org; Fri, 06 Nov 2015 21:26:43 +0900 (KST) Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 19.0B.23663.38C9C365; Fri, 6 Nov 2015 21:26:43 +0900 (KST) Received: from [106.109.129.227] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NXE003667WGF800@mmp2.samsung.com>; Fri, 06 Nov 2015 21:26:43 +0900 (KST) Subject: Re: [PATCH][ARM/AArch64] PR 68088: Fix RTL checking ICE due to subregs inside accumulator forwarding check To: Kyrill Tkachov , GCC Patches References: <56309E44.8070100@arm.com> Cc: Marcus Shawcroft , Ramana Radhakrishnan , Richard Earnshaw , James Greenhalgh From: Nikolai Bozhenov Message-id: <563C9C7F.3040402@samsung.com> Date: Fri, 06 Nov 2015 12:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-version: 1.0 In-reply-to: <56309E44.8070100@arm.com> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-SW-Source: 2015-11/txt/msg00610.txt.bz2 On 10/28/2015 01:07 PM, Kyrill Tkachov wrote: > Hi all, > > This RTL checking error occurs on aarch64 in > aarch_accumulator_forwarding when processing an msubsi insn > with subregs: > (insn 15 14 16 3 (set (reg/v:SI 78 [ i ]) > (minus:SI (subreg:SI (reg/v:DI 76 [ aul ]) 0) > (mult:SI (subreg:SI (reg:DI 83) 0) > (subreg:SI (reg:DI 75 [ _20 ]) 0)))) schedice.c:10 357 > {*msubsi} > > The register_operand predicate for that pattern allows subregs (I > think correctly). > The code in aarch_accumulator_forwarding doesn't take that into > account and ends up > taking a REGNO of a SUBREG, causing a checking error. > > This patch fixes that by stripping the subregs off the accumulator rtx > before > checking that the inner expression is a REG and taking its REGNO. > > The testcase now works fine with an aarch64-none-elf toolchain > configure for RTL checking. > > The testcase is taken verbatim from the BZ entry for PR 68088. > Since this function is shared between arm and aarch64 I've > bootstrapped and tested it on both > and I'll need ok's for both ports. > > Ok for trunk? > > Thanks, > Kyrill > > 2015-10-28 Kyrylo Tkachov > > PR target/68088 > * config/arm/aarch-common.c (aarch_strip_subreg): New function. > (aarch_accumulator_forwarding): Strip subregs from accumulator rtx > when appropriate. > > 2015-10-28 Kyrylo Tkachov > > * gcc.target/aarch64/pr68088_1.c: New test. Hi! I faced the same issue but I had somewhat different RTL for the consumer: (insn 20 15 21 2 (set (reg/i:SI 0 r0) (minus:SI (subreg:SI (reg:DI 117) 4) (mult:SI (reg:SI 123) (reg:SI 114)))) gasman.c:4 48 {*mulsi3subsi}) where (reg:DI 117) is produced by umulsidi3_v6 instruction. Is it really true that (subreg:SI (reg:DI 117) 4) may be forwarded in one cycle in this case? Thanks, Nikolai