From patchwork Tue Apr 11 19:41:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 749617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w2crL241Fz9sNZ for ; Wed, 12 Apr 2017 05:41:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="KCwnedpB"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=nBoqsWg+FM8IG5o5FvoHeVnfUP6djRwLobdmRqYhOxTjlcXrcvCFM oGmbkNGjBiZ+/lIywIB6DmfH9Fe9zyRe7Xkhin/8/NgrFr9L8NI9anpOvJDv33dZ CJEXVct0jbM2lHGwuCCnutXXNkTqgw1q9BoDk4Vt5uSABLWHHijGOM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=W0iVJ3HvuVQXY1zjYtenlrhxpIs=; b=KCwnedpBm+90I+bN2ROV dEgVmrT9KkU6yO48q1dEFnCAWkBftzO8vrMDreGyAxxYYf7wXYKoEEYMCUhRhUZP caRUFmf+ipiHzjuK75/uX0U4+6ZGuaauSu/aGJ3+fmooyX0toUztYAnn27Lgwdto J6nZRwCDaBcb50trwJrigKI= Received: (qmail 107431 invoked by alias); 11 Apr 2017 19:41:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk 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 107421 invoked by uid 89); 11 Apr 2017 19:41:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Apr 2017 19:41:38 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 223167E9F7 for ; Tue, 11 Apr 2017 19:41:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 223167E9F7 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vmakarov@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 223167E9F7 Received: from [10.10.121.11] (ovpn-121-11.rdu2.redhat.com [10.10.121.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id D90161727F for ; Tue, 11 Apr 2017 19:41:38 +0000 (UTC) From: Vladimir Makarov Subject: One more patch for PR70478 To: "gcc-patches@gcc.gnu.org" Message-ID: <708c0b9e-4dc2-ba78-1018-aaa1fa8ba268@redhat.com> Date: Tue, 11 Apr 2017 15:41:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 X-IsSubscribed: yes A recent patch for PR70478 introduced a regression on ARM. Here is an additional patch to fix it. The patch was successfully tested and bootstrapped on x86-64. Committed as rev. 246854. Index: ChangeLog =================================================================== --- ChangeLog (revision 246853) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2017-04-11 Vladimir Makarov + + PR rtl-optimization/70478 + * lra-constraints.c (process_alt_operands): Check memory for + disfavoring memory insn operand. + 2017-04-11 Jakub Jelinek PR middle-end/80100 Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 246808) +++ lra-constraints.c (working copy) @@ -2722,12 +2722,14 @@ process_alt_operands (int only_alternati } } - /* When we use memory operand, the insn should read the - value from memory and even if we just wrote a value - into the memory it is costly in comparison with an - insn alternative which does not use memory - (e.g. register or immediate operand). */ - if (no_regs_p && offmemok) + /* When we use an operand requiring memory in given + alternative, the insn should write *and* read the + value to/from memory it is costly in comparison with + an insn alternative which does not use memory + (e.g. register or immediate operand). We exclude + memory operand for such case as we can satisfy the + memory constraints by reloading address. */ + if (no_regs_p && offmemok && !MEM_P (op)) { if (lra_dump_file != NULL) fprintf