diff options
author | Martin Jambor <mjambor@suse.cz> | 2012-05-02 21:50:37 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2012-05-02 21:50:37 +0200 |
commit | d282264edf36116d5c55d0da59a612468608d9ca (patch) | |
tree | fc6987ad123a3e9be2b2a34bcdf17cccaad41c6c /gcc/dwarf2out.c | |
parent | 40f93bb5be85c6bb202bdb02b71efea13071e12a (diff) | |
download | gcc-d282264edf36116d5c55d0da59a612468608d9ca.zip gcc-d282264edf36116d5c55d0da59a612468608d9ca.tar.gz gcc-d282264edf36116d5c55d0da59a612468608d9ca.tar.bz2 |
re PR lto/52605 (LTO -g ICE when looking up context of VMTs of classes defined within functions)
2012-05-02 Martin Jambor <mjambor@suse.cz>
PR lto/52605
* dwarf2out.c (dwarf2out_decl): Only lookup die representing context
of a variable when the contect is a function.
* gcc/testsuite/g++.dg/lto/pr52605_0.C: New test.
From-SVN: r187063
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8bbf954..10a53894 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -19122,7 +19122,9 @@ dwarf2out_decl (tree decl) return; /* For local statics lookup proper context die. */ - if (TREE_STATIC (decl) && decl_function_context (decl)) + if (TREE_STATIC (decl) + && DECL_CONTEXT (decl) + && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL) context_die = lookup_decl_die (DECL_CONTEXT (decl)); /* If we are in terse mode, don't generate any DIEs to represent any |