aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-04-14 21:59:00 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-04-14 19:59:00 +0000
commit88f592e3f4117e5da3da84f9bd2b1da8c4bc9a99 (patch)
tree14406a5b0a033e3277ab049f0f109dd8796fcf71 /gcc
parent9dba4b5565efd56bcfadecc173ed66947492153e (diff)
downloadgcc-88f592e3f4117e5da3da84f9bd2b1da8c4bc9a99.zip
gcc-88f592e3f4117e5da3da84f9bd2b1da8c4bc9a99.tar.gz
gcc-88f592e3f4117e5da3da84f9bd2b1da8c4bc9a99.tar.bz2
ipa-devirt.c (maybe_record_node): Ignore all non-methods (including cxa_pure_virtual).
* ipa-devirt.c (maybe_record_node): Ignore all non-methods (including cxa_pure_virtual). From-SVN: r209391
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-devirt.c18
2 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f2c127c..ca7dfb5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-14 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-devirt.c (maybe_record_node): Ignore all non-methods (including
+ cxa_pure_virtual).
+
2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
* tree.h (TYPE_IDENTIFIER): Declare.
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 03a6c5b..3a5432e 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -611,7 +611,12 @@ maybe_record_node (vec <cgraph_node *> &nodes,
bool *completep)
{
struct cgraph_node *target_node;
- enum built_in_function fcode;
+
+ /* cxa_pure_virtual and __builtin_unreachable do not need to be added into
+ list of targets; the runtime effect of calling them is undefined.
+ Only "real" virtual methods should be accounted. */
+ if (target && TREE_CODE (TREE_TYPE (target)) != METHOD_TYPE)
+ return;
if (!can_refer)
{
@@ -619,22 +624,19 @@ maybe_record_node (vec <cgraph_node *> &nodes,
is when we completely optimized it out. */
if (flag_ltrans
|| !target
- || !type_in_anonymous_namespace_p (DECL_CONTEXT (target)))
+ || !type_in_anonymous_namespace_p (DECL_CONTEXT (target)))
*completep = false;
return;
}
- if (!target
- /* Those are used to mark impossible scenarios. */
- || (fcode = DECL_FUNCTION_CODE (target))
- == BUILT_IN_UNREACHABLE
- || fcode == BUILT_IN_TRAP)
+ if (!target)
return;
target_node = cgraph_get_node (target);
if (target_node != NULL
- && (TREE_PUBLIC (target)
+ && ((TREE_PUBLIC (target)
+ || DECL_EXTERNAL (target))
|| target_node->definition)
&& symtab_real_symbol_p (target_node))
{