This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [c++] parameter passing bug
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Subject: Re: [c++] parameter passing bug
- From: Jason Merrill <jason at redhat dot com>
- Date: 14 Dec 2000 19:12:06 +0000
- Cc: gcc-bugs at gcc dot gnu dot org, mark at codesourcery dot com, gcc-patches at gcc dot gnu dot org, binutils at sources dot redhat dot com
- References: <200012140106.eBE16Eh25438@fillmore.constant.com>
This is just a debugging issue; the debugger is stopping before the end of
the prologue, because everything is on the same line. If you give the
opening brace of is() its own line (or just stepi), you will see the right
value for __c.
In the past, we've emitted a second line note after the prologue, even if
it's for the same line number, so that gdb can tell where the real
beginning of the function is; I don't know why we stopped.
Fixed this requires changes to both gcc and gas. gas folks, is this OK?
Would you rather I remove the optimization code, rather than simply turning
it off?
2000-12-14 Jason Merrill <jason@redhat.com>
* jump.c (jump_optimize_1): Don't delete the line note after the
prologue even if it seems redundant.
*** jump.c.~1~ Wed Nov 29 14:01:06 2000
--- jump.c Thu Dec 14 16:53:53 2000
*************** jump_optimize_1 (f, cross_jump, noop_mov
*** 723,740 ****
rtx last_note = 0;
for (insn = f; insn; insn = NEXT_INSN (insn))
! if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) >= 0)
{
! /* Delete this note if it is identical to previous note. */
! if (last_note
! && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
! && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note))
{
! delete_insn (insn);
! continue;
! }
! last_note = insn;
}
}
--- 723,747 ----
rtx last_note = 0;
for (insn = f; insn; insn = NEXT_INSN (insn))
! if (GET_CODE (insn) == NOTE)
{
! if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
! /* Any previous line note was for the prologue; gdb wants a new
! note after the prologue even if it is for the same line. */
! last_note = NULL_RTX;
! else if (NOTE_LINE_NUMBER (insn) >= 0)
{
! /* Delete this note if it is identical to previous note. */
! if (last_note
! && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
! && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note))
! {
! delete_insn (insn);
! continue;
! }
! last_note = insn;
! }
}
}
2000-12-14 Jason Merrill <jason@redhat.com>
* dwarf2dbg.c (process_entries): Don't optimize redundant line notes.
*** gas/dwarf2dbg.c.~1~ Tue Dec 5 13:56:01 2000
--- gas/dwarf2dbg.c Thu Dec 14 18:58:25 2000
*************** process_entries (seg, e)
*** 861,867 ****
changed = 1;
}
! if (line != e->loc.line || changed)
{
int line_delta = e->loc.line - line;
if (frag == NULL)
--- 861,871 ----
changed = 1;
}
! /* Don't try to optimize away redundant entries; gdb wants two
! entries for a function where the code starts on the same line as
! the {, and there's no way to identify that case here. Trust gcc
! to optimize appropriately. */
! if (1 /* line != e->loc.line || changed */)
{
int line_delta = e->loc.line - line;
if (frag == NULL)