Commit ae2cac71 by Richard Guenther Committed by Richard Biener

re PR lto/41658 (Execution testsuite fails with -O2 -fwhopr)

2009-12-11  Richard Guenther  <rguenther@suse.de>

	PR lto/41658
	PR lto/41657
	* lto-streamer-out.c (write_global_stream): Do not make decls
	weak but resort to TREE_ASM_WRITTEN to avoid multiple definitions.
	Make sure to mark all decls that we have written.

From-SVN: r155174
parent 8246b314
2009-12-11 Richard Guenther <rguenther@suse.de>
PR lto/41658
PR lto/41657
* lto-streamer-out.c (write_global_stream): Do not make decls
weak but resort to TREE_ASM_WRITTEN to avoid multiple definitions.
Make sure to mark all decls that we have written.
2009-12-11 Sebastian Andrzej Siewior <bigeasy@linutronix.de> 2009-12-11 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
PR target/36047 PR target/36047
...@@ -2147,35 +2147,20 @@ write_global_stream (struct output_block *ob, ...@@ -2147,35 +2147,20 @@ write_global_stream (struct output_block *ob,
{ {
t = lto_tree_ref_encoder_get_tree (encoder, index); t = lto_tree_ref_encoder_get_tree (encoder, index);
if (!lto_streamer_cache_lookup (ob->writer_cache, t, NULL)) if (!lto_streamer_cache_lookup (ob->writer_cache, t, NULL))
{ lto_output_tree (ob, t, false);
if (flag_wpa) if (flag_wpa)
{ {
/* In WPA we should not emit multiple definitions of the /* In WPA we should not emit multiple definitions of the
same symbol to all the files in the link set. If same symbol to all the files in the link set. If
T had already been emitted as the pervailing definition T had already been emitted as the pervailing definition
in one file, emit it as an external reference in the in one file, do not emit it in the others. */
others. */
/* FIXME lto. We should check if T belongs to the /* FIXME lto. We should check if T belongs to the
file we are writing to. */ file we are writing to. */
if (TREE_CODE (t) == VAR_DECL if (TREE_CODE (t) == VAR_DECL
&& TREE_PUBLIC (t) && TREE_PUBLIC (t)
&& !DECL_EXTERNAL (t)) && !DECL_EXTERNAL (t))
{ TREE_ASM_WRITTEN (t) = 1;
/* FIXME lto. Make DECLS_ALREADY_EMITTED an argument
to this function so it can be freed up afterwards.
Alternately, assign global symbols to cgraph
node sets. */
static struct pointer_set_t *decls_already_emitted = NULL;
if (decls_already_emitted == NULL)
decls_already_emitted = pointer_set_create ();
if (pointer_set_insert (decls_already_emitted, t))
make_decl_one_only (t, DECL_ASSEMBLER_NAME (t));
}
}
lto_output_tree (ob, t, false);
} }
} }
} }
......
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