[Patch Ping] Patch for PR target/32277 - IA64 C++ profiling bug

sje@cup.hp.com sje@cup.hp.com
Wed Oct 29 19:32:00 GMT 2008


This is a ping for my patch (based on Andreas Schwab's fix) for
PR target/32277.  I tweaked it from the earlier version to fix
some formatting issues that HJ pointed out.

Tested on IA64 HP-UX and Linux with no regressions and it fixes
the g++.dg/tree-prof/indir-call-prof.C test failure.

OK for checkin?

Original patch: http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00560.html

Steve Ellcey
sje@cup.hp.com



2008-10-29  Steve Ellcey  <sje@cup.hp.com>

	PR target/32277
	* libgcov.c ( __gcov_indirect_call_profiler): Check
	TARGET_VTABLE_USES_DESCRIPTORS.


Index: libgcov.c
===================================================================
--- libgcov.c	(revision 141334)
+++ libgcov.c	(working copy)
@@ -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



More information about the Gcc-patches mailing list