From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8388 invoked by alias); 15 Dec 2017 02:39:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7710 invoked by uid 89); 15 Dec 2017 02:39:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: linux-libre.fsfla.org Received: from linux-libre.fsfla.org (HELO linux-libre.fsfla.org) (208.118.235.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Dec 2017 02:39:34 +0000 Received: from freie.home (home.lxoliva.fsfla.org [172.31.160.164]) by linux-libre.fsfla.org (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id vBF2dKfv022386; Fri, 15 Dec 2017 02:39:21 GMT Received: from livre (livre.home [172.31.160.2]) by freie.home (8.15.2/8.15.2) with ESMTP id vBF2curZ020827; Fri, 15 Dec 2017 00:38:58 -0200 From: Alexandre Oliva To: Andreas Schwab Cc: David Edelsohn , Rainer Orth , Jeffrey Law , Richard Biener , Jason Merrill , GCC Patches Subject: Re: [SFN] Bootstrap broken References: Date: Fri, 15 Dec 2017 02:39:00 -0000 In-Reply-To: (Alexandre Oliva's message of "Thu, 14 Dec 2017 23:51:29 -0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00983.txt.bz2 On Dec 14, 2017, Alexandre Oliva wrote: > On Dec 14, 2017, Alexandre Oliva wrote: >> I'll arrange for markers to be moved past labels, even in gimple > Here's a patch that implements this, and reverts all the changes I could > find that had been introduced to support debug markers before labels and > between BBs. > I have *not* fully tested it yet I reverted too much :-( see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396#c77 for details, or just apply this patchlet on top of the earlier one (it reinstates some of the SFN changes that turned out to be needed for more than accepting markers before labels) diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 4ec356d204d1..7fe0a1eec4c8 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -561,14 +561,22 @@ make_blocks_1 (gimple_seq seq, basic_block bb) { gimple_stmt_iterator i = gsi_start (seq); gimple *stmt = NULL; + gimple *prev_stmt = NULL; bool start_new_block = true; bool first_stmt_of_seq = true; while (!gsi_end_p (i)) { - gimple *prev_stmt; - - prev_stmt = stmt; + /* PREV_STMT should only be set to a debug stmt if the debug + stmt is before nondebug stmts. Once stmt reaches a nondebug + nonlabel, prev_stmt will be set to it, so that + stmt_starts_bb_p will know to start a new block if a label is + found. However, if stmt was a label after debug stmts only, + keep the label in prev_stmt even if we find further debug + stmts, for there may be other labels after them, and they + should land in the same block. */ + if (!prev_stmt || !stmt || !is_gimple_debug (stmt)) + prev_stmt = stmt; stmt = gsi_stmt (i); if (stmt && is_gimple_call (stmt)) @@ -583,6 +591,7 @@ make_blocks_1 (gimple_seq seq, basic_block bb) gsi_split_seq_before (&i, &seq); bb = create_basic_block (seq, bb); start_new_block = false; + prev_stmt = NULL; } /* Now add STMT to BB and create the subgraphs for special statement @@ -2703,6 +2712,13 @@ stmt_starts_bb_p (gimple *stmt, gimple *prev_stmt) if (stmt == NULL) return false; + /* PREV_STMT is only set to a debug stmt if the debug stmt is before + any nondebug stmts in the block. We don't want to start another + block in this case: the debug stmt will already have started the + one STMT would start if we weren't outputting debug stmts. */ + if (prev_stmt && is_gimple_debug (prev_stmt)) + return false; + /* Labels start a new basic block only if the preceding statement wasn't a label of the same type. This prevents the creation of consecutive blocks that have nothing but a single label. */ -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer