OSDN Git Service

2010-11-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Nov 2010 06:31:02 +0000 (06:31 +0000)
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Nov 2010 06:31:02 +0000 (06:31 +0000)
PR debug/45939
* var-tracking.c (emit_note_insn_var_location): Make sure that
call related var location notes come before the normal ones.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166396 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/var-tracking.c

index f69622d..65f917a 100644 (file)
@@ -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
index 0dc8b15..b9c6908 100644 (file)
@@ -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: