public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jeff Law <law@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-2888] Fix ICEs due to recent jump-to-return optimization
Date: Tue, 27 Sep 2022 06:20:07 +0000 (GMT)	[thread overview]
Message-ID: <20220927062007.1607C3858D39@sourceware.org> (raw)

https://gcc.gnu.org/g:5da546d7e0561def07c783e6ec897aaa9e7837c6

commit r13-2888-g5da546d7e0561def07c783e6ec897aaa9e7837c6
Author: Jeff Law <jeffreyalaw@gmail.com>
Date:   Tue Sep 27 01:44:38 2022 -0400

    Fix ICEs due to recent jump-to-return optimization
    
    gcc/
            * cfgrtl.cc (fixup_reorder_chain): Verify that simple_return
            and return are available before trying to use them.

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

diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc
index 90cd6ee56a7..281a432f6a6 100644
--- a/gcc/cfgrtl.cc
+++ b/gcc/cfgrtl.cc
@@ -4049,7 +4049,8 @@ fixup_reorder_chain (void)
       rtx_insn *ret, *use;
       basic_block dest;
       if (bb_is_just_return (e_fall->dest, &ret, &use)
-	  && (PATTERN (ret) == simple_return_rtx || PATTERN (ret) == ret_rtx))
+	  && ((PATTERN (ret) == simple_return_rtx && targetm.have_simple_return ())
+	      || (PATTERN (ret) == ret_rtx && targetm.have_return ())))
 	{
 	  ret_label = PATTERN (ret);
 	  dest = EXIT_BLOCK_PTR_FOR_FN (cfun);

                 reply	other threads:[~2022-09-27  6:20 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=20220927062007.1607C3858D39@sourceware.org \
    --to=law@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).