diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2016-08-18 14:39:22 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2016-08-18 14:39:22 +0000 |
commit | 80c5ad359f30c86d48a04c080785606a2701ab71 (patch) | |
tree | e55edc4fa8fd327e421894c2c5b542df4808abf6 | |
parent | 0b224dcf60dd8bd401501178f6118b8455ceeb1f (diff) | |
download | gcc-80c5ad359f30c86d48a04c080785606a2701ab71.zip gcc-80c5ad359f30c86d48a04c080785606a2701ab71.tar.gz gcc-80c5ad359f30c86d48a04c080785606a2701ab71.tar.bz2 |
DWARF: do not emit DW_TAG_variable to materialize DWARF procedures
Hello,
For -gdwarf-3 and newer, the DWARF back-end sometimes generates DWARF
procedures to factorize complex location descriptions. DWARF procedures
can be materialized as DW_TAG_dwarf_procedure DIEs, but actually any DIE
that can hold a DW_AT_location attribute is also accepted.
Unlike what I thought at some point, the DW_TAG_dwarf_procedure tag was
introduced in the DWARFv3 standard, not the DWARFv4 one, so the back-end
can always emit DW_TAG_dwarf_procedure DIEs, as this simplifies code and
prevents the types pruning pass from missing a DWARF procedure.
Boostrapped and regtested on x86_64-linux: no regression. Ok to commit?
Thank you in advance!
gcc/
* dwarf2out.c (copy_dwarf_procedure): Remove obsolete comment.
(new_dwarf_proc_die): Emit DW_TAG_dwarf_procedure DIEs even for
-gdwarf-3.
(function_to_dwarf_procedure): Update comment.
From-SVN: r239575
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 16 |
2 files changed, 9 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb87011..505e66e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-08-18 Pierre-Marie de Rodat <derodat@adacore.com> + + * dwarf2out.c (copy_dwarf_procedure): Remove obsolete comment. + (new_dwarf_proc_die): Emit DW_TAG_dwarf_procedure DIEs even for + -gdwarf-3. + (function_to_dwarf_procedure): Update comment. + 2016-08-18 David Malcolm <dmalcolm@redhat.com> * input.c (diagnostics_file_cache_forcibly_evict_file): New diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0fdab9a..98f08b7 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -7747,9 +7747,6 @@ copy_dwarf_procedure (dw_die_ref die, comdat_type_node *type_node, hash_map<dw_die_ref, dw_die_ref> &copied_dwarf_procs) { - /* We do this for COMDAT section, which is DWARFv4 specific, so - DWARF procedure are always DW_TAG_dwarf_procedure DIEs (unlike - DW_TAG_variable in DWARFv3). */ gcc_assert (die->die_tag == DW_TAG_dwarf_procedure); /* DWARF procedures are not supposed to have children... */ @@ -15332,22 +15329,15 @@ static dw_die_ref new_dwarf_proc_die (dw_loc_descr_ref location, tree fndecl, dw_die_ref parent_die) { - const bool dwarf_proc_supported = dwarf_version >= 4; dw_die_ref dwarf_proc_die; if ((dwarf_version < 3 && dwarf_strict) || location == NULL) return NULL; - dwarf_proc_die = new_die (dwarf_proc_supported - ? DW_TAG_dwarf_procedure - : DW_TAG_variable, - parent_die, - fndecl); + dwarf_proc_die = new_die (DW_TAG_dwarf_procedure, parent_die, fndecl); if (fndecl) equate_decl_number_to_die (fndecl, dwarf_proc_die); - if (!dwarf_proc_supported) - add_AT_flag (dwarf_proc_die, DW_AT_artificial, 1); add_AT_loc (dwarf_proc_die, DW_AT_location, location); return dwarf_proc_die; } @@ -15673,9 +15663,7 @@ function_to_dwarf_procedure (tree fndecl) if (dwarf_proc_die != NULL) return dwarf_proc_die; - /* DWARF procedures are available starting with the DWARFv3 standard, but - it's the DWARFv4 standard that introduces the DW_TAG_dwarf_procedure - DIE. */ + /* DWARF procedures are available starting with the DWARFv3 standard. */ if (dwarf_version < 3 && dwarf_strict) return NULL; |