aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-04-01 13:23:00 -0700
committerRichard Henderson <rth@gcc.gnu.org>2011-04-01 13:23:00 -0700
commit756d6ee965cd678839c99b8ada229d20ec4ca20c (patch)
tree35958641e35ad5795a7ee6a34c2c80671ea37f14 /gcc
parentceaaaeabf66c30a14b70f2d3a86faeb9b9f68a80 (diff)
downloadgcc-756d6ee965cd678839c99b8ada229d20ec4ca20c.zip
gcc-756d6ee965cd678839c99b8ada229d20ec4ca20c.tar.gz
gcc-756d6ee965cd678839c99b8ada229d20ec4ca20c.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c29
2 files changed, 31 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1f03c10..d5733e0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-01 Richard Henderson <rth@redhat.com>
+
+ 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 <froydnj@codesourcery.com>
* config/h8300/constraints.md: New file.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 50d9429..b299bc7 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. */