This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: [google gcc-4_8] unify int and fp scaling in gcov-tool


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


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