Commit f36a3ff7 by Aldy Hernandez Committed by Aldy Hernandez

re PR debug/71855 (duplicate unspecified_parameters DIE in DWARF for functions…

re PR debug/71855 (duplicate unspecified_parameters DIE in DWARF for functions with variable arguments)

	PR debug/71855
	* dwarf2out.c (gen_subprogram_die): Only call
	gen_unspecified_parameters_die while dumping early dwarf.

From-SVN: r238488
parent 4fda19ef
2016-07-19 Aldy Hernandez <aldyh@redhat.com>
PR debug/71855
* dwarf2out.c (gen_subprogram_die): Only call
gen_unspecified_parameters_die while dumping early dwarf.
2016-07-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/71874
......
......@@ -20726,14 +20726,17 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
void_type_node 2) an unprototyped function declaration (not a
definition). This just means that we have no info about the
parameters at all. */
if (prototype_p (TREE_TYPE (decl)))
if (early_dwarf)
{
/* This is the prototyped case, check for.... */
if (stdarg_p (TREE_TYPE (decl)))
if (prototype_p (TREE_TYPE (decl)))
{
/* This is the prototyped case, check for.... */
if (stdarg_p (TREE_TYPE (decl)))
gen_unspecified_parameters_die (decl, subr_die);
}
else if (DECL_INITIAL (decl) == NULL_TREE)
gen_unspecified_parameters_die (decl, subr_die);
}
else if (DECL_INITIAL (decl) == NULL_TREE)
gen_unspecified_parameters_die (decl, subr_die);
}
if (subr_die != old_die)
......
/* { dg-do compile } */
/* { dg-options "-O0 -g -dA" } */
// Test that there is only one DW_TAG_unspecified_parameters DIE.
void
foo (const char *format, ...)
{
}
// { dg-final { scan-assembler-times "DIE.*DW_TAG_unspecified_parameters" 1 } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment