* dwarf2out.c (gen_tagged_type_die): Don't put local types in
a declaration DIE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167436
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-12-03 Jason Merrill <jason@redhat.com>
+
+ PR debug/46123
+ * dwarf2out.c (gen_tagged_type_die): Don't put local types in
+ a declaration DIE.
+
2010-12-03 Nathan Froyd <froydnj@codesourcery.com>
* config/arm/arm.c (arm_legitimate_index_p): Split
out yet, use a NULL context for now; it will be fixed up in
decls_for_scope. */
context_die = lookup_decl_die (TYPE_CONTEXT (type));
+ /* A declaration DIE doesn't count; nested types need to go in the
+ specification. */
+ if (context_die && is_declaration_die (context_die))
+ context_die = NULL;
need_pop = 0;
}
else
+2010-12-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/46123
+ * g++.dg/debug/pr46123.C: New test.
+ * g++.dg/debug/dwarf2/pr46123.C: New test.
+
2010-12-03 Jason Merrill <jason@redhat.com>
PR c++/46058
--- /dev/null
+// PR debug/46123
+// { dg-do compile }
+// { dg-options "-gdwarf-4" }
+
+struct foo
+{
+ static int bar ()
+ {
+ int i;
+ static int baz = 1;
+ {
+ static int baz = 2;
+ i = baz++;
+ }
+ {
+ struct baz
+ {
+ static int m ()
+ {
+ static int n;
+ return n += 10;
+ }
+ };
+ baz a;
+ i += a.m ();
+ }
+ {
+ static int baz = 3;
+ i += baz;
+ baz += 30;
+ }
+ i += baz;
+ baz += 60;
+ return i;
+ }
+};
+
+int main ()
+{
+ foo x;
+
+ if (x.bar () != 16)
+ return 1;
+ if (x.bar() != 117)
+ return 1;
+ return 0;
+}
--- /dev/null
+// PR debug/46123
+// { dg-do compile }
+// { dg-options "-g -feliminate-dwarf2-dups" }
+
+struct foo
+{
+ static int bar ()
+ {
+ int i;
+ static int baz = 1;
+ {
+ static int baz = 2;
+ i = baz++;
+ }
+ {
+ struct baz
+ {
+ static int m ()
+ {
+ static int n;
+ return n += 10;
+ }
+ };
+ baz a;
+ i += a.m ();
+ }
+ {
+ static int baz = 3;
+ i += baz;
+ baz += 30;
+ }
+ i += baz;
+ baz += 60;
+ return i;
+ }
+};
+
+int main ()
+{
+ foo x;
+
+ if (x.bar () != 16)
+ return 1;
+ if (x.bar() != 117)
+ return 1;
+ return 0;
+}