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-3211] [PR rtl-optimization/107182] Clear EDGE_CROSSING for jump->ret optimization
Date: Tue, 11 Oct 2022 04:45:51 +0000 (GMT)	[thread overview]
Message-ID: <20221011044551.708663858C2D@sourceware.org> (raw)

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

commit r13-3211-gdb24bdc743cf23ea12d2dcf8254d86ab366bb46d
Author: Jeff Law <jeffreyalaw@gmail.com>
Date:   Tue Oct 11 00:44:26 2022 -0400

    [PR rtl-optimization/107182] Clear EDGE_CROSSING for jump->ret optimization
    
    When turning a jump to a return into a return, we need to clear EDGE_CROSSING
    of the fallthru edge to prevent a checking failure.
    
    I considered not applying the transformation when the edge has EDGE_CROSSING
    set, but it still seems like we ought to eliminate the unnecessary jump in
    that case.
    
    gcc/
            PR rtl-optimization/107182
            * cfgrtl.cc (fixup_reorder_chain): When optimizing a jump to a
            return, clear EDGE_CROSSING on the appropriate edge.

Diff:
---
 gcc/cfgrtl.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc
index 281a432f6a6..f31941a61f9 100644
--- a/gcc/cfgrtl.cc
+++ b/gcc/cfgrtl.cc
@@ -4055,6 +4055,7 @@ fixup_reorder_chain (void)
 	  ret_label = PATTERN (ret);
 	  dest = EXIT_BLOCK_PTR_FOR_FN (cfun);
 
+	  e_fall->flags &= ~EDGE_CROSSING;
 	  /* E_FALL->dest might become unreachable as a result of
 	     replacing the jump with a return.  So arrange to remove
 	     unreachable blocks.  */

                 reply	other threads:[~2022-10-11  4:45 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=20221011044551.708663858C2D@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).