From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11457 invoked by alias); 9 Aug 2013 23:30:31 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11382 invoked by uid 55); 9 Aug 2013 23:30:28 -0000 From: "tejohnson at google dot com" 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:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tejohnson at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00567.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57451 --- Comment #8 from Teresa Johnson --- On Fri, Aug 9, 2013 at 4:23 PM, ccoutant at google dot com wrote: > 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? Woops, yes. > >> + 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. Ok. > >> + 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. Because the notes were being skipped by the iteration over instructions, which previously only walked active instructions (notes are not active instructions). So to see the switch section note I had to walk all instructions, and just skip non-active instructions after I am done checking for the note of interest. Thanks, Teresa > > -cary > > -- > You are receiving this mail because: > You are on the CC list for the bug. > You reported the bug.