public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Eric Botcazou <botcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch] Fix PR rtl-optimization/100411
Date: Wed, 5 May 2021 14:33:39 +0200	[thread overview]
Message-ID: <20210505123339.GP1179226@tucnak> (raw)
In-Reply-To: <43790042.fMDQidcC6G@fomalhaut>

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


      reply	other threads:[~2021-05-05 12:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 11:00 Eric Botcazou
2021-05-05 11:10 ` Jakub Jelinek
2021-05-05 11:21   ` Eric Botcazou
2021-05-05 11:37     ` Jakub Jelinek
2021-05-05 12:19       ` Eric Botcazou
2021-05-05 12:33         ` Jakub Jelinek [this message]

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=20210505123339.GP1179226@tucnak \
    --to=jakub@redhat.com \
    --cc=botcazou@adacore.com \
    --cc=gcc-patches@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).