From cb1ff25317a95cd0d47792e2f32caf475641262b Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 28 Oct 2004 18:35:59 +0000 Subject: [PATCH] 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 --- gcc/gcc/final.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gcc/gcc/final.c b/gcc/gcc/final.c index 7a31cde..0859477 100644 --- a/gcc/gcc/final.c +++ b/gcc/gcc/final.c @@ -1585,9 +1585,25 @@ 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 -- gitore 0.2.3