diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-07 12:04:09 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-07 12:04:09 +0000 |
commit | 2b7c48a1cd57b926109f7d954695df901427bab7 (patch) | |
tree | 673227f670cc8407b1b362afe606908aa7b44318 /gcc/lto-cgraph.c | |
parent | 539f863be89dc9fec7b2cffb35e531838e8f0d1c (diff) | |
download | gcc-2b7c48a1cd57b926109f7d954695df901427bab7.tar.gz |
* lto-cgraph.c (output_cgraph): Output toplevel asms only into first
partition.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161904 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r-- | gcc/lto-cgraph.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 4217a71da35..04f5407a800 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -881,14 +881,21 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset) lto_output_uleb128_stream (ob->main_stream, 0); - /* Emit toplevel asms. */ - for (can = cgraph_asm_nodes; can; can = can->next) + /* Emit toplevel asms. + When doing WPA we must output every asm just once. Since we do not partition asm + nodes at all, output them to first output. This is kind of hack, but should work + well. */ + if (!asm_nodes_output) { - int len = TREE_STRING_LENGTH (can->asm_str); - lto_output_uleb128_stream (ob->main_stream, len); - for (i = 0; i < len; ++i) - lto_output_1_stream (ob->main_stream, - TREE_STRING_POINTER (can->asm_str)[i]); + asm_nodes_output = true; + for (can = cgraph_asm_nodes; can; can = can->next) + { + int len = TREE_STRING_LENGTH (can->asm_str); + lto_output_uleb128_stream (ob->main_stream, len); + for (i = 0; i < len; ++i) + lto_output_1_stream (ob->main_stream, + TREE_STRING_POINTER (can->asm_str)[i]); + } } lto_output_uleb128_stream (ob->main_stream, 0); |