aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/dwarf2out.c62
2 files changed, 61 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 03c5fa5..3c15156 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
2016-10-11 Richard Biener <rguenther@suse.de>
+ * dwarf2out.c (DEBUG_STR_OFFSETS_SECTION): Remove conditional.
+ (init_sections_and_labels): Use DEBUG_DWO_STR_OFFSETS_SECTION.
+ (verify_die): New function.
+ (dwarf2out_finish): Call it.
+ (output_line_info): Handle case of -gsplit-dwarf without
+ DWARF2_ASM_LINE_DEBUG_INFO.
+
+2016-10-11 Richard Biener <rguenther@suse.de>
+
PR debug/77931
* gimple-low.c (lower_gimple_bind): Handle arbitrary common
sub-chains of BLOCK_VARS and gimple_bind_vars.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 4a3df33..3f7833f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -3538,12 +3538,11 @@ new_addr_loc_descr (rtx addr, enum dtprel_bool dtprel)
((debug_generate_pub_sections == 2) \
? ".debug_gnu_pubtypes" : ".debug_pubtypes")
#endif
-#define DEBUG_NORM_STR_OFFSETS_SECTION ".debug_str_offsets"
-#define DEBUG_DWO_STR_OFFSETS_SECTION ".debug_str_offsets.dwo"
#ifndef DEBUG_STR_OFFSETS_SECTION
-#define DEBUG_STR_OFFSETS_SECTION \
- (!dwarf_split_debug_info \
- ? (DEBUG_NORM_STR_OFFSETS_SECTION) : (DEBUG_DWO_STR_OFFSETS_SECTION))
+#define DEBUG_STR_OFFSETS_SECTION ".debug_str_offsets"
+#endif
+#ifndef DEBUG_DWO_STR_OFFSETS_SECTION
+#define DEBUG_DWO_STR_OFFSETS_SECTION ".debug_str_offsets.dwo"
#endif
#ifndef DEBUG_STR_DWO_SECTION
#define DEBUG_STR_DWO_SECTION ".debug_str.dwo"
@@ -5835,6 +5834,41 @@ debug_dwarf (void)
print_die (comp_unit_die (), stderr);
}
+/* Verify the DIE tree structure. */
+
+DEBUG_FUNCTION void
+verify_die (dw_die_ref die)
+{
+ gcc_assert (!die->die_mark);
+ if (die->die_parent == NULL
+ && die->die_sib == NULL)
+ return;
+ /* Verify the die_sib list is cyclic. */
+ dw_die_ref x = die;
+ do
+ {
+ x->die_mark = 1;
+ x = x->die_sib;
+ }
+ while (x && !x->die_mark);
+ gcc_assert (x == die);
+ x = die;
+ do
+ {
+ /* Verify all dies have the same parent. */
+ gcc_assert (x->die_parent == die->die_parent);
+ if (x->die_child)
+ {
+ /* Verify the child has the proper parent and recurse. */
+ gcc_assert (x->die_child->die_parent == x);
+ verify_die (x->die_child);
+ }
+ x->die_mark = 0;
+ x = x->die_sib;
+ }
+ while (x && x->die_mark);
+}
+
/* Sanity checks on DIEs. */
static void
@@ -10710,6 +10744,7 @@ output_one_line_info_table (dw_line_info_table *table)
static void
output_line_info (bool prologue_only)
{
+ static unsigned int generation;
char l1[MAX_ARTIFICIAL_LABEL_BYTES], l2[MAX_ARTIFICIAL_LABEL_BYTES];
char p1[MAX_ARTIFICIAL_LABEL_BYTES], p2[MAX_ARTIFICIAL_LABEL_BYTES];
/* We don't support DWARFv5 line tables yet. */
@@ -10717,10 +10752,10 @@ output_line_info (bool prologue_only)
bool saw_one = false;
int opc;
- ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL, 0);
- ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL, 0);
- ASM_GENERATE_INTERNAL_LABEL (p1, LN_PROLOG_AS_LABEL, 0);
- ASM_GENERATE_INTERNAL_LABEL (p2, LN_PROLOG_END_LABEL, 0);
+ ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL, generation);
+ ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL, generation);
+ ASM_GENERATE_INTERNAL_LABEL (p1, LN_PROLOG_AS_LABEL, generation);
+ ASM_GENERATE_INTERNAL_LABEL (p2, LN_PROLOG_END_LABEL, generation++);
if (!XCOFF_DEBUGGING_INFO)
{
@@ -25590,7 +25625,7 @@ init_sections_and_labels (void)
SECTION_DEBUG | SECTION_EXCLUDE, NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_line_section_label,
DEBUG_SKELETON_LINE_SECTION_LABEL, 0);
- debug_str_offsets_section = get_section (DEBUG_STR_OFFSETS_SECTION,
+ debug_str_offsets_section = get_section (DEBUG_DWO_STR_OFFSETS_SECTION,
SECTION_DEBUG | SECTION_EXCLUDE,
NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_info_section_label,
@@ -27844,6 +27879,13 @@ dwarf2out_finish (const char *)
/* Flush out any latecomers to the limbo party. */
flush_limbo_die_list ();
+ if (flag_checking)
+ {
+ verify_die (comp_unit_die ());
+ for (limbo_die_node *node = cu_die_list; node; node = node->next)
+ verify_die (node->die);
+ }
+
/* We shouldn't have any symbols with delayed asm names for
DIEs generated after early finish. */
gcc_assert (deferred_asm_name == NULL);