Commit 0bfd099c by Richard Biener Committed by Richard Biener

re PR debug/77947 (ICE with -g and -O2 in strip_naming_typedef)

2016-10-12  Richard Biener  <rguenther@suse.de>

	PR debug/77947
	* cgraphunit.c (analyze_functions): Preserve cgraph nodes
	function context.

	* g++.dg/torture/pr77947.C: New testcase.

From-SVN: r241053
parent 05f1a543
2016-10-12 Richard Biener <rguenther@suse.de>
PR debug/77947
* cgraphunit.c (analyze_functions): Preserve cgraph nodes
function context.
2016-10-12 Thomas Schwinge <thomas@codesourcery.com>
* lto-streamer.c: Fix LTO_STREAMER_DEBUG build.
......
......@@ -1117,15 +1117,22 @@ analyze_functions (bool first_time)
}
/* If decl is a clone of an abstract function,
mark that abstract function so that we don't release its body.
The DECL_INITIAL() of that abstract function declaration
will be later needed to output debug info. */
mark that abstract function so that we don't release its body.
The DECL_INITIAL() of that abstract function declaration
will be later needed to output debug info. */
if (DECL_ABSTRACT_ORIGIN (decl))
{
cgraph_node *origin_node
= cgraph_node::get_create (DECL_ABSTRACT_ORIGIN (decl));
origin_node->used_as_abstract_origin = true;
}
/* Preserve a functions function context node. It will
later be needed to output debug info. */
if (tree fn = decl_function_context (decl))
{
cgraph_node *origin_node = cgraph_node::get_create (fn);
enqueue_node (origin_node);
}
}
else
{
......
2016-10-12 Richard Biener <rguenther@suse.de>
PR debug/77947
* g++.dg/torture/pr77947.C: New testcase.
2016-10-12 Pierre-Marie de Rodat <derodat@adacore.com>
* gnat.dg/debug8.adb: New testcase.
......
// { dg-do compile }
// { dg-additional-options "-g" }
class A
{
public:
virtual bool m_fn1 () const = 0;
};
class B
{
const A *m_fn2 () const;
};
inline const A *
B::m_fn2 () const
{
class C : A
{
bool
m_fn1 () const
{
}
C () {}
};
}
void
fn1 (A &p1)
{
p1.m_fn1 ();
}
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