This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug gcov-profile/55734] [4.8 Regression] gcov-io.c uses builtins not available in non-GCC compilers
- From: "tejohnson at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Dec 2012 17:07:51 +0000
- Subject: [Bug gcov-profile/55734] [4.8 Regression] gcov-io.c uses builtins not available in non-GCC compilers
- Auto-submitted: auto-generated
- References: <bug-55734-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55734
--- Comment #20 from Teresa Johnson <tejohnson at google dot com> 2012-12-19 17:07:51 UTC ---
On Wed, Dec 19, 2012 at 8:39 AM, jakub at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55734
>
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |jakub at gcc dot gnu.org
>
> --- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-19 16:39:56 UTC ---
> I guess a problem of such approach is if not in libgcov.a and HOST_WIDE_INT is
> smaller than long long (or for clz even not exactly 64-bit).
> For popcount, I wonder why the code uses __builtin_popcountll at all, when the
> value is unsigned int, it should just use __builtin_popcount and I think we can
> safely assume that HOST_WIDE_INT is at least as wide as int.
> So just using either popcount_hwi or __builtin_popcount (no ll) should be fine.
ok.
> For clz, there is:
> if (v > 0)
> r = 63 - __builtin_clzll (v);
> i.e. it relies on clzll having exactly 64-bit argument. For __builtin_clzll
> perhaps the assumption is fine, for clz_hwi not so. So you need some extra
> code to implement clz_ll on top of clz_hwi if HWI is smaller than 64-bit.
ok, thanks for pointing out this issue. I'll try out the solution you posted.
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