fix position of source-line labels when generating debug info.

git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9619 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2004-10-28 18:35:59 +00:00
parent cd8c180f96
commit cb1ff25317

View File

@ -1585,10 +1585,26 @@ final_start_function (first, file, optimize)
FILE *file;
int optimize;
{
rtx insn;
block_depth = 0;
this_is_asm_operands = 0;
/* [zooey]: gcc-2.95.3 generates incorrect source-line labels when generating
debug-info because this function is called with first pointing to an note-insn
that has been deleted (whose NOTE_LINE_NUMBER == NOTE_INSN_DELETED).
In order to generate correct source-line labels, we skip to the first insn
which has a line-number (if any).
The result of this is a much improved debugging experience...
*/
if (NOTE_LINE_NUMBER (first) == NOTE_INSN_DELETED)
for (insn = first; insn; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
{
first = insn;
break;
}
#ifdef NON_SAVING_SETJMP
/* A function that calls setjmp should save and restore all the
call-saved registers on a system where longjmp clobbers them. */