This is the mail archive of the gcc-bugs@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]

[Bug gcov-profile/55734] [4.8 Regression] gcov-io.c uses builtins not available in non-GCC compilers


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55734

--- Comment #7 from Teresa Johnson <tejohnson at google dot com> 2012-12-18 16:24:13 UTC ---
On Tue, Dec 18, 2012 at 7:53 AM, rguenth at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55734
>
> --- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-18 15:53:42 UTC ---
> (In reply to comment #4)
>> (In reply to comment #3)
>> > In that thread, I had asked:
>> >
>> > ---
>> > If you prefer, I can simply inline the popcount/clz functionality into
>> > gcov-io.c directly (or at least when not using recent versions of
>> > GCC). But that in fact would be duplicating the code, when I thought
>> > Aldy's solution was trying to avoid that by providing the more general
>> > interfaces.
>> >
>> > Teresa
>> > ---
>> >
>> > but didn't get a response. Richard, is that your preferred route for
>> > fixing this issue?
>>
>> We already have popcount_hwi and clz_hwi available.  Can't you piggy-back
>> on that to provide (inline in gcov-io.c) popcountll and clzll?  Why do
>> you need the long long variants anyway?
>
> You don't seem to:
>
>   unsigned histo_bitvector[GCOV_HISTOGRAM_BITVECTOR_SIZE];
> ...
>          h_cnt += __builtin_popcountll (histo_bitvector[bv_ix]);
>
> so just use popcount_hwi.

The complication seems to be that hwint is not currently available for
libgcov.a (it is included by system.h which is not in libgcov.a). I
thought this was why Aldy took the approach of splitting out the hwi
routines into a separate helper file included by both hwint.c and
gcov-io. I can see if there is a way to simplify this, but I'm not
sure it is simple to include hwint into the gcov-io.c (and therefore
libgcov.a).

Teresa

>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.



--
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]