diff options
author | Jason Merrill <jason@redhat.com> | 2012-05-12 23:37:38 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-05-12 23:37:38 -0400 |
commit | bf4c7d4a02e79fd43131865dbc104286130273ea (patch) | |
tree | ba75bafce5e1edf6239cec3f9f0c5c92787698e2 | |
parent | e08946f4acff8507d5bd1b8d27419238621500e9 (diff) | |
download | gcc-bf4c7d4a02e79fd43131865dbc104286130273ea.zip gcc-bf4c7d4a02e79fd43131865dbc104286130273ea.tar.gz gcc-bf4c7d4a02e79fd43131865dbc104286130273ea.tar.bz2 |
re PR debug/53235 (20120504 broke -fdebug-types-section)
PR debug/53235
* dwarf2out.c (build_local_stub): Prefer DW_AT_signature for
comdat types.
From-SVN: r187435
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 39 |
2 files changed, 23 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 355ae3a..305bd5c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-05-12 Jason Merrill <jason@redhat.com> + + PR debug/53235 + * dwarf2out.c (build_local_stub): Prefer DW_AT_signature for + comdat types. + 2012-05-12 Eric Botcazou <ebotcazou@adacore.com> * function.c (requires_stack_frame_p): If the function can throw diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1e5e335..9ba65fb 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -6929,36 +6929,31 @@ static int build_local_stub (void **slot, void *data) { struct external_ref *ref_p = (struct external_ref *)*slot; - dw_die_ref cu = (dw_die_ref) data; - dw_die_ref type = ref_p->type; - dw_die_ref stub = NULL; - if (ref_p->stub == NULL && ref_p->n_refs > 1) + if (ref_p->stub == NULL && ref_p->n_refs > 1 && !dwarf_strict) { - if (!dwarf_strict) - { - /* If we aren't being strict, use a typedef with no name - to just forward to the real type. In strict DWARF, a - typedef must have a name. */ - stub = new_die (DW_TAG_typedef, cu, NULL_TREE); - add_AT_die_ref (stub, DW_AT_type, type); - } - else if (type->comdat_type_p) + /* We have multiple references to this type, so build a small stub. + Both of these forms are a bit dodgy from the perspective of the + DWARF standard, since technically they should have names. */ + dw_die_ref cu = (dw_die_ref) data; + dw_die_ref type = ref_p->type; + dw_die_ref stub = NULL; + + if (type->comdat_type_p) { - /* If we refer to this type via sig8, we can use a simple - declaration; this is larger than the typedef, but strictly - correct. */ + /* If we refer to this type via sig8, use AT_signature. */ stub = new_die (type->die_tag, cu, NULL_TREE); - add_AT_string (stub, DW_AT_name, get_AT_string (type, DW_AT_name)); - add_AT_flag (stub, DW_AT_declaration, 1); add_AT_die_ref (stub, DW_AT_signature, type); } - - if (stub) + else { - stub->die_mark++; - ref_p->stub = stub; + /* Otherwise, use a typedef with no name. */ + stub = new_die (DW_TAG_typedef, cu, NULL_TREE); + add_AT_die_ref (stub, DW_AT_type, type); } + + stub->die_mark++; + ref_p->stub = stub; } return 1; } |