aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-09-14 11:48:04 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-09-14 11:48:04 +0200
commit4a6e5cc885d6592194ff7e0c884d0bb802251c73 (patch)
tree6ab0ee5b1b486cac64d91f420e15bd1ac0df36e6 /gcc
parent5a2c19863869535ff6487951a5732adb114bfb4a (diff)
downloadgcc-4a6e5cc885d6592194ff7e0c884d0bb802251c73.zip
gcc-4a6e5cc885d6592194ff7e0c884d0bb802251c73.tar.gz
gcc-4a6e5cc885d6592194ff7e0c884d0bb802251c73.tar.bz2
re PR debug/45660 (ICE in dwarf2out_finish)
PR debug/45660 * dwarf2out.c (gen_decl_die): Call gen_type_die for origin before gen_type_die for function/method return type. * g++.dg/debug/pr45660.C: New test. From-SVN: r164271
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c12
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/debug/pr45660.C16
4 files changed, 35 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 062d25b..5a3c65f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45660
+ * dwarf2out.c (gen_decl_die): Call gen_type_die for origin before
+ gen_type_die for function/method return type.
+
2010-09-14 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/45470
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 52632da..5ee14ee 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -20602,16 +20602,20 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die)
else if (debug_info_level > DINFO_LEVEL_TERSE)
{
/* Before we describe the FUNCTION_DECL itself, make sure that we
- have described its return type. */
+ have its containing type. */
+ if (!origin)
+ origin = decl_class_context (decl);
+ if (origin != NULL_TREE)
+ gen_type_die (origin, context_die);
+
+ /* And its return type. */
gen_type_die (TREE_TYPE (TREE_TYPE (decl)), context_die);
/* And its virtual context. */
if (DECL_VINDEX (decl) != NULL_TREE)
gen_type_die (DECL_CONTEXT (decl), context_die);
- /* And its containing type. */
- if (!origin)
- origin = decl_class_context (decl);
+ /* Make sure we have a member DIE for decl. */
if (origin != NULL_TREE)
gen_type_die_for_member (origin, decl, context_die);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 56b953c..d9ebdd0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45660
+ * g++.dg/debug/pr45660.C: New test.
+
2010-09-14 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/45470
diff --git a/gcc/testsuite/g++.dg/debug/pr45660.C b/gcc/testsuite/g++.dg/debug/pr45660.C
new file mode 100644
index 0000000..4f03fd5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr45660.C
@@ -0,0 +1,16 @@
+// PR debug/45660
+// { dg-do compile }
+// { dg-options "-g -fno-inline" }
+
+void
+test ()
+{
+ struct S
+ {
+ typedef void (**T) (void);
+ static T i (void) { return 0; }
+ };
+ S s;
+ if (s.i ())
+ *s.i () = 0;
+}