diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2010-11-06 06:31:02 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2010-11-06 06:31:02 +0000 |
commit | 8784e5ac5fd857290fda9cd7bc382b4ec0d0790e (patch) | |
tree | ee5c8c887f5c4c9ebb83843b3252a00217e14232 | |
parent | 77bb7c610afbe8652b5a7084c907c64601287777 (diff) | |
download | gcc-8784e5ac5fd857290fda9cd7bc382b4ec0d0790e.tar.gz |
re PR debug/45939 (Wrong debug info: Negative location range generated)
2010-11-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR debug/45939
* var-tracking.c (emit_note_insn_var_location): Make sure that
call related var location notes come before the normal ones.
From-SVN: r166396
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/var-tracking.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f69622d1295..65f917abf12 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-11-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + PR debug/45939 + * var-tracking.c (emit_note_insn_var_location): Make sure that + call related var location notes come before the normal ones. + 2010-11-05 H.J. Lu <hongjiu.lu@intel.com> PR target/46326 diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 0dc8b15ea10..b9c6908e2b3 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -7339,7 +7339,17 @@ emit_note_insn_var_location (void **varp, void *data) NOTE_DURING_CALL_P (note) = true; } else - note = emit_note_before (NOTE_INSN_VAR_LOCATION, insn); + { + /* Make sure that the call related notes come first. */ + while (NEXT_INSN (insn) + && NOTE_P (insn) + && NOTE_DURING_CALL_P (insn)) + insn = NEXT_INSN (insn); + if (NOTE_P (insn) && NOTE_DURING_CALL_P (insn)) + note = emit_note_after (NOTE_INSN_VAR_LOCATION, insn); + else + note = emit_note_before (NOTE_INSN_VAR_LOCATION, insn); + } NOTE_VAR_LOCATION (note) = note_vl; clear: |