===================================================================
@@ -814,13 +814,22 @@ see the files COPYING3 and COPYING.RUNTI
#endif
/* By default, the C++ compiler will use function addresses in the
- vtable entries. Setting this nonzero tells the compiler to use
- function descriptors instead. The value of this macro says how
- many words wide the descriptor is (normally 2). It is assumed
- that the address of a function descriptor may be treated as a
- pointer to a function. */
-#ifndef TARGET_VTABLE_USES_DESCRIPTORS
+ vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero
+ tells the compiler to use function descriptors instead. The value
+ of this macro says how many words wide the descriptor is (normally 2).
+ It is assumed that the address of a function descriptor may be treated
+ as a pointer to a function.
+
+ VTABLE_USES_DESCRIPTORS is set to 0 if TARGET_VTABLE_USES_DESCRIPTORS
+ is not set by the target or 1 if it is. This is needed because
+ TARGET_VTABLE_USES_DESCRIPTORS could depend on compiler flags and
+ cannot be used in libgcov.c. */
+
+#ifdef TARGET_VTABLE_USES_DESCRIPTORS
+#define VTABLE_USES_DESCRIPTORS 1
+#else
#define TARGET_VTABLE_USES_DESCRIPTORS 0
+#define VTABLE_USES_DESCRIPTORS 0
#endif
/* By default, the vtable entries are void pointers, the so the alignment
===================================================================
@@ -777,7 +777,7 @@ __gcov_indirect_call_profiler (gcov_type
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
+ || (VTABLE_USES_DESCRIPTORS && callee_func
&& *(void **) cur_func == *(void **) callee_func))
__gcov_one_value_profiler_body (counter, value);
}