From 756d6ee965cd678839c99b8ada229d20ec4ca20c Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 1 Apr 2011 13:23:00 -0700 Subject: [PATCH] re PR bootstrap/48400 (powerpc-apple-darwin9 fails to bootstrap at revision 171824) PR 48400 * dwarf2out.c (dwarf2out_source_line): Disable discriminators in strict mode before dwarf4. Re-order tests to early out before switching sections. From-SVN: r171852 --- gcc/ChangeLog | 7 +++++++ gcc/dwarf2out.c | 29 ++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f03c10f101..d5733e0e915 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-04-01 Richard Henderson + + PR 48400 + * dwarf2out.c (dwarf2out_source_line): Disable discriminators + in strict mode before dwarf4. Re-order tests to early out + before switching sections. + 2011-04-01 Nathan Froyd * config/h8300/constraints.md: New file. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 50d942974dd..b299bc7926a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -22132,21 +22132,40 @@ dwarf2out_source_line (unsigned int line, const char *filename, if (debug_info_level < DINFO_LEVEL_NORMAL || line == 0) return; - switch_to_section (current_function_section ()); - - /* If requested, emit something human-readable. */ - if (flag_debug_asm) - fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START, filename, line); + /* The discriminator column was added in dwarf4. Simplify the below + by simply removing it if we're not supposed to output it. */ + if (dwarf_version < 4 && dwarf_strict) + discriminator = 0; table = cur_line_info_table; file_num = maybe_emit_file (lookup_filename (filename)); + /* ??? TODO: Elide duplicate line number entries. Traditionally, + the debugger has used the second (possibly duplicate) line number + at the beginning of the function to mark the end of the prologue. + We could eliminate any other duplicates within the function. For + Dwarf3, we ought to include the DW_LNS_set_prologue_end mark in + that second line number entry. */ + /* Recall that this end-of-prologue indication is *not* the same thing + as the end_prologue debug hook. The NOTE_INSN_PROLOGUE_END note, + to which the hook corresponds, follows the last insn that was + emitted by gen_prologue. What we need is to preceed the first insn + that had been emitted after NOTE_INSN_FUNCTION_BEG, i.e. the first + insn that corresponds to something the user wrote. These may be + very different locations once scheduling is enabled. */ + if (0 && file_num == table->file_num && line == table->line_num && discriminator == table->discrim_num && is_stmt == table->is_stmt) return; + switch_to_section (current_function_section ()); + + /* If requested, emit something human-readable. */ + if (flag_debug_asm) + fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START, filename, line); + if (DWARF2_ASM_LINE_DEBUG_INFO) { /* Emit the .loc directive understood by GNU as. */ -- 2.30.2