diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-11-08 21:20:10 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-11-08 21:20:10 +0100 |
commit | 2a86dbb79b72e3662aea66873888df6923d06472 (patch) | |
tree | 65e813161367e5ae9abd22326cec96cad6d205da /gcc | |
parent | ecf07a67d0e8cc33b780783d9996a0e91a6239a2 (diff) | |
download | gcc-2a86dbb79b72e3662aea66873888df6923d06472.zip gcc-2a86dbb79b72e3662aea66873888df6923d06472.tar.gz gcc-2a86dbb79b72e3662aea66873888df6923d06472.tar.bz2 |
re PR debug/53145 (gcc.dg/pch/save-temps-1.c)
PR debug/53145
* dwarf2out.c (gen_compile_unit_die): Don't call gen_producer_string
here, instead add "" if producer_string is NULL.
(dwarf2out_finish): Call gen_producer_string here, unconditionally
decrease refcount of the old indirect string and set val_str to
find_AT_string result.
From-SVN: r193340
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 15 |
2 files changed, 13 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c06016c..76f53f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2012-11-08 Jakub Jelinek <jakub@redhat.com> + PR debug/53145 + * dwarf2out.c (gen_compile_unit_die): Don't call gen_producer_string + here, instead add "" if producer_string is NULL. + (dwarf2out_finish): Call gen_producer_string here, unconditionally + decrease refcount of the old indirect string and set val_str to + find_AT_string result. + PR debug/54499 * cgraphunit.c (assemble_thunk): Don't call source_line debug hook here, instead call insn_locations_{init,finalize} and initialize diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 7dd1f24..d55123b 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18867,9 +18867,7 @@ gen_compile_unit_die (const char *filename) add_comp_dir_attribute (die); } - if (producer_string == NULL) - producer_string = gen_producer_string (); - add_AT_string (die, DW_AT_producer, producer_string); + add_AT_string (die, DW_AT_producer, producer_string ? producer_string : ""); /* If our producer is LTO try to figure out a common language to use from the global list of translation units. */ @@ -23217,13 +23215,12 @@ dwarf2out_finish (const char *filename) dw_die_ref main_comp_unit_die; /* PCH might result in DW_AT_producer string being restored from the - header compilation, fix it up if needed. */ + header compilation, so always fill it with empty string initially + and overwrite only here. */ dw_attr_ref producer = get_AT (comp_unit_die (), DW_AT_producer); - if (strcmp (AT_string (producer), producer_string) != 0) - { - struct indirect_string_node *node = find_AT_string (producer_string); - producer->dw_attr_val.v.val_str = node; - } + producer_string = gen_producer_string (); + producer->dw_attr_val.v.val_str->refcount--; + producer->dw_attr_val.v.val_str = find_AT_string (producer_string); gen_scheduled_generic_parms_dies (); gen_remaining_tmpl_value_param_die_attribute (); |