diff options
author | Richard Guenther <rguenther@suse.de> | 2011-12-08 08:50:35 +0000 |
---|---|---|
committer | Richard Guenther <rguenther@suse.de> | 2011-12-08 08:50:35 +0000 |
commit | e05bd518fe96b9dd7760c4130a6ad4ca399ce2cc (patch) | |
tree | 704e59c3933823639810c63e24aef23672bd795e /gcc/lto-streamer-out.c | |
parent | dfa3d5a9a6b15cfbdca441b5f7ee23f2e55838ac (diff) |
2011-12-08 Richard Guenther <rguenther@suse.de>
PR lto/48437
* lto-streamer-out.c (tree_is_indexable): Exclude block-local
extern declarations.
* gcc.dg/lto/20111207-2_0.c: New testcase.
* gcc.dg/guality/pr48437.c: Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@182100 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r-- | gcc/lto-streamer-out.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 62cf9a1832f..655cf89bc28 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -129,6 +129,16 @@ tree_is_indexable (tree t) else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t) && !TREE_STATIC (t)) return false; + /* If this is a decl generated for block local externs for + debug info generation, stream it unshared alongside BLOCK_VARS. */ + else if (VAR_OR_FUNCTION_DECL_P (t) + /* ??? The following tests are a literal match on what + c-decl.c:pop_scope does. */ + && TREE_PUBLIC (t) + && DECL_EXTERNAL (t) + && DECL_CONTEXT (t) + && TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL) + return false; else return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME); } |