r194634 - in /trunk/gcc: ChangeLog gcov-io.c

tejohnson@gcc.gnu.org tejohnson@gcc.gnu.org
Thu Dec 20 14:31:00 GMT 2012


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



More information about the Gcc-cvs mailing list