On 06/06/2015 05:47 PM, Aldy Hernandez wrote:
On 06/06/2015 03:33 PM, Jan Hubicka wrote:
Aldy,
also at PPC64le LTO bootstrap (at gcc112) dies with:
^
0x104ae8f7 check_die
../../gcc/dwarf2out.c:5715
Hmmm... this is in the LTO/ltrans stage? If so, that's weird. The LTO
path does not do the early DIE dance. Since check_die() is a new sanity
check for DIEs, I wonder if this is a latent bug that was already there.
It looks like ppc64le fails to bootstrap with the same comparison
failure aarch64 fails with, so I need to take a look at ppc64le regardless.
However, for your particular problem, I wonder if this was a preexisting
condition. Would you mind reproducing your problem without my
debug-early patchset, but with the attached patch?
The commit prior to debug-early is:
git commit d51560f9afc5c8a826bcfa6fc90a96156b623559
trunk@224160
The attached patch adds the sanity check, but without the debug-early
work. If you still get a failure, this is a pre-existing bug.
Thanks.
Aldy
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 55364a2..c35399a 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -21271,6 +21271,34 @@ gen_namelist_decl (tree name, dw_die_ref scope_die,
tree item_decls)
}
+/* Sanity checks on DIEs. */
+
+static void
+check_die (dw_die_ref die)
+{
+ /* A debugging information entry that is a member of an abstract
+ instance tree [that has DW_AT_inline] should not contain any
+ attributes which describe aspects of the subroutine which vary
+ between distinct inlined expansions or distinct out-of-line
+ expansions. */
+ unsigned ix;
+ dw_attr_ref a;
+ bool inline_found = false;
+ FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)
+ if (a->dw_attr == DW_AT_inline && a->dw_attr_val.v.val_unsigned)
+ inline_found = true;
+ if (inline_found)
+ {
+ /* Catch the most common mistakes. */
+ FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)
+ gcc_assert (a->dw_attr != DW_AT_low_pc
+ && a->dw_attr != DW_AT_high_pc
+ && a->dw_attr != DW_AT_location
+ && a->dw_attr != DW_AT_frame_base
+ && a->dw_attr != DW_AT_GNU_all_call_sites);
+ }
+}
+
/* Write the debugging output for DECL. */
static void
@@ -21398,6 +21426,9 @@ dwarf2out_decl (tree decl)
return;
}
+ dw_die_ref die = lookup_decl_die (decl);
+ if (die)
+ check_die (die);
gen_decl_die (decl, NULL, context_die);
}