public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: kernel test robot <lkp@intel.com>
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>,
	llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, Yury Norov <yury.norov@gmail.com>
Subject: Re: lib/test_bitmap.c:920:2: error: call to '__compiletime_assert_239' declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(res)
Date: Thu, 15 Jun 2023 14:22:45 +0300	[thread overview]
Message-ID: <ZIr0hZV/jcpZkRq2@smile.fi.intel.com> (raw)
In-Reply-To: <202306151433.QKcn7ZNn-lkp@intel.com>

On Thu, Jun 15, 2023 at 02:32:02PM +0800, kernel test robot wrote:
> Hi Alexander,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   b6dad5178ceaf23f369c3711062ce1f2afc33644
> commit: dc34d5036692c614eef23c1130ee42a201c316bf lib: test_bitmap: add compile-time optimization/evaluations assertions
> date:   12 months ago
> config: arm64-randconfig-r025-20230615 (https://download.01.org/0day-ci/archive/20230615/202306151433.QKcn7ZNn-lkp@intel.com/config)
> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> reproduce (this is a W=1 build):
>         mkdir -p ~/bin
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install arm64 cross compiling tool for clang build
>         # apt-get install binutils-aarch64-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc34d5036692c614eef23c1130ee42a201c316bf
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout dc34d5036692c614eef23c1130ee42a201c316bf
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash lib/
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202306151433.QKcn7ZNn-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):

>    888		/*
>    889		 * Equals to `unsigned long bitmap[1] = { GENMASK(6, 5), }`.
>    890		 * Clang on s390 optimizes bitops at compile-time as intended, but at
>    891		 * the same time stops treating @bitmap and @bitopvar as compile-time
>    892		 * constants after regular test_bit() is executed, thus triggering the
>    893		 * build bugs below. So, call const_test_bit() there directly until
>    894		 * the compiler is fixed.
>    895		 */
>    896		bitmap_clear(bitmap, 0, BITS_PER_LONG);
>    897	#if defined(__s390__) && defined(__clang__)
>    898		if (!const_test_bit(7, bitmap))
>    899	#else
>    900		if (!test_bit(7, bitmap))
>    901	#endif

Hmm... Reveals the bug in clang/arm64?

>    919		res = !test_bit(18, &bitopvar);
>  > 920		BUILD_BUG_ON(!__builtin_constant_p(res));
>    921		BUILD_BUG_ON(!res);


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-06-15 11:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  6:32 lib/test_bitmap.c:920:2: error: call to '__compiletime_assert_239' declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(res) kernel test robot
2023-06-15 11:22 ` Andy Shevchenko [this message]
2023-06-15 19:52   ` Nick Desaulniers
2023-06-15 20:48     ` Nick Desaulniers
2023-06-16 14:03       ` Alexander Lobakin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZIr0hZV/jcpZkRq2@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox