diff options
author | Richard Guenther <rguenther@suse.de> | 2011-12-15 09:44:11 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-12-15 09:44:11 +0000 |
commit | 2e537cdecbdc4180821b0baca1af4a716bd0f1e4 (patch) | |
tree | 42ee680c41066552ec1065a5355d39eb26b5f7e4 /gcc/tree-streamer-out.c | |
parent | 4fde01bb0b2b1fbedb40ed3d2cccfdba422b64c6 (diff) | |
download | gcc-2e537cdecbdc4180821b0baca1af4a716bd0f1e4.zip gcc-2e537cdecbdc4180821b0baca1af4a716bd0f1e4.tar.gz gcc-2e537cdecbdc4180821b0baca1af4a716bd0f1e4.tar.bz2 |
revert: re PR lto/48437 (LTO crashes with block-local function declarations)
2012-12-15 Richard Guenther <rguenther@suse.de>
Revert
PR lto/48437
* lto-streamer-out.c (tree_is_indexable): Exclude block-local
extern declarations.
PR lto/48508
PR lto/48437
* tree-streamer-out.c (streamer_write_chain): Stream DECL_EXTERNAL
VAR_DECLs and FUNCTION_DECLs locally.
* g++.dg/lto/pr48508-1_0.C: New testcase.
* g++.dg/lto/pr48508-1_1.C: Likewise.
From-SVN: r182358
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r-- | gcc/tree-streamer-out.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index fea15ff..d90ee80 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -405,7 +405,13 @@ streamer_write_chain (struct output_block *ob, tree t, bool ref_p) saved_chain = TREE_CHAIN (t); TREE_CHAIN (t) = NULL_TREE; - stream_write_tree (ob, t, ref_p); + /* We avoid outputting external vars or functions by reference + to the global decls section as we do not want to have them + enter decl merging. This is, of course, only for the call + for streaming BLOCK_VARS, but other callers are safe. */ + stream_write_tree (ob, t, + ref_p && !(VAR_OR_FUNCTION_DECL_P (t) + && DECL_EXTERNAL (t))); TREE_CHAIN (t) = saved_chain; t = TREE_CHAIN (t); |