aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-10-12 14:37:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-10-12 14:37:53 +0000
commit0bfd099c35ab5e03bb51dcd237ba5fb82b500b86 (patch)
tree3df218c47dcb17cac62dbd5519e6d2e34b1c7b59 /gcc/cgraphunit.c
parent05f1a54316f9516defe5ab54e0be66b1821596a1 (diff)
downloadgcc-0bfd099c35ab5e03bb51dcd237ba5fb82b500b86.zip
gcc-0bfd099c35ab5e03bb51dcd237ba5fb82b500b86.tar.gz
gcc-0bfd099c35ab5e03bb51dcd237ba5fb82b500b86.tar.bz2
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
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index abcb35d..4fa518d 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -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
{