Commit 4ece5af3 by Richard Biener Committed by Richard Biener

dwarf2out.c (gen_subprogram_die): Use is_unit_die when deciding whether to not re-use a DIE.

2018-06-28  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (gen_subprogram_die): Use is_unit_die when
	deciding whether to not re-use a DIE.

From-SVN: r262217
parent 8e236ddd
2018-06-28 Richard Biener <rguenther@suse.de> 2018-06-28 Richard Biener <rguenther@suse.de>
* dwarf2out.c (gen_subprogram_die): Use is_unit_die when
deciding whether to not re-use a DIE.
2018-06-28 Richard Biener <rguenther@suse.de>
* dwarf2out.c (gen_subprogram_die): Always re-use DIEs with an * dwarf2out.c (gen_subprogram_die): Always re-use DIEs with an
DW_AT_abstract_origin attribute. DW_AT_abstract_origin attribute.
......
...@@ -22780,7 +22780,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) ...@@ -22780,7 +22780,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
apply; we just use the old DIE. */ apply; we just use the old DIE. */
expanded_location s = expand_location (DECL_SOURCE_LOCATION (decl)); expanded_location s = expand_location (DECL_SOURCE_LOCATION (decl));
struct dwarf_file_data * file_index = lookup_filename (s.file); struct dwarf_file_data * file_index = lookup_filename (s.file);
if (((is_cu_die (old_die->die_parent) if (((is_unit_die (old_die->die_parent)
/* This condition fixes the inconsistency/ICE with the /* This condition fixes the inconsistency/ICE with the
following Fortran test (or some derivative thereof) while following Fortran test (or some derivative thereof) while
building libgfortran: building libgfortran:
...@@ -22796,9 +22796,6 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) ...@@ -22796,9 +22796,6 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
&& old_die->die_parent->die_tag == DW_TAG_module) && old_die->die_parent->die_tag == DW_TAG_module)
|| context_die == NULL) || context_die == NULL)
&& (DECL_ARTIFICIAL (decl) && (DECL_ARTIFICIAL (decl)
/* The location attributes may be in the abstract origin
which in the case of LTO might be not available to
look at. */
|| (get_AT_file (old_die, DW_AT_decl_file) == file_index || (get_AT_file (old_die, DW_AT_decl_file) == file_index
&& (get_AT_unsigned (old_die, DW_AT_decl_line) && (get_AT_unsigned (old_die, DW_AT_decl_line)
== (unsigned) s.line) == (unsigned) s.line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment