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.129.124]) by sourceware.org (Postfix) with ESMTPS id ABD833858D35 for ; Fri, 8 Mar 2024 08:34:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABD833858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ABD833858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709886850; cv=none; b=mdc35LyBpr0D3KiRB2dg4nD0o4+J4wHS6cP7fXKCSDFZscxLuUGCffXzR+Snoq+lDi3+BX9B24U/dNxYg8kZGjAmBEMSGFWYCMlB9q8exlSgzxal2Ub0QblucmuBNcjKCVnPbWIKeVtZegLNQKpt2fn27pOx338+29tRvaYtfpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709886850; c=relaxed/simple; bh=vnCLyjzSU++sfUWqqHEaOwhh6UtTX9NE7RkPvPUtUkk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=dCPbsM2cOzPhxIiWCMG8QZjs4aFc2y654b+k2RhHx0JyRwgHkvlxrbD5ubOjjn0SwC7CMaFzL2TO/u2vb4neYIr9Xlwae4yG6Nlcw7tkvB1sCWBzM+QHEB0nI3BXdZfsn5UPPiPY5vkm4OQ4AraysaPv/vydfiTuZfFQlJH7UAE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709886847; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=vSTbElQZiWlO14AAVz2JPjwqS8mjqw/acMywFDWfYGo=; b=UsYM9pxWNaPJkMRtW6Z+UPyJdSPPvCyyadFgNXm8z1e8Er6wRL3wJDFYq3jrmvyhTgGJ/t r3e82CHwQq+xEwMLMLw1oEtTg5acUE1abEm5alMXGrrgmFAJbOQxLWXYAp4+cJHsRgHSaE vOIyWrL1O4328jlWCRUaVoampchOy2o= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-9KZdfxlFNiy3UOAjHIdcRA-1; Fri, 08 Mar 2024 03:34:04 -0500 X-MC-Unique: 9KZdfxlFNiy3UOAjHIdcRA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A56EB3803911; Fri, 8 Mar 2024 08:34:03 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.226.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B51B1C060D6; Fri, 8 Mar 2024 08:34:03 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 4288Y1TJ2678867 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 8 Mar 2024 09:34:01 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 4288Y1Qp2678866; Fri, 8 Mar 2024 09:34:01 +0100 Date: Fri, 8 Mar 2024 09:34:01 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] bb-reorder: Fix assertion Message-ID: Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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=-3.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! When touching bb-reorder yesterday, I've noticed the checking assert doesn't actually check what it meant to. Because asm_noperands returns >= 0 for inline asm patterns (in that case number of input+output+label operands, so asm goto has at least one) and -1 if it isn't inline asm. The following patch fixes the assertion to actually check that it is asm goto. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2024-03-08 Jakub Jelinek * bb-reorder.cc (fix_up_fall_thru_edges): Fix up checking assert, asm_noperands < 0 means it is not asm goto too. --- gcc/bb-reorder.cc.jj 2024-03-07 10:06:56.086285875 +0100 +++ gcc/bb-reorder.cc 2024-03-07 10:11:44.745261926 +0100 @@ -2024,7 +2024,8 @@ fix_up_fall_thru_edges (void) See PR108596. */ rtx_insn *j = BB_END (cur_bb); gcc_checking_assert (JUMP_P (j) - && asm_noperands (PATTERN (j))); + && (asm_noperands (PATTERN (j)) + > 0)); edge e2 = find_edge (cur_bb, e->dest); if (e2) e2->flags |= EDGE_CROSSING; Jakub