From: Steve Ellcey Date: Wed, 29 Oct 2008 19:46:16 +0000 (+0000) Subject: re PR target/32277 (indir-call-prof fails on ia64-linux-gnu) X-Git-Tag: releases/gcc-4.4.0~1897 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81a39e89f3bb0a5b2c2d59b30254b2ca7e339bc0;p=thirdparty%2Fgcc.git re PR target/32277 (indir-call-prof fails on ia64-linux-gnu) PR target/32277 * libgcov.c ( __gcov_indirect_call_profiler): Check TARGET_VTABLE_USES_DESCRIPTORS. From-SVN: r141442 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf3467d03237..c064c103b0ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-10-29 Steve Ellcey + + PR target/32277 + * libgcov.c ( __gcov_indirect_call_profiler): Check + TARGET_VTABLE_USES_DESCRIPTORS. + 2008-10-29 Stefan Schulze Frielinghaus * config/spu/spu.h (FRAME_GROWS_DOWNWARD): Define. diff --git a/gcc/libgcov.c b/gcc/libgcov.c index 04fc3b2a0d8b..5abceae6d62e 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