From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 53FC03858002; Wed, 19 Apr 2023 13:41:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53FC03858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681911674; bh=tq7opA0x2mS8j0vv3WATkGWKvBNGlqpnAJOetlZMZlc=; h=From:To:Subject:Date:From; b=OmItCUvF7XxYG63YfYJReBM1urOWXNlFRSVh9ixWGfLl+uPnyg6Z76A35+PfUsDml XCa2MOIfk4LCJ6nTTWWzXxLY12SbG/dfXsCV9DZKwMxeC561qvOSpW8TWgIMbgfn5Z IWvMs3ZPUl6AX+XB82DGP6F15aqFMubMQBzeILsI= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-81] Remove odd code from gimple_can_merge_blocks_p X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 258aecd7021b15c23a067323c00f1450dca0a506 X-Git-Newrev: 1da16c1141ebf3948de69eaeb1148778bf0790a9 Message-Id: <20230419134114.53FC03858002@sourceware.org> Date: Wed, 19 Apr 2023 13:41:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1da16c1141ebf3948de69eaeb1148778bf0790a9 commit r14-81-g1da16c1141ebf3948de69eaeb1148778bf0790a9 Author: Richard Biener Date: Wed Mar 22 14:13:02 2023 +0100 Remove odd code from gimple_can_merge_blocks_p The following removes a special case to not merge a block with only a non-local label. We have a restriction of non-local labels to be the first statement (and label) in a block, but otherwise nothing, if the last stmt of A is a non-local label then it will be still the first statement of the combined A + B. In particular we'd happily merge when there's a stmt after that label. The check originates from the tree-ssa merge. Bootstrapped and tested on x86_64-unknown-linux-gnu with all languages. * tree-cfg.cc (gimple_can_merge_blocks_p): Remove condition rejecting the merge when A contains only a non-local label. Diff: --- gcc/tree-cfg.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index a9fcc7fd050..ae53e15158a 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -1960,12 +1960,6 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b) if (stmt && stmt_ends_bb_p (stmt)) return false; - /* Do not allow a block with only a non-local label to be merged. */ - if (stmt) - if (glabel *label_stmt = dyn_cast (stmt)) - if (DECL_NONLOCAL (gimple_label_label (label_stmt))) - return false; - /* Examine the labels at the beginning of B. */ for (gimple_stmt_iterator gsi = gsi_start_bb (b); !gsi_end_p (gsi); gsi_next (&gsi))