From patchwork Mon Sep 14 22:05:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 1363974 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 4Br0mt0Vwmz9sTM for ; Tue, 15 Sep 2020 08:06:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB007385782A; Mon, 14 Sep 2020 22:06:02 +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 09CD33857811 for ; Mon, 14 Sep 2020 22:06:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 09CD33857811 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 346F6124017B; Mon, 14 Sep 2020 22:05:59 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Subject: [PATCH] bb-reorder: Fix for ICEs caused by 69ca5f3a9882 Date: Mon, 14 Sep 2020 22:05:56 +0000 Message-Id: X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, 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" After the previous patch we are left with an unreachable BB. This will ICE if either we have -fschedule-fusion, or we do not have peephole2. This fixes it. Okay for trunk? Segher 2020-09-14 Segher Boessenkool PR rtl-optimization/96475 * bb-reorder.c (duplicate_computed_gotos): If we did anything, run cleanup_cfg. --- gcc/bb-reorder.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 76e56b5..2ad5197 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -2760,6 +2760,10 @@ duplicate_computed_gotos (function *fun) if (computed_jump_p (BB_END (bb)) && can_duplicate_block_p (bb)) changed |= maybe_duplicate_computed_goto (bb, max_size); + /* Some blocks may have become unreachable. */ + if (changed) + cleanup_cfg (0); + /* Duplicating blocks will redirect edges and may cause hot blocks previously reached by both hot and cold blocks to become dominated only by cold blocks. */