aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-01-03 11:30:27 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-01-03 11:30:27 +0000
commitf3321fd71519a24f58a8e21048a191be042ff121 (patch)
tree1436a514ff17b1c15608dc6c9b85d39a081fcbbc
parentda89f7f38e761dfded871bfa1715a35f70d66743 (diff)
downloadgcc-f3321fd71519a24f58a8e21048a191be042ff121.zip
gcc-f3321fd71519a24f58a8e21048a191be042ff121.tar.gz
gcc-f3321fd71519a24f58a8e21048a191be042ff121.tar.bz2
re PR debug/51650 (LTO ICE in dwarf2out_finish, at dwarf2out.c:22501 while building libxul)
2012-01-03 Richard Guenther <rguenther@suse.de> PR debug/51650 * dwarf2out.c (dwarf2out_finish): Always create a DIE for the context of a limbo DIE when it does not already exist. * g++.dg/lto/pr51650-3_0.C: New testcase. From-SVN: r182835
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c11
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/lto/pr51650-3_0.C20
4 files changed, 33 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cac0108..1c21031 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-03 Richard Guenther <rguenther@suse.de>
+
+ PR debug/51650
+ * dwarf2out.c (dwarf2out_finish): Always create a DIE for
+ the context of a limbo DIE when it does not already exist.
+
2012-01-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51719
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 850eb55..b553775 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -22501,15 +22501,8 @@ dwarf2out_finish (const char *filename)
else if (TYPE_P (node->created_for))
context = TYPE_CONTEXT (node->created_for);
- gcc_assert (context
- && (TREE_CODE (context) == FUNCTION_DECL
- || TREE_CODE (context) == NAMESPACE_DECL));
-
- origin = lookup_decl_die (context);
- if (origin)
- add_child_die (origin, die);
- else
- add_child_die (comp_unit_die (), die);
+ origin = get_context_die (context);
+ add_child_die (origin, die);
}
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6ac425a..6185d58 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-03 Richard Guenther <rguenther@suse.de>
+
+ PR debug/51650
+ * g++.dg/lto/pr51650-3_0.C: New testcase.
+
2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/15867
diff --git a/gcc/testsuite/g++.dg/lto/pr51650-3_0.C b/gcc/testsuite/g++.dg/lto/pr51650-3_0.C
new file mode 100644
index 0000000..e84d555
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr51650-3_0.C
@@ -0,0 +1,20 @@
+// { dg-lto-do link }
+// { dg-lto-options { { -flto -g } } }
+
+struct T;
+struct C
+{
+ typedef ::T T;
+ virtual void E();
+ static T *m ()
+ {
+ static T *d;
+ return d;
+ }
+};
+int
+fn ()
+{
+ C::m ();
+}
+int main() {}