From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76476 invoked by alias); 11 Nov 2015 12:21:41 -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 76462 invoked by uid 89); 11 Nov 2015 12:21:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Nov 2015 12:21:38 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 54FE549; Wed, 11 Nov 2015 04:21:24 -0800 (PST) Received: from [10.2.206.27] (e105545-lin.cambridge.arm.com [10.2.206.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4051F3F2E5; Wed, 11 Nov 2015 04:21:36 -0800 (PST) Subject: Re: [PATCH] PR67305, tighten neon_vector_mem_operand on eliminable registers To: Jiong Wang , GCC Patches References: <5639D3A8.5040606@foss.arm.com> Cc: Kyrill Tkachov From: Ramana Radhakrishnan Message-ID: <564332D0.4010509@foss.arm.com> Date: Wed, 11 Nov 2015 12:21: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: <5639D3A8.5040606@foss.arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01351.txt.bz2 On 04/11/15 09:45, Jiong Wang wrote: > As discussed at the bugzilla > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67305 > > neon_vector_mem_operand is broken. As the comments says > "/* Reject eliminable registers. */", the code block at the head > of this function which checks eliminable registers is designed to do > early reject only, there shouldn't be any early accept. > > If this code hunk doesn't reject the incoming rtx, then the rtx pattern > should still go through all default checks below. All other similar > functions, thumb1_legitimate_address_p, arm_coproc_mem_operand, > neon_struct_mem_operand etc are exactly follow this check flow. > > So as Jim Wilson commented on the bugzilla, instead of "return !strict", > we need to only do the check if strict be true, and only does rejection > which means return FALSE, for all other cases, we need to go through > those normal checks below. > > neon_vector_mem_operand is only used by several misalign pattern, I > guess that's why this bug is not exposed for long time. > > boostrap & regression OK on armv8 aarch32, ok for trunk? > > 2015-11-04 Jiong Wang > Jim Wilson > > gcc/ > PR target/67305 > * config/arm/arm.md (neon_vector_mem_operand): Return FALSE if strict > be true and eliminable registers mentioned. > This has been lurking for a long time ... Sorry about the delay in reviewing. This is OK for trunk regards Ramana > > neon-mem.patch > > > diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c > index 87e55e9..7fbf897 100644 > --- a/gcc/config/arm/arm.c > +++ b/gcc/config/arm/arm.c > @@ -12957,14 +12957,14 @@ neon_vector_mem_operand (rtx op, int type, bool strict) > rtx ind; > > /* Reject eliminable registers. */ > - if (! (reload_in_progress || reload_completed) > - && ( reg_mentioned_p (frame_pointer_rtx, op) > + if (strict && ! (reload_in_progress || reload_completed) > + && (reg_mentioned_p (frame_pointer_rtx, op) > || reg_mentioned_p (arg_pointer_rtx, op) > || reg_mentioned_p (virtual_incoming_args_rtx, op) > || reg_mentioned_p (virtual_outgoing_args_rtx, op) > || reg_mentioned_p (virtual_stack_dynamic_rtx, op) > || reg_mentioned_p (virtual_stack_vars_rtx, op))) > - return !strict; > + return FALSE; > > /* Constants are converted into offsets from labels. */ > if (!MEM_P (op)) >