Commit 14fac436 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/86900 (-gdwarf-5 -O2 -ffunction-sections = assembler error)

	PR c++/86900
	* dwarf2out.c (secname_for_decl): For functions with
	DECL_SECTION_NAME if in_cold_section_p, try to return
	current_function_section's name if it is a named section.

	* g++.dg/debug/dwarf2/pr86900.C: New test.

From-SVN: r266485
parent 3cf50fcd
2018-11-26 Jakub Jelinek <jakub@redhat.com>
PR c++/86900
* dwarf2out.c (secname_for_decl): For functions with
DECL_SECTION_NAME if in_cold_section_p, try to return
current_function_section's name if it is a named section.
2018-11-26 Maya Rashish <coypu@sdf.org>
PR target/58397
......@@ -16742,7 +16742,15 @@ secname_for_decl (const_tree decl)
&& DECL_SECTION_NAME (decl))
secname = DECL_SECTION_NAME (decl);
else if (current_function_decl && DECL_SECTION_NAME (current_function_decl))
{
if (in_cold_section_p)
{
section *sec = current_function_section ();
if (sec->common.flags & SECTION_NAMED)
return sec->named.name;
}
secname = DECL_SECTION_NAME (current_function_decl);
}
else if (cfun && in_cold_section_p)
secname = crtl->subsections.cold_section_label;
else
......
2018-11-26 Jakub Jelinek <jakub@redhat.com>
PR c++/86900
* g++.dg/debug/dwarf2/pr86900.C: New test.
2018-11-26 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* gcc.c-torture/compile/20151204.c: Add dg-require-effective-target
......
// PR c++/86900
// { dg-do assemble { target function_sections } }
// { dg-options "-O2 -gdwarf-5 -ffunction-sections" }
struct A;
struct B { B (A); };
struct A { A (int); ~A (); };
void
foo (int x)
{
A d(0);
B e(d);
}
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