+2013-01-31 Paul Koning <ni1d@arrl.net>
+
+ PR debug/55059
+ PR debug/54508
+ * dwarf2out.c (prune_unused_types_mark): Mark all of parent's
+ children if parent is a class.
+ (prune_unused_types_prune): Don't add DW_AT_declaration.
+
2013-01-31 Richard Biener <rguenther@suse.de>
PR tree-optimization/56157
prune_unused_types_mark_generic_parms_dies (die);
/* We also have to mark its parents as used.
- (But we don't want to mark our parents' kids due to this.) */
+ (But we don't want to mark our parent's kids due to this,
+ unless it is a class.) */
if (die->die_parent)
- prune_unused_types_mark (die->die_parent, 0);
+ prune_unused_types_mark (die->die_parent,
+ class_scope_p (die->die_parent));
/* Mark any referenced nodes. */
prune_unused_types_walk_attribs (die);
prune_unused_types_prune (dw_die_ref die)
{
dw_die_ref c;
- int pruned = 0;
gcc_assert (die->die_mark);
prune_unused_types_update_strings (die);
prev->die_sib = c->die_sib;
die->die_child = prev;
}
- pruned = 1;
- goto finished;
+ return;
}
if (c != prev->die_sib)
- {
- prev->die_sib = c;
- pruned = 1;
- }
+ prev->die_sib = c;
prune_unused_types_prune (c);
} while (c != die->die_child);
-
- finished:
- /* If we pruned children, and this is a class, mark it as a
- declaration to inform debuggers that this is not a complete
- class definition. */
- if (pruned && die->die_mark == 1 && class_scope_p (die)
- && ! is_declaration_die (die))
- add_AT_flag (die, DW_AT_declaration, 1);
}
/* Remove dies representing declarations that we never use. */
// { dg-final { scan-assembler "foo\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "staticfn1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "staticfn2\[^\n\r\]*DW_AT_name" } }
-// { dg-final { scan-assembler-not "staticfn3\[^\n\r\]*DW_AT_name" } }
-// { dg-final { scan-assembler-not "staticfn4\[^\n\r\]*DW_AT_name" } }
+// { dg-final { scan-assembler "staticfn3\[^\n\r\]*DW_AT_name" } }
+// { dg-final { scan-assembler "staticfn4\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn5\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn6\[^\n\r\]*DW_AT_name" } }
-// { dg-final { scan-assembler-not "method1\[^\n\r\]*DW_AT_name" } }
+// { dg-final { scan-assembler "method1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg2\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg3\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "foo\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "staticfn1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "staticfn2\[^\n\r\]*DW_AT_name" } }
-// { dg-final { scan-assembler-not "staticfn3\[^\n\r\]*DW_AT_name" } }
-// { dg-final { scan-assembler-not "staticfn4\[^\n\r\]*DW_AT_name" } }
+// { dg-final { scan-assembler "staticfn3\[^\n\r\]*DW_AT_name" } }
+// { dg-final { scan-assembler "staticfn4\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn5\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn6\[^\n\r\]*DW_AT_name" } }
-// { dg-final { scan-assembler-not "method1\[^\n\r\]*DW_AT_name" } }
+// { dg-final { scan-assembler "method1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg2\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg3\[^\n\r\]*DW_AT_name" } }
// { dg-do compile }
// { dg-options "-g2 -dA -fno-merge-debug-strings" }
-// { dg-final { scan-assembler-not "\"cbase\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
-// { dg-final { scan-assembler "\"c\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_decl_line\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_declaration" } }
-// { dg-final { scan-assembler-not "\"OPCODE\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
-// { dg-final { scan-assembler-not "\"bi\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
-// { dg-final { scan-assembler-not "\"si\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
-// { dg-final { scan-assembler "\"s\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
-// { dg-final { scan-assembler-not "\"s\\\\0\"\[^#;/!|@\]+\[#;/!|@\]+ +DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_decl_line\[\r\n\]+\[ \t\]+\[#;/!|@\]+ +DW_AT_declaration" } }
+// { dg-final { scan-assembler "\"cbase\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler "\"OPCODE\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler "\"bi\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler "\"si\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
// { dg-final { scan-assembler "\"f1\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
-// { dg-final { scan-assembler "\"u\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_decl_line\[\r\n\]+\[^#;/!|@\]+\[#;/!|@\]+ +DW_AT_declaration" } }
-// { dg-final { scan-assembler-not "\"f2\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler "\"f2\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
// { dg-final { scan-assembler-not "\"nc\\\\0\"\[ \t\]+\# +DW_AT_name" } }
class cbase
void test (int src)
{
int cookie = 1;
- static struct s ss;
-
send(src, c::OPCODE, c::testc (), cookie);
+ send(src, c::OPCODE, s::tests (), cookie);
send(src, c::OPCODE, u::testu (), cookie);
send(src, c::OPCODE, n::ntest (), cookie);
}