summaryrefslogtreecommitdiff
path: root/gcc/ipa-icf.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-05 21:26:44 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-05 21:26:44 +0000
commit8a953cb8b449a675202d91812ac7b6fb1861a0bd (patch)
tree11025947cf4fb3b3d604bb1f53a2fa1e1055b097 /gcc/ipa-icf.c
parent02306e02a01c64c18f1f6f03d572651aaa5e22c7 (diff)
downloadgcc-8a953cb8b449a675202d91812ac7b6fb1861a0bd.tar.gz
* ipa-icf.c (sem_variable::equals_wpa): Check FINAL flags.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-icf.c')
-rw-r--r--gcc/ipa-icf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index a7f19d6fd8d..7c4c852ed5f 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -1480,6 +1480,18 @@ sem_variable::equals_wpa (sem_item *item,
ref->referred, ref2->referred,
ref->address_matters_p ()))
return false;
+
+ /* DECL_FINAL_P flag on methods referred by virtual tables is used
+ to decide on completeness possible_polymorphic_call_targets lists
+ and therefore it must match. */
+ if ((DECL_VIRTUAL_P (decl) || DECL_VIRTUAL_P (item->decl))
+ && (DECL_VIRTUAL_P (ref->referred->decl)
+ || DECL_VIRTUAL_P (ref2->referred->decl))
+ && ((DECL_VIRTUAL_P (ref->referred->decl)
+ != DECL_VIRTUAL_P (ref2->referred->decl))
+ || (DECL_FINAL_P (ref->referred->decl)
+ != DECL_FINAL_P (ref2->referred->decl))))
+ return return_false_with_msg ("virtual or final flag mismatch");
}
return true;