Commit 2e537cde by Richard Guenther Committed by Richard Biener

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
parent 4fde01bb
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.
2011-12-14 Richard Henderson <rth@redhat.com>
* config/arm/arm.md (*addsi3_compare0_scratch): Set predicable.
......@@ -129,16 +129,6 @@ 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;
/* Variably modified types need to be streamed alongside function
bodies because they can refer to local entities. Together with
them we have to localize their members as well.
......
2012-12-15 Richard Guenther <rguenther@suse.de>
PR lto/48508
* g++.dg/lto/pr48508-1_0.C: New testcase.
* g++.dg/lto/pr48508-1_1.C: Likewise.
2011-12-14 Jason Merrill <jason@redhat.com>
PR c++/51554
......
// { dg-lto-do link }
// { dg-lto-options { { -g -O2 -flto -flto-partition=none } } }
void __attribute__((externally_visible))
foo (int i)
{
}
static void
bar (void)
{
extern void foo (int);
foo (0);
}
int main()
{
bar ();
}
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment