function.c (expand_function_end): Output NOTE_REPEATED_LINE_NUMBER for last line...
authorDoug Evans <dje@gnu.org>
Fri, 28 Mar 1997 22:36:31 +0000 (22:36 +0000)
committerDoug Evans <dje@gnu.org>
Fri, 28 Mar 1997 22:36:31 +0000 (22:36 +0000)
* function.c (expand_function_end): Output NOTE_REPEATED_LINE_NUMBER
for last line of function.

From-SVN: r13815

gcc/function.c

index b3c45b92cea6008e8abd693611ff1dd97c34fd59..67594cba8880ec1d00d7f4268d97920ffe356ceb 100644 (file)
@@ -5530,6 +5530,14 @@ expand_function_end (filename, line, end_bindings)
      without returning a value.  */
   emit_note (NULL_PTR, NOTE_INSN_FUNCTION_END);
 
+  /* Must mark the last line number note in the function, so that the test
+     coverage code can avoid counting the last line twice.  This just tells
+     the code to ignore the immediately following line note, since there
+     already exists a copy of this note somewhere above.  This line number
+     note is still needed for debugging though, so we can't delete it.  */
+  if (flag_test_coverage)
+    emit_note (NULL_PTR, NOTE_REPEATED_LINE_NUMBER);
+
   /* Output a linenumber for the end of the function.
      SDB depends on this.  */
   emit_line_note_force (filename, line);