From patchwork Fri Sep 3 13:43:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1524339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=HRwBss9n; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H1Jtf5GsLz9sCD for ; Fri, 3 Sep 2021 23:44:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF246385840F for ; Fri, 3 Sep 2021 13:44:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF246385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1630676663; bh=lfKC8abbENf/LtOm6EGVsXWj5ORX7zkMx/Bu6iIDWN4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=HRwBss9nHSvPVONujL2ZTDGONS96zkWQqwzmiDWapUy1SuJQkDSA/rlgl24Dm+M4M rfL5hHLKSRrSuEJr4NzmV2uUDhfS60dSEItqlhzqRxZ7f9A7hlixhnAiOtcbH/I61e yORhA5fCsEKv8WEazlLJH6F5lIQffqF4zcRDMaG4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 50334385840F for ; Fri, 3 Sep 2021 13:43:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50334385840F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-526-welNDstgNc-8-TUljm2jvA-1; Fri, 03 Sep 2021 09:43:41 -0400 X-MC-Unique: welNDstgNc-8-TUljm2jvA-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id EDE85107ACCA; Fri, 3 Sep 2021 13:43:40 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.194.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08E6B18204; Fri, 3 Sep 2021 13:43:36 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 183DhYsZ733474 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 3 Sep 2021 15:43:34 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 183DhS2r733470; Fri, 3 Sep 2021 15:43:28 +0200 To: GCC patches Subject: [COMMITTED] Do not release state location until after path registry. Date: Fri, 3 Sep 2021 15:43:23 +0200 Message-Id: <20210903134323.733421-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" We are popping state and then calling the registry code. This causes the registry to have incorrect information. This isn't visible in current trunk, but will be an issue when I submit further enhancements to the threading code. However, it is a cleanup on its own so I am pushing it now. Tested on x86-64 Linux. Committed as obvious. gcc/ChangeLog: * tree-ssa-threadedge.c (jump_threader::thread_across_edge): Move pop until after a thread is registered. --- gcc/tree-ssa-threadedge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 37ee5c11be3..8a485125ff5 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -1155,9 +1155,9 @@ jump_threader::thread_across_edge (edge e) { propagate_threaded_block_debug_into (path->last ()->e->dest, e->dest); - m_state->pop (); BITMAP_FREE (visited); m_registry->register_jump_thread (path); + m_state->pop (); return; } else