From patchwork Tue Dec 4 22:56:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1007910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-491666-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sET2+cHv"; dkim-atps=neutral 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 438cgX5F4Pz9s7W for ; Wed, 5 Dec 2018 09:56:56 +1100 (AEDT) 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=AYrox2Ul/HhpYL4awf2ehGQ8prIojCPmGuhV102RDT92OV6xREFEh tOXjYKfDUiaXRIhQOOA9aK1HM8Ay/DfmYZAAmGF2+qr7XdKaJqgRoikfg5MRPSo+ ky2mQ334IftRDC7asDKrm3nKjvwsE0tsK2GFxe9yJmxQ2u2sCfaP3w= 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=5aouvOUUonT/upqp+fb4eRhL7Pg=; b=sET2+cHvJZLI1tDgiqUJ C/breLhehlVBxrD2UtSzZl1zv5EvTjGB097s+kx9Xb7ptdLqZu/gUBifhtIp8cxb hehrVaFIx+vU+dC+wmj8Wr2sA7Gton95lPKcIPyWxDsaxg7xDLeV/nJadnb6Og1n AFDdXGSsLohpp+Nc0jDbSAA= 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-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 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, 4 Dec 2018 17:56:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-IsSubscribed: yes 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. 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 (;;) {