[linux-next:master 6210/13128] lib/zstd/decompress/huf_decompress.c:890:25: error: use of bitwise '&' with boolean operands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



INFO skip CC on NO_CC_LKML=Too large changeset: 39854 lines

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8a796a1dfca2780321755033a74bca2bbe651680
commit: ecea7adad80d9d230df766345e5f8061792da00d [6210/13128] lib: zstd: Upgrade to latest upstream zstd version 1.4.10
config: riscv-buildonly-randconfig-r002-20211104 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 847a6807332b13f43704327c2d30103ec0347c77)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ecea7adad80d9d230df766345e5f8061792da00d
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout ecea7adad80d9d230df766345e5f8061792da00d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> lib/zstd/decompress/huf_decompress.c:890:25: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
                           (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/zstd/decompress/../common/compiler.h:127:38: note: expanded from macro 'LIKELY'
   #define LIKELY(x) (__builtin_expect((x), 1))
                                       ~^~
   lib/zstd/decompress/huf_decompress.c:890:25: note: cast one or both operands to int to silence this warning
>> lib/zstd/decompress/huf_decompress.c:890:25: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
                           (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/zstd/decompress/../common/compiler.h:127:38: note: expanded from macro 'LIKELY'
   #define LIKELY(x) (__builtin_expect((x), 1))
                                        ^
   lib/zstd/decompress/huf_decompress.c:890:25: note: cast one or both operands to int to silence this warning
>> lib/zstd/decompress/huf_decompress.c:890:25: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
                           (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/zstd/decompress/../common/compiler.h:127:38: note: expanded from macro 'LIKELY'
   #define LIKELY(x) (__builtin_expect((x), 1))
                                        ^
   lib/zstd/decompress/huf_decompress.c:890:25: note: cast one or both operands to int to silence this warning
   3 errors generated.


vim +890 lib/zstd/decompress/huf_decompress.c

   802	
   803	FORCE_INLINE_TEMPLATE size_t
   804	HUF_decompress4X2_usingDTable_internal_body(
   805	          void* dst,  size_t dstSize,
   806	    const void* cSrc, size_t cSrcSize,
   807	    const HUF_DTable* DTable)
   808	{
   809	    if (cSrcSize < 10) return ERROR(corruption_detected);   /* strict minimum : jump table + 1 byte per stream */
   810	
   811	    {   const BYTE* const istart = (const BYTE*) cSrc;
   812	        BYTE* const ostart = (BYTE*) dst;
   813	        BYTE* const oend = ostart + dstSize;
   814	        BYTE* const olimit = oend - (sizeof(size_t)-1);
   815	        const void* const dtPtr = DTable+1;
   816	        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
   817	
   818	        /* Init */
   819	        BIT_DStream_t bitD1;
   820	        BIT_DStream_t bitD2;
   821	        BIT_DStream_t bitD3;
   822	        BIT_DStream_t bitD4;
   823	        size_t const length1 = MEM_readLE16(istart);
   824	        size_t const length2 = MEM_readLE16(istart+2);
   825	        size_t const length3 = MEM_readLE16(istart+4);
   826	        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
   827	        const BYTE* const istart1 = istart + 6;  /* jumpTable */
   828	        const BYTE* const istart2 = istart1 + length1;
   829	        const BYTE* const istart3 = istart2 + length2;
   830	        const BYTE* const istart4 = istart3 + length3;
   831	        size_t const segmentSize = (dstSize+3) / 4;
   832	        BYTE* const opStart2 = ostart + segmentSize;
   833	        BYTE* const opStart3 = opStart2 + segmentSize;
   834	        BYTE* const opStart4 = opStart3 + segmentSize;
   835	        BYTE* op1 = ostart;
   836	        BYTE* op2 = opStart2;
   837	        BYTE* op3 = opStart3;
   838	        BYTE* op4 = opStart4;
   839	        U32 endSignal = 1;
   840	        DTableDesc const dtd = HUF_getDTableDesc(DTable);
   841	        U32 const dtLog = dtd.tableLog;
   842	
   843	        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
   844	        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
   845	        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
   846	        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
   847	        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
   848	
   849	        /* 16-32 symbols per loop (4-8 symbols per stream) */
   850	        for ( ; (endSignal) & (op4 < olimit); ) {
   851	#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
   852	            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
   853	            HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
   854	            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
   855	            HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
   856	            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
   857	            HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
   858	            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
   859	            HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
   860	            endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;
   861	            endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;
   862	            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
   863	            HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
   864	            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
   865	            HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
   866	            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
   867	            HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
   868	            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
   869	            HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
   870	            endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;
   871	            endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;
   872	#else
   873	            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
   874	            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
   875	            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
   876	            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
   877	            HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
   878	            HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
   879	            HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
   880	            HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
   881	            HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
   882	            HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
   883	            HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
   884	            HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
   885	            HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
   886	            HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
   887	            HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
   888	            HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
   889	            endSignal = (U32)LIKELY(
 > 890	                        (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
   891	                      & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished)
   892	                      & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished)
   893	                      & (BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished));
   894	#endif
   895	        }
   896	
   897	        /* check corruption */
   898	        if (op1 > opStart2) return ERROR(corruption_detected);
   899	        if (op2 > opStart3) return ERROR(corruption_detected);
   900	        if (op3 > opStart4) return ERROR(corruption_detected);
   901	        /* note : op4 already verified within main loop */
   902	
   903	        /* finish bitStreams one by one */
   904	        HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
   905	        HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
   906	        HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
   907	        HUF_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
   908	
   909	        /* check */
   910	        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
   911	          if (!endCheck) return ERROR(corruption_detected); }
   912	
   913	        /* decoded size */
   914	        return dstSize;
   915	    }
   916	}
   917	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux