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] New: pcprofiledump incorrect cross-endian condition


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

            Bug ID: 22086
           Summary: pcprofiledump incorrect cross-endian condition
           Product: glibc
           Version: 2.26
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: jsm28 at gcc dot gnu.org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

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);
                                       ^~

Testing a patch.

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