From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78830 invoked by alias); 9 Mar 2018 14:50:49 -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 78818 invoked by uid 89); 9 Mar 2018 14:50:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Truth, H*M:11a9, Hx-languages-length:1735 X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Mar 2018 14:50:47 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E127D144B for ; Fri, 9 Mar 2018 14:50:46 +0000 (UTC) Received: from [10.10.120.42] (ovpn-120-42.rdu2.redhat.com [10.10.120.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id D040363529; Fri, 9 Mar 2018 14:50:45 +0000 (UTC) Subject: Re: [PR84682] disregard address constraints on non-addresses To: Alexandre Oliva , gcc-patches@gcc.gnu.org References: From: Vladimir Makarov Message-ID: Date: Fri, 09 Mar 2018 14:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00431.txt.bz2 On 03/09/2018 01:45 AM, Alexandre Oliva wrote: > LRA gets very confused when non-addresses are passed as operands to > asms with address contraints. Even if other constraints are > available, and the operand is a perfect fit for them, we'd still > attempt to process the operand as an address, and fail miserably at > that. > > Truth is, address constraints expect operands allowed by > address_operand, and we make sure this is the case throughout the > compiler, even in asm statements. The problem was that, if multiple > constraints were available, we wouldn't insist that the operand be > allowed by address_operand, but we would proceed as if it was, > regardless of any other constraints. > > To address this problem, I've arranged for LRA to attempt to deal with > address-constrained operands as addresses only when the is_address > flag is set, and to not set this flag in preprocess_constraints for > asm operands that are not allowed by address_operand. > > Regstrapped on i686- and x86_64-linux-gnu. Ok to install? It looks ok for me.  Thank you, Alex. > for gcc/ChangeLog > > PR rtl-optimization/84682 > * lra-constraints.c (process_address_1): Check is_address flag > for address constraints. > (process_alt_operands): Likewise. > * lra.c (lra_set_insn_recog_data): Pass asm operand locs to > preprocess_constraints. > * recog.h (preprocess_constraints): Add oploc parameter. > Adjust callers. > * recog.c (preprocess_constraints): Test address_operand for > CT_ADDRESS constraints. > > for gcc/testsuite/ChangeLog > > PR rtl-optimization/84682 > * gcc.dg/torture/pr84682-1.c: New. > * gcc.dg/torture/pr84682-2.c: New. > * gcc.dg/torture/pr84682-3.c: New. >