From patchwork Mon Oct 16 20:38:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 826505 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-464293-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="cN9u+8hA"; 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 3yG9CX5X93z9s2G for ; Tue, 17 Oct 2017 07:39:03 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=iKfmKxyiMqr7nxbDVjm9CeqhtI13uEHeeyX5bV/yLhSGe3980W op3ZXbyRqbrzP7xc85ydp1V4bdSo/2yKe5E4Nb/i3BV+M7xeKWjvZhSdBc9dmbht AnR6Lpkg13whO8Cxevsmakbsg6W1xzDngKcoA9j/cv5BJKLdJ2G1NCEww= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=pZgCO2suRGdwZxeBQt5LwMkEJc0=; b=cN9u+8hAO8bhe0XmJFkP ONooiDwnF46DDb0/cMzpCtt3EQ7vtDgcVBaJLB/My8zQ9yhjhSneHJrpKv8N/r4l k0ZWxfmAYyPYRT1q4JWgUsmyh4OI1jtv/+OeXlJDRo9b61lcCXJgvbwiCj61pGXZ bHwRbDiihBsnpv9yz89BqA8= Received: (qmail 97342 invoked by alias); 16 Oct 2017 20:38:55 -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 97333 invoked by uid 89); 16 Oct 2017 20:38:54 -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=2999, POINT, death 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; Mon, 16 Oct 2017 20:38:52 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B094C7EA84 for ; Mon, 16 Oct 2017 20:38:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B094C7EA84 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=vmakarov@redhat.com Received: from [10.10.124.63] (ovpn-124-63.rdu2.redhat.com [10.10.124.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D73B5D6B4 for ; Mon, 16 Oct 2017 20:38:50 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: patch to fix PR82353 Message-ID: <5794f39e-42ef-66da-e7f5-270ebc54cdf2@redhat.com> Date: Mon, 16 Oct 2017 16:38:49 -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 This is another version of the patch to fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82353 The patch was successfully bootstrapped on x86-64 with Go and Ada. Committed as rev. 253796. Index: ChangeLog =================================================================== --- ChangeLog (revision 253795) +++ ChangeLog (working copy) @@ -1,3 +1,12 @@ +2017-10-16 Vladimir Makarov + + PR sanitizer/82353 + * lra.c (collect_non_operand_hard_regs): Don't ignore operator + locations. + * lra-lives.c (bb_killed_pseudos, bb_gen_pseudos): Move up. + (make_hard_regno_born, make_hard_regno_dead): Update + bb_killed_pseudos and bb_gen_pseudos for fixed regs. + 2017-10-16 Jeff Law * tree-ssa-dse.c (live_bytes_read): Fix thinko. Index: lra.c =================================================================== --- lra.c (revision 253685) +++ lra.c (working copy) @@ -820,7 +820,8 @@ collect_non_operand_hard_regs (rtx *x, l const char *fmt = GET_RTX_FORMAT (code); for (i = 0; i < data->insn_static_data->n_operands; i++) - if (x == data->operand_loc[i]) + if (! data->insn_static_data->operand[i].is_operator + && x == data->operand_loc[i]) /* It is an operand loc. Stop here. */ return list; for (i = 0; i < data->insn_static_data->n_dups; i++) Index: lra-lives.c =================================================================== --- lra-lives.c (revision 253685) +++ lra-lives.c (working copy) @@ -220,6 +220,9 @@ lra_intersected_live_ranges_p (lra_live_ return false; } +/* The corresponding bitmaps of BB currently being processed. */ +static bitmap bb_killed_pseudos, bb_gen_pseudos; + /* The function processing birth of hard register REGNO. It updates living hard regs, START_LIVING, and conflict hard regs for living pseudos. Conflict hard regs for the pic pseudo is not updated if @@ -243,6 +246,8 @@ make_hard_regno_born (int regno, bool ch || i != REGNO (pic_offset_table_rtx)) #endif SET_HARD_REG_BIT (lra_reg_info[i].conflict_hard_regs, regno); + if (fixed_regs[regno]) + bitmap_set_bit (bb_gen_pseudos, regno); } /* Process the death of hard register REGNO. This updates @@ -255,6 +260,11 @@ make_hard_regno_dead (int regno) return; sparseset_set_bit (start_dying, regno); CLEAR_HARD_REG_BIT (hard_regs_live, regno); + if (fixed_regs[regno]) + { + bitmap_clear_bit (bb_gen_pseudos, regno); + bitmap_set_bit (bb_killed_pseudos, regno); + } } /* Mark pseudo REGNO as living at program point POINT, update conflicting @@ -299,9 +309,6 @@ mark_pseudo_dead (int regno, int point) } } -/* The corresponding bitmaps of BB currently being processed. */ -static bitmap bb_killed_pseudos, bb_gen_pseudos; - /* Mark register REGNO (pseudo or hard register) in MODE as live at program point POINT. Update BB_GEN_PSEUDOS. Return TRUE if the liveness tracking sets were modified, or FALSE