This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

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:

Steve Ellcey

2008-10-29  Steve Ellcey  <>

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

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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]