diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2019-01-02 16:23:27 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-01-02 15:23:27 +0000 |
commit | 3b456f8da3721618ae706b0c4eaa438cccb0dbd2 (patch) | |
tree | 92e1fef93fee27d675a892844d2a8c3cffe4f323 /gcc/varpool.c | |
parent | 0588e288242a3b66b67e79d11e03828a0a728953 (diff) | |
download | gcc-3b456f8da3721618ae706b0c4eaa438cccb0dbd2.zip gcc-3b456f8da3721618ae706b0c4eaa438cccb0dbd2.tar.gz gcc-3b456f8da3721618ae706b0c4eaa438cccb0dbd2.tar.bz2 |
re PR lto/88130 (ICE in copy_function_or_variable, at lto-streamer-out.c:2315 since r260963)
PR lto/88130
* varpool.c (varpool_node::ctor_useable_for_folding_p): Also return
false at WPA time when body was removed.
* g++.dg/torture/pr88130.C: New testcase.
From-SVN: r267515
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r-- | gcc/varpool.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c index 2aa59f9..edffa55 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -335,16 +335,16 @@ varpool_node::ctor_useable_for_folding_p (void) if (TREE_THIS_VOLATILE (decl)) return false; + /* Avoid attempts to load constructors that was not streamed. */ + if (in_lto_p && DECL_INITIAL (real_node->decl) == error_mark_node + && real_node->body_removed) + return false; + /* If we do not have a constructor, we can't use it. */ if (DECL_INITIAL (real_node->decl) == error_mark_node && !real_node->lto_file_data) return false; - /* Avoid attempts to load constructors that was not streamed. */ - if (flag_ltrans && DECL_INITIAL (real_node->decl) == error_mark_node - && real_node->body_removed) - return false; - /* Vtables are defined by their types and must match no matter of interposition rules. */ if (DECL_VIRTUAL_P (decl)) |