From patchwork Fri Aug 7 02:17:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 1342090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org 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 4BN8CH0ybhz9s1x for ; Fri, 7 Aug 2020 12:17:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 437543857005; Fri, 7 Aug 2020 02:17:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from gcc1-power7.osuosl.org (gcc1-power7.osuosl.org [140.211.15.137]) by sourceware.org (Postfix) with ESMTP id CC7C93858D35 for ; Fri, 7 Aug 2020 02:17:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CC7C93858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=segher@gcc1-power7.osuosl.org Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 9E1201240178; Fri, 7 Aug 2020 02:17:35 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Subject: [PATCH] bb-reorder: Remove a misfiring micro-optimization (PR96475) Date: Fri, 7 Aug 2020 02:17:31 +0000 Message-Id: X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Cc: Segher Boessenkool Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" When the compgotos pass copies the tail of blocks ending in an indirect jump, there is a micro-optimization to not copy the last one, since the original block will then just be deleted. This does not work properly if cleanup_cfg does not merge all pairs of blocks we expect it to. 2020-08-07 Segher Boessenkool PR rtl-optimization/96475 * bb-reorder.c (maybe_duplicate_computed_goto): Remove single_pred_p micro-optimization. --- gcc/bb-reorder.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index c635010..f7a7de8 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -2680,9 +2680,6 @@ make_pass_reorder_blocks (gcc::context *ctxt) static bool maybe_duplicate_computed_goto (basic_block bb, int max_size) { - if (single_pred_p (bb)) - return false; - /* Make sure that the block is small enough. */ rtx_insn *insn; FOR_BB_INSNS (bb, insn)