]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/32277 (indir-call-prof fails on ia64-linux-gnu)
authorSteve Ellcey <sje@cup.hp.com>
Wed, 29 Oct 2008 19:46:16 +0000 (19:46 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Wed, 29 Oct 2008 19:46:16 +0000 (19:46 +0000)
PR target/32277
* libgcov.c ( __gcov_indirect_call_profiler): Check
TARGET_VTABLE_USES_DESCRIPTORS.

From-SVN: r141442

gcc/ChangeLog
gcc/libgcov.c

index bf3467d032374b7fef06df72b0dd0161b08f58df..c064c103b0ab739e4ad20ddad80506135c7d4a9f 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-29  Steve Ellcey  <sje@cup.hp.com>
+
+       PR target/32277
+       * libgcov.c ( __gcov_indirect_call_profiler): Check
+       TARGET_VTABLE_USES_DESCRIPTORS.
+
 2008-10-29  Stefan Schulze Frielinghaus  <xxschulz@de.ibm.com>
 
        * config/spu/spu.h (FRAME_GROWS_DOWNWARD): Define.
index 04fc3b2a0d8bf1ff9b3d2e7f18ed112da6ea5138..5abceae6d62e07219e2bbff0d222fdace44f726c 100644 (file)
@@ -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