public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ccoutant at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/57451] Incorrect debug ranges emitted for -freorder-blocks-and-partition -g
Date: Fri, 09 Aug 2013 23:23:00 -0000	[thread overview]
Message-ID: <bug-57451-4-2rOr65j1Su@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57451-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57451

--- Comment #7 from ccoutant at google dot com ---
> Index: final.c
> ===================================================================
> --- final.c (revision 201461)
> +++ final.c (working copy)
> @@ -1560,6 +1560,16 @@ change_scope (rtx orig_insn, tree s1, tree s2)
>    tree ts1 = s1, ts2 = s2;
>    tree s;
>
> +  if (NOTE_P (orig_insn) && NOTE_KIND (orig_insn) ==
> NOTE_INSN_SWITCH_TEXT_SECTIONS)
> +    {
> +      gcc_assert (s1 == s1);

That should be s1 == s2, right?

> +      rtx note = emit_note_before (NOTE_INSN_BLOCK_END, orig_insn);
> +      NOTE_BLOCK (note) = s1;
> +      note = emit_note_before (NOTE_INSN_BLOCK_BEG, next_insn (orig_insn));
> +      NOTE_BLOCK (note) = s1;
> +      return;
> +    }
> +
>    while (ts1 != ts2)
>      {
>        gcc_assert (ts1 && ts2);
> @@ -1604,12 +1614,16 @@ reemit_insn_block_notes (void)
>    rtx insn, note;
>
>    insn = get_insns ();
> -  if (!active_insn_p (insn))
> -    insn = next_active_insn (insn);
> -  for (; insn; insn = next_active_insn (insn))
> +  for (; insn; insn = next_insn (insn))
>      {
>        tree this_block;
>
> +      if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
> +        change_scope (insn, cur_block, cur_block);

It seems to me like you should just emit the three notes directly
here. This is really using change_scope for a new purpose, as you're
not really changing scopes, just putting a break into one.

> +      if (!active_insn_p (insn))
> +        continue;

I'm not clear on why this is needed. Is it because after the
change_scope, insn will now be a NOTE? If that's it, just put the
continue in the previous if clause.

-cary


  parent reply	other threads:[~2013-08-09 23:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 14:55 [Bug rtl-optimization/57451] New: " tejohnson at google dot com
2013-06-12 15:54 ` [Bug rtl-optimization/57451] " tejohnson at google dot com
2013-06-12 17:08 ` ccoutant at gcc dot gnu.org
2013-06-13  2:07 ` tejohnson at google dot com
2013-06-15 14:03 ` tejohnson at google dot com
2013-08-09 23:01 ` tejohnson at google dot com
2013-08-09 23:23 ` ccoutant at google dot com [this message]
2013-08-09 23:30 ` tejohnson at google dot com
2013-08-12 16:17 ` ccoutant at google dot com
2013-11-23  4:30 ` tejohnson at gcc dot gnu.org

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=bug-57451-4-2rOr65j1Su@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).