diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-08 08:50:35 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-08 08:50:35 +0000 |
commit | 38f76f5f13c9f5d437007d73a2fa8276aa9daaab (patch) | |
tree | 704e59c3933823639810c63e24aef23672bd795e /gcc/lto-streamer-out.c | |
parent | e102b28200e1541db6c4b93467533998856e0cb1 (diff) | |
download | gcc-38f76f5f13c9f5d437007d73a2fa8276aa9daaab.tar.gz |
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: svn+ssh://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); } |