From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53580 invoked by alias); 4 Nov 2015 09:45:22 -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 53530 invoked by uid 89); 4 Nov 2015 09:45:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,T_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, 04 Nov 2015 09:45:16 +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 373F93A1; Wed, 4 Nov 2015 01:45:05 -0800 (PST) Received: from [10.2.206.22] (e104437-lin.cambridge.arm.com [10.2.206.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 87B193F487; Wed, 4 Nov 2015 01:45:14 -0800 (PST) From: Jiong Wang Subject: [PATCH] PR67305, tighten neon_vector_mem_operand on eliminable registers To: GCC Patches Cc: Ramana Radhakrishnan , Kyrill Tkachov Message-ID: <5639D3A8.5040606@foss.arm.com> Date: Wed, 04 Nov 2015 09:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080606080300060704090008" X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00308.txt.bz2 This is a multi-part message in MIME format. --------------080606080300060704090008 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1265 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. --------------080606080300060704090008 Content-Type: text/x-patch; name="neon-mem.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="neon-mem.patch" Content-length: 878 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)) --------------080606080300060704090008--