aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-12-16 14:31:14 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-12-16 14:31:14 +0000
commit271d01dfbb534e2311e43ec78442d43d95d12586 (patch)
tree6f7c9bd279782ca84437224b4fd99e0288beede2 /gcc/dwarf2out.c
parent002aad3fca5c5c3401be97d3088a81bc7bd1b196 (diff)
downloadgcc-271d01dfbb534e2311e43ec78442d43d95d12586.zip
gcc-271d01dfbb534e2311e43ec78442d43d95d12586.tar.gz
gcc-271d01dfbb534e2311e43ec78442d43d95d12586.tar.bz2
re PR bootstrap/51572 (LTO bootstrap failed with bootstrap-profiled)
2011-12-16 Richard Guenther <rguenther@suse.de> PR lto/51572 * dwarf2out.c (gen_type_die_with_usage): Use the context of the TYPE_DECL as well if it is file-scope. * gcc.dg/lto/pr51572-1_0.c: New testcase. From-SVN: r182401
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 768ecaf..d5f469c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -18842,8 +18842,9 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
/* Use the DIE of the containing namespace as the parent DIE of
the type description DIE we want to generate. */
- if (DECL_CONTEXT (TYPE_NAME (type))
- && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL)
+ if (DECL_FILE_SCOPE_P (TYPE_NAME (type))
+ || (DECL_CONTEXT (TYPE_NAME (type))
+ && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL))
context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type)));
TREE_ASM_WRITTEN (type) = 1;