public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9388] bb-reorder: Fix assertion
Date: Fri,  8 Mar 2024 11:54:35 +0000 (GMT)	[thread overview]
Message-ID: <20240308115435.D76103858D38@sourceware.org> (raw)

https://gcc.gnu.org/g:d6bcc2e257026b383ac3e6ccdee13f7763b38621

commit r14-9388-gd6bcc2e257026b383ac3e6ccdee13f7763b38621
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 8 12:49:43 2024 +0100

    bb-reorder: Fix assertion
    
    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.
    
    2024-03-08  Jakub Jelinek  <jakub@redhat.com>
    
            * bb-reorder.cc (fix_up_fall_thru_edges): Fix up checking assert,
            asm_noperands < 0 means it is not asm goto too.

Diff:
---
 gcc/bb-reorder.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/bb-reorder.cc b/gcc/bb-reorder.cc
index 7998c0a148e..ba11a2337ab 100644
--- a/gcc/bb-reorder.cc
+++ b/gcc/bb-reorder.cc
@@ -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;

                 reply	other threads:[~2024-03-08 11:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240308115435.D76103858D38@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).