From patchwork Fri Aug 5 12:31:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 399 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:20da:b0:2d3:3019:e567 with SMTP id n26csp162148pxc; Fri, 5 Aug 2022 05:32:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR40ghF0tgt8u0aYy/TwWyWHsK0t5bVsOgtHV9uHae6W/whJKYDs4gahHIKIT9HiD6CmaoFe X-Received: by 2002:a05:6402:378e:b0:43e:73f7:5c53 with SMTP id et14-20020a056402378e00b0043e73f75c53mr6515094edb.124.1659702766877; Fri, 05 Aug 2022 05:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659702766; cv=none; d=google.com; s=arc-20160816; b=vB4e+Poegsxx1PcxeClbOacd0tnhvaHKoKK/jHd7Oh8SxycbejygEQ31kovikwu1X3 9raJiLVy2+yzg6NZfqImU65tu88Uoc36W8ktChBWI8lcm93DbYFQaCVxlrGtdF39ANqr CGXOgH+AG44OJBYwemuTLQWkdszAksU3HJRBovgWxytlxGl8DuPFNd8C1Krg1+A98Mz8 JzLpAHGlvCzXJJ1ajRWdn0Awa3zYfb2o6WEULofj2tv8DOGRwLVlye6s7L0wN6jxPbQv 9qE7J2Nqw8oEleABwUwLt+ojEKv7K8ftasxso69aZkhSQz5MP7cGf+mCRxfS2CDJmUoF c+nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=4/6nFCiL5xKfb2K4gEk9gQezjeVrfURhUILOFWdGPLo=; b=w01T9o72u09o3HMIrO2+DrR/6O1JbkdWeVgTerZmuaiLRQjZm7HMp+XxT294tGFmfL z1uKPOoX+4bz31WpYJJOFewxV86w5PqQX+q0kfS4Cad3dYtEF0Y5I0uMjMbtrTwpKV4b C0aKsMBgSAL9tPU0o09XOBLcLG0dN4EL+eTQDw4QBNY4NZ8iCNyK1uDcuJSHaLo35WpK j1RC1CQ8SEPRrY3YeV8j08WqnHFAxpu3BTKct1+wnvOx3qb1aMsy6/4rZHTkCfNVCWq/ ldZxFEp0IQ8zcbehvDfZegYcnSyvltETt36a0oeI1qd8rxcPibo7EwtgsJV3AdS/Qvnt GVNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oSW4nMsX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ji4-20020a170907980400b00730e4be74b6si2903168ejc.26.2022.08.05.05.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 05:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oSW4nMsX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E91A3857355 for ; Fri, 5 Aug 2022 12:32:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E91A3857355 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659702761; bh=4/6nFCiL5xKfb2K4gEk9gQezjeVrfURhUILOFWdGPLo=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=oSW4nMsXJU5TGWuUop4WKQhoHYa1Hf3db5G5PbR6YcdmQoXFRc94m+JnG38lecV1y 5TJx6ANwURVquhIrwCMz2DwS6AdcfbRK3rME4PX4jgJ4ajjkLoOCt4/CQjhDjVD9zI LioSwluou2XmEUk7OFJOnTsm6rdKtCKm5JuUC1N8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 411E13858C53 for ; Fri, 5 Aug 2022 12:31:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 411E13858C53 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A3F5B1FCA3 for ; Fri, 5 Aug 2022 12:31:56 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8F62313A9C for ; Fri, 5 Aug 2022 12:31:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +zW6IbwN7WJQGwAAMHmgww (envelope-from ) for ; Fri, 05 Aug 2022 12:31:56 +0000 Date: Fri, 5 Aug 2022 14:31:56 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] backthreader dump fix MIME-Version: 1.0 Message-Id: <20220805123156.8F62313A9C@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1740324488319216968?= X-GMAIL-MSGID: =?utf-8?q?1740324488319216968?= This fixes odd SUCCEEDED dumps from the backthreader registry that can happen even though register_jump_thread cancelled the thread as invalid. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-threadbackward.cc (back_threader::maybe_register_path): Check whether the registry register_path rejected the path. (back_threader_registry::register_path): Return whether register_jump_thread succeeded. --- gcc/tree-ssa-threadbackward.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc index 3acd66a7780..332a1d2a1dd 100644 --- a/gcc/tree-ssa-threadbackward.cc +++ b/gcc/tree-ssa-threadbackward.cc @@ -243,10 +243,9 @@ back_threader::maybe_register_path () bool irreducible = false; if (m_profit.profitable_path_p (m_path, m_name, taken_edge, &irreducible) - && debug_counter ()) + && debug_counter () + && m_registry.register_path (m_path, taken_edge)) { - m_registry.register_path (m_path, taken_edge); - if (irreducible) vect_free_loop_info_assumptions (m_path[0]->loop_father); } @@ -858,8 +857,7 @@ back_threader_registry::register_path (const vec &m_path, } push_edge (jump_thread_path, taken_edge, EDGE_NO_COPY_SRC_BLOCK); - register_jump_thread (jump_thread_path); - return true; + return register_jump_thread (jump_thread_path); } // Thread all suitable paths in the current function.