summaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-03-03 11:58:03 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-03-03 11:58:03 +0000
commit368d0a915d94f3502ce8bea5b0ac2316556c5c7d (patch)
tree0d31863fa6d0d04b1edd86997607abf7006b15bb /gcc/ipa-devirt.c
parentc159e770d23491f90de558ff4d029982f9086d5f (diff)
downloadgcc-368d0a915d94f3502ce8bea5b0ac2316556c5c7d.tar.gz
Properly handle __cxa_pure_virtual visibility (PR lto/79760).
2017-03-03 Jan Hubicka <jh@suse.cz> PR lto/79760 * ipa-devirt.c (maybe_record_node): Properly handle __cxa_pure_virtual visibility. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245870 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r--gcc/ipa-devirt.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 4428d679722..0e5eb85b61d 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -2462,10 +2462,19 @@ maybe_record_node (vec <cgraph_node *> &nodes,
nodes.safe_push (target_node);
}
}
- else if (completep
- && (!type_in_anonymous_namespace_p
- (DECL_CONTEXT (target))
- || flag_ltrans))
+ else if (!completep)
+ ;
+ /* We have definition of __cxa_pure_virtual that is not accessible (it is
+ optimized out or partitioned to other unit) so we can not add it. When
+ not sanitizing, there is nothing to do.
+ Otherwise declare the list incomplete. */
+ else if (pure_virtual)
+ {
+ if (flag_sanitize & SANITIZE_UNREACHABLE)
+ *completep = false;
+ }
+ else if (flag_ltrans
+ || !type_in_anonymous_namespace_p (DECL_CONTEXT (target)))
*completep = false;
}