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 gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Dec 2012 14:31:18 +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 #22 from tejohnson at gcc dot gnu.org 2012-12-20 14:31:18 UTC ---
Author: tejohnson
Date: Thu Dec 20 14:31:09 2012
New Revision: 194634
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194634
Log:
Fix PR gcov-profile/55734 by using methods from hwint.c instead of
builtins, to handle non-GCC and older versions of GCC. When building
libgcov.a, however, hwint.c is not available, but we are always using
the bootstrapped compiler and can therefore use the builtins.
Use __builtin_popcount instead of __builtin_popcountll, since we
are operating on an int.
Use floor_log2 directly, instead of clz_hwi for the non-libgcov case,
and handle situations where the size of the gcov_type is bigger than
HOST_WIDE_INT. Verified that the various cases compiled by forcing
different HOST_BITS_PER_WIDE_INT values.
2012-12-20 Teresa Johnson <tejohnson@google.com>
Jakub Jelinek <jakub@redhat.com>
PR gcov-profile/55734
* gcov-io.c (gcov_read_summary): Use __builtin_popcount instead
of __builtin_popcountll when building libgcov.a, otherwise use
popcount_hwi.
(gcov_histo_index): When not building libgcov.a, use floor_log2
instead of __builtin_clzll.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gcov-io.c