From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125367 invoked by alias); 4 Dec 2018 22:56: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 125348 invoked by uid 89); 4 Dec 2018 22:56:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.6 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,KAM_SHORT,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=insns 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, 04 Dec 2018 22:56:45 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 685A4315486E for ; Tue, 4 Dec 2018 22:56:44 +0000 (UTC) Received: from [10.10.120.241] (ovpn-120-241.rdu2.redhat.com [10.10.120.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19ABC5E7DD for ; Tue, 4 Dec 2018 22:56:43 +0000 (UTC) From: Vladimir Makarov Subject: patch to fix PR88317 To: "gcc-patches@gcc.gnu.org" Message-ID: Date: Tue, 04 Dec 2018 22:56:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------51F225CBAC6C032FCF6AE0B1" X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00240.txt.bz2 This is a multi-part message in MIME format. --------------51F225CBAC6C032FCF6AE0B1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-length: 334   The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88317   The patch was successfully bootstrapped and tested on x86/x86-64.   I think the test is too big to add it to GCC testsuite.  If Richard implements bitmap poisoning, it would be possible to find a smaller test.   Committed as rev. 266803. --------------51F225CBAC6C032FCF6AE0B1 Content-Type: text/x-patch; name="pr88317.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr88317.patch" Content-length: 1914 Index: ChangeLog =================================================================== --- ChangeLog (revision 266802) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2018-12-04 Vladimir Makarov + + PR rtl-optimization/88317 + * lra-constraints.c (split_reg): Don't set up check_only_regs if + we are outside the inheritance pass. + 2018-12-04 Jan Hubicka * ipa-prop.c (jump_function_useful_p): New. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 266682) +++ lra-constraints.c (working copy) @@ -5496,7 +5496,9 @@ lra_copy_reg_equiv (unsigned int new_reg ORIGINAL_REGNO. NEXT_USAGE_INSNS specifies which instruction in the EBB next uses ORIGINAL_REGNO; it has the same form as the "insns" field of usage_insns. If TO is not NULL, we don't use - usage_insns, we put restore insns after TO insn. + usage_insns, we put restore insns after TO insn. It is a case when + we call it from lra_split_hard_reg_for, outside the inheritance + pass. The transformations look like: @@ -5652,16 +5654,18 @@ split_reg (bool before_p, int original_r && mode == PSEUDO_REGNO_MODE (original_regno)) lra_copy_reg_equiv (new_regno, original_regno); lra_reg_info[new_regno].restore_rtx = regno_reg_rtx[original_regno]; - bitmap_set_bit (&check_only_regs, new_regno); - bitmap_set_bit (&check_only_regs, original_regno); bitmap_set_bit (&lra_split_regs, new_regno); if (to != NULL) { + lra_assert (next_usage_insns == NULL); usage_insn = to; after_p = TRUE; } else { + /* We need check_only_regs only inside the inheritance pass. */ + bitmap_set_bit (&check_only_regs, new_regno); + bitmap_set_bit (&check_only_regs, original_regno); after_p = usage_insns[original_regno].after_p; for (;;) { --------------51F225CBAC6C032FCF6AE0B1--