aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-06-28 07:43:36 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-06-28 07:43:36 +0000
commit8a731f44bfba5ef4a13845e42d781c30abd99a33 (patch)
tree4ca6ef8ccff84a14d7894331d8d8f31c431dfa72 /gcc
parent1aabb71d1331430965794be43f01d0e42e1351e3 (diff)
downloadgcc-8a731f44bfba5ef4a13845e42d781c30abd99a33.zip
gcc-8a731f44bfba5ef4a13845e42d781c30abd99a33.tar.gz
gcc-8a731f44bfba5ef4a13845e42d781c30abd99a33.tar.bz2
dwarf2out.c (gen_subprogram_die): Always re-use DIEs with an DW_AT_abstract_origin attribute.
2018-06-28 Richard Biener <rguenther@suse.de> * dwarf2out.c (gen_subprogram_die): Always re-use DIEs with an DW_AT_abstract_origin attribute. From-SVN: r262213
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2out.c35
2 files changed, 24 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8902e4a..e556791 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-28 Richard Biener <rguenther@suse.de>
+
+ * dwarf2out.c (gen_subprogram_die): Always re-use DIEs with an
+ DW_AT_abstract_origin attribute.
+
2018-06-28 Martin Liska <mliska@suse.cz>
* tree-switch-conversion.c (jump_table_cluster::can_be_handled):
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b5e3134..bcd47c8 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -22780,26 +22780,25 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
apply; we just use the old DIE. */
expanded_location s = expand_location (DECL_SOURCE_LOCATION (decl));
struct dwarf_file_data * file_index = lookup_filename (s.file);
- if ((is_cu_die (old_die->die_parent)
- /* This condition fixes the inconsistency/ICE with the
- following Fortran test (or some derivative thereof) while
- building libgfortran:
-
- module some_m
- contains
- logical function funky (FLAG)
- funky = .true.
- end function
- end module
- */
- || (old_die->die_parent
- && old_die->die_parent->die_tag == DW_TAG_module)
- || context_die == NULL)
+ if (((is_cu_die (old_die->die_parent)
+ /* This condition fixes the inconsistency/ICE with the
+ following Fortran test (or some derivative thereof) while
+ building libgfortran:
+
+ module some_m
+ contains
+ logical function funky (FLAG)
+ funky = .true.
+ end function
+ end module
+ */
+ || (old_die->die_parent
+ && old_die->die_parent->die_tag == DW_TAG_module)
+ || context_die == NULL)
&& (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 (old_die, DW_AT_abstract_origin)
|| (get_AT_file (old_die, DW_AT_decl_file) == file_index
&& (get_AT_unsigned (old_die, DW_AT_decl_line)
== (unsigned) s.line)
@@ -22807,6 +22806,10 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
|| s.column == 0
|| (get_AT_unsigned (old_die, DW_AT_decl_column)
== (unsigned) s.column)))))
+ /* With LTO if there's an abstract instance for
+ the old DIE, this is a concrete instance and
+ thus re-use the DIE. */
+ || get_AT (old_die, DW_AT_abstract_origin))
{
subr_die = old_die;