diff options
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/final.c b/gcc/final.c index ddd339b..ed1327d 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -141,6 +141,9 @@ static int high_function_linenum; /* Filename of last NOTE. */ static const char *last_filename; +/* Whether to force emission of a line note before the next insn. */ +static bool force_source_line = false; + extern int length_unit_log; /* This is defined in insn-attrtab.c. */ /* Nonzero while outputting an `asm' with operands. @@ -1739,7 +1742,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, if ((*seen & (SEEN_EMITTED | SEEN_BB)) == SEEN_BB) { *seen |= SEEN_EMITTED; - last_filename = NULL; + force_source_line = true; } else *seen |= SEEN_BB; @@ -1763,7 +1766,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE) { *seen |= SEEN_EMITTED; - last_filename = NULL; + force_source_line = true; } else *seen |= SEEN_NOTE; @@ -1781,7 +1784,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE) { *seen |= SEEN_EMITTED; - last_filename = NULL; + force_source_line = true; } else *seen |= SEEN_NOTE; @@ -2501,8 +2504,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, return NEXT_INSN (insn); } -/* Output debugging info to the assembler file FILE - based on the NOTE-insn INSN, assumed to be a line number. */ +/* Return whether a source line note needs to be emitted before INSN. */ static bool notice_source_line (rtx insn) @@ -2510,8 +2512,12 @@ notice_source_line (rtx insn) const char *filename = insn_file (insn); int linenum = insn_line (insn); - if (filename && (filename != last_filename || last_linenum != linenum)) + if (filename + && (force_source_line + || filename != last_filename + || last_linenum != linenum)) { + force_source_line = false; last_filename = filename; last_linenum = linenum; high_block_linenum = MAX (last_linenum, high_block_linenum); |