summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 19:50:37 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 19:50:37 +0000
commitad5f1481145166ac9fb2d18cba1a062396b56a0f (patch)
treefc6987ad123a3e9be2b2a34bcdf17cccaad41c6c /gcc/dwarf2out.c
parentb920f7259ba7f9471615d5568ce8844c546b1701 (diff)
downloadgcc-ad5f1481145166ac9fb2d18cba1a062396b56a0f.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8bbf95477a7..10a53894f63 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