This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [google gcc-4_8] unify int and fp scaling in gcov-tool
- From: Rong Xu <xur at google dot com>
- To: Teresa Johnson <tejohnson at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Mon, 10 Feb 2014 13:10:13 -0800
- Subject: Re: [google gcc-4_8] unify int and fp scaling in gcov-tool
- Authentication-results: sourceware.org; auth=none
- References: <CAF1bQ=REBuqDV1cH4uO2-2wDmMRUdf209AJFYcwo9hmH2DoAoA at mail dot gmail dot com> <CAAe5K+WgsS79YGvpO2vAOQ7-uJSzyRjpdQcRS3u-+kBc7j+H6w at mail dot gmail dot com>
Yes. They were the bug I mentioned. This patch fixed that.
-Rong
On Mon, Feb 10, 2014 at 10:40 AM, Teresa Johnson <tejohnson@google.com> wrote:
> Looks good to me.
>
> A couple questions:
>
>> static void
>> -__gcov_scale_icall_topn (gcov_type *counters, unsigned n_counters, double f)
>> +__gcov_icall_topn_op (gcov_type *counters, unsigned n_counters,
>> + counter_op_fn fn, void *data1, void *data2)
>> {
>> unsigned i;
>>
>> @@ -950,41 +949,65 @@ static void
>> gcov_type *value_array = &counters[i + 1];
>>
>> for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2)
>> - value_array[1] *= f;
>
> Was the above a bug (always updating index 1)?
>
>> + value_array[j + 1] = fn (value_array[j + 1], data1, data2);
>> }
>> }
>>
>> static void
>> -__gcov_scale_dc (gcov_type *counters, unsigned n_counters, double f)
>> +__gcov_dc_op (gcov_type *counters, unsigned n_counters,
>> + counter_op_fn fn, void *data1, void *data2)
>> {
>> unsigned i;
>>
>> gcc_assert (!(n_counters % 2));
>> for (i = 0; i < n_counters; i += 2)
>> - counters[1] *= f;
>
> Same question here
>
>> + counters[i + 1] = fn (counters[i + 1], data1, data2);
>> }
>
> Teresa
>
> On Tue, Feb 4, 2014 at 3:54 PM, Rong Xu <xur@google.com> wrote:
>> Hi,
>>
>> The attached patch uses a callback function to unify the integer and
>> floating-point scaling in gcov-tool. (Also fix a bug in fp scaling of
>> ic and dc counters in earlier code).
>>
>> Tested with spec2006 profiles.
>>
>> OK for checking in?
>>
>> Thanks,
>>
>> -Rong
>
>
>
> --
> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413