summaryrefslogtreecommitdiff
path: root/gcc/libgcov.c
diff options
context:
space:
mode:
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-29 19:46:16 +0000
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-29 19:46:16 +0000
commit0155526770d825f5748f17b93e1ae38635d36b6e (patch)
tree1bcb50fc008f9e630f337be271e925d4dc509c22 /gcc/libgcov.c
parent6e6fcb1ef8c8f6aed18be1817fb95a27cbf8057c (diff)
downloadgcc-0155526770d825f5748f17b93e1ae38635d36b6e.tar.gz
PR target/32277
* libgcov.c ( __gcov_indirect_call_profiler): Check TARGET_VTABLE_USES_DESCRIPTORS. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141442 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcov.c')
-rw-r--r--gcc/libgcov.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/libgcov.c b/gcc/libgcov.c
index 04fc3b2a0d8..5abceae6d62 100644
--- a/gcc/libgcov.c
+++ b/gcc/libgcov.c
@@ -777,7 +777,12 @@ void
__gcov_indirect_call_profiler (gcov_type* counter, gcov_type value,
void* cur_func, void* callee_func)
{
- if (cur_func == callee_func)
+ /* If the C++ virtual tables contain function descriptors then one
+ function may have multiple descriptors and we need to dereference
+ the descriptors to see if they point to the same function. */
+ if (cur_func == callee_func
+ || (TARGET_VTABLE_USES_DESCRIPTORS && callee_func
+ && *(void **) cur_func == *(void **) callee_func))
__gcov_one_value_profiler_body (counter, value);
}
#endif