{"id":810193,"url":"http://patchwork.ozlabs.org/api/1.2/patches/810193/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/patch/alpine.DEB.2.20.1709051514290.6483@digraph.polyomino.org.uk/","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/1.2/projects/41/?format=json","name":"GNU C Library","link_name":"glibc","list_id":"libc-alpha.sourceware.org","list_email":"libc-alpha@sourceware.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<alpine.DEB.2.20.1709051514290.6483@digraph.polyomino.org.uk>","list_archive_url":null,"date":"2017-09-05T15:14:49","name":"Fix pcprofiledump cross-endian condition (bug 22086) [committed]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"38e14c30b1a43b7cd651bbb0e3e71fe5eeaba3d4","submitter":{"id":4349,"url":"http://patchwork.ozlabs.org/api/1.2/people/4349/?format=json","name":"Joseph Myers","email":"joseph@codesourcery.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/alpine.DEB.2.20.1709051514290.6483@digraph.polyomino.org.uk/mbox/","series":[{"id":1595,"url":"http://patchwork.ozlabs.org/api/1.2/series/1595/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/list/?series=1595","date":"2017-09-05T15:14:49","name":"Fix pcprofiledump cross-endian condition (bug 22086) [committed]","version":1,"mbox":"http://patchwork.ozlabs.org/series/1595/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/810193/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/810193/checks/","tags":{},"related":[],"headers":{"Return-Path":"<libc-alpha-return-84188-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84188-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"w+UPNUyg\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmqyn6Ssfz9s76\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 01:15:13 +1000 (AEST)","(qmail 104582 invoked by alias); 5 Sep 2017 15:15:06 -0000","(qmail 103239 invoked by uid 89); 5 Sep 2017 15:15:04 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:subject:message-id:mime-version\n\t:content-type; q=dns; s=default; b=mECqOx2tAsedwnigesosW+7nHaV95\n\toY6Dr9xy/gNkPYH6H2XzQZUXgbH4UEC2gZMm5fQcthNHWnXD0E7Cq3TSjQm4Hh2X\n\tQNnqO6+L7Lg6urzE/5++6J/RNImz4Ch65mpWhO2WBd98desOp9zy6wm6uHueAahu\n\t62pYEToVEMqcBA=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:subject:message-id:mime-version\n\t:content-type; s=default; bh=xaZtA1zdXmWmtlTb3BdlChLu4FY=; b=w+U\n\tPNUygllJDoiK0piyVEB5IyfuJoxEhHuf5hM4ZrkcO48GHBUbDj54EHhQjvxeS4J3\n\tHgkwlYnobJ2uzT7VXY3/GtcZFnGz19bRDEw1jVxvIkuAuZRA6hovHO+naW+RqgFu\n\tBrcLti4aU898eHQE+LcsXTF/KSN7FaJWW7CIS5Nk=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.5 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRCVD_IN_DNSWL_NONE, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:1694","X-HELO":"relay1.mentorg.com","Date":"Tue, 5 Sep 2017 15:14:49 +0000","From":"Joseph Myers <joseph@codesourcery.com>","To":"<libc-alpha@sourceware.org>","Subject":"Fix pcprofiledump cross-endian condition (bug 22086) [committed]","Message-ID":"<alpine.DEB.2.20.1709051514290.6483@digraph.polyomino.org.uk>","User-Agent":"Alpine 2.20 (DEB 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"US-ASCII\"","X-ClientProxiedBy":"svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tsvr-ies-mbx-01.mgc.mentorg.com (139.181.222.1)"},"content":"debug/pcprofiledump.c contains code that tries to handle other-endian\ndata.  This uses a condition \"(word & 0xfffffff0) == bswap_32\n(0xdeb00000)\".  This condition is always false (the LHS always has the\nlow four bits zero, the RHS doesn't); a correct comparison would use\n0x0fffffff.  This results in -Werror=tautological-compare build\nfailures with the tile version of bits/byteswap.h and mainline GCC.\n\nhttps://sourceware.org/ml/libc-testresults/2017-q3/msg00400.html\n\npcprofiledump.c: In function 'main':\npcprofiledump.c:118:39: error: bitwise comparison always evaluates to false\n[-Werror=tautological-compare]\n   int must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);\n                                       ^~\n\nThis patch fixes the condition.  Tested for x86_64, and with\nbuild-many-glibcs.py that it fixes the build for tilegx-linux-gnu.\n(Note that I have not tested the actual pcprofiledump functionality,\nnative or cross endian, which lacks any testsuite coverage.)  Committed.\n\n2017-09-05  Joseph Myers  <joseph@codesourcery.com>\n\n\t[BZ #22086]\n\t* debug/pcprofiledump.c (main): Use byte-swapped mask when\n\tcomparing word with byte-swapped constant.","diff":"diff --git a/debug/pcprofiledump.c b/debug/pcprofiledump.c\nindex a32cdef..6a9641e 100644\n--- a/debug/pcprofiledump.c\n+++ b/debug/pcprofiledump.c\n@@ -115,7 +115,7 @@ main (int argc, char *argv[])\n     error (EXIT_FAILURE, errno, _(\"cannot read header\"));\n \n   /* Check whether we have to swap the byte order.  */\n-  int must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);\n+  int must_swap = (word & 0x0fffffff) == bswap_32 (0xdeb00000);\n   if (must_swap)\n     word = bswap_32 (word);\n \n","prefixes":[]}