From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id B3D1B385EC54 for ; Wed, 5 May 2021 12:33:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B3D1B385EC54 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-244-K17u07o-PpeTpeX9Jph2mg-1; Wed, 05 May 2021 08:33:45 -0400 X-MC-Unique: K17u07o-PpeTpeX9Jph2mg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27D6E64161; Wed, 5 May 2021 12:33:44 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-114-59.ams2.redhat.com [10.36.114.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B921E18965; Wed, 5 May 2021 12:33:43 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 145CXeJZ3255893 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 5 May 2021 14:33:41 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 145CXdHU3255892; Wed, 5 May 2021 14:33:39 +0200 Date: Wed, 5 May 2021 14:33:39 +0200 From: Jakub Jelinek To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org Subject: Re: [patch] Fix PR rtl-optimization/100411 Message-ID: <20210505123339.GP1179226@tucnak> Reply-To: Jakub Jelinek References: <3286823.QJadu78ljV@fomalhaut> <3418561.R56niFO833@fomalhaut> <20210505113759.GO1179226@tucnak> <43790042.fMDQidcC6G@fomalhaut> MIME-Version: 1.0 In-Reply-To: <43790042.fMDQidcC6G@fomalhaut> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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: , X-List-Received-Date: Wed, 05 May 2021 12:33:48 -0000 On Wed, May 05, 2021 at 02:19:27PM +0200, Eric Botcazou wrote: > > At least for NOTE_INSN_BASIC_BLOCK skipping more than one might > > be problematic, because that would mean we've skipped into a different basic > > block and it wouldn't surprise me if split_block in that case crashed or > > did something weird (if the first argument is not BLOCK_FOR_INSN of the > > second argument when it is non-NULL). > > For the other notes, I think they should normally appear just once and > > shouldn't be a problem therefore. > > OK, version essentially equivalent to the original one, but with a loop. LGTM. > diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c > index f05cb6136c7..17edc4f37ad 100644 > --- a/gcc/cfgcleanup.c > +++ b/gcc/cfgcleanup.c > @@ -2145,7 +2145,11 @@ try_crossjump_to_edge (int mode, edge e1, edge e2, > if (NOTE_INSN_BASIC_BLOCK_P (newpos1)) > newpos1 = NEXT_INSN (newpos1); > > - while (DEBUG_INSN_P (newpos1)) > + /* Skip also prologue and function markers. */ > + while (DEBUG_INSN_P (newpos1) > + || (NOTE_P (newpos1) > + && (NOTE_KIND (newpos1) == NOTE_INSN_PROLOGUE_END > + || NOTE_KIND (newpos1) == NOTE_INSN_FUNCTION_BEG))) > newpos1 = NEXT_INSN (newpos1); > > redirect_from = split_block (src1, PREV_INSN (newpos1))->src; Jakub