This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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 libc/22086] pcprofiledump incorrect cross-endian condition


https://sourceware.org/bugzilla/show_bug.cgi?id=22086

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  99d6791899c43eb31b4d1896134501d814da7741 (commit)
      from  3f802aeb3403a558426b50d42a50c6bfcc6cc425 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=99d6791899c43eb31b4d1896134501d814da7741

commit 99d6791899c43eb31b4d1896134501d814da7741
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Sep 5 15:14:09 2017 +0000

    Fix pcprofiledump cross-endian condition (bug 22086).

    debug/pcprofiledump.c contains code that tries to handle other-endian
    data.  This uses a condition "(word & 0xfffffff0) == bswap_32
    (0xdeb00000)".  This condition is always false (the LHS always has the
    low four bits zero, the RHS doesn't); a correct comparison would use
    0x0fffffff.  This results in -Werror=tautological-compare build
    failures with the tile version of bits/byteswap.h and mainline GCC.

    https://sourceware.org/ml/libc-testresults/2017-q3/msg00400.html

    pcprofiledump.c: In function 'main':
    pcprofiledump.c:118:39: error: bitwise comparison always evaluates to false
    [-Werror=tautological-compare]
       int must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);
                                           ^~

    This patch fixes the condition.  Tested for x86_64, and with
    build-many-glibcs.py that it fixes the build for tilegx-linux-gnu.
    (Note that I have not tested the actual pcprofiledump functionality,
    native or cross endian, which lacks any testsuite coverage.)

        [BZ #22086]
        * debug/pcprofiledump.c (main): Use byte-swapped mask when
        comparing word with byte-swapped constant.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    6 ++++++
 debug/pcprofiledump.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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