All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Yury Norov <yury.norov@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Douglas Anderson <dianders@chromium.org>,
	Kees Cook <keescook@chromium.org>, Petr Mladek <pmladek@suse.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Marco Elver <elver@google.com>
Subject: Re: [PATCH v2] lib: test_bitops: add compile-time optimization/evaluations assertions
Date: Wed, 6 Dec 2023 21:27:39 +0800	[thread overview]
Message-ID: <202312062158.60c1e6yt-lkp@intel.com> (raw)
In-Reply-To: <20231130102717.1297492-1-mailhol.vincent@wanadoo.fr>

Hi Vincent,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.7-rc4 next-20231206]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/lib-test_bitops-add-compile-time-optimization-evaluations-assertions/20231130-182837
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20231130102717.1297492-1-mailhol.vincent%40wanadoo.fr
patch subject: [PATCH v2] lib: test_bitops: add compile-time optimization/evaluations assertions
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20231206/202312062158.60c1e6yt-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231206/202312062158.60c1e6yt-lkp@intel.com/reproduce)

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/202312062158.60c1e6yt-lkp@intel.com/

All errors (new ones prefixed by >>):

>> lib/test_bitops.c:74:2: error: call to '__compiletime_assert_178' declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(__test_expr)
      74 |         test_const_eval(__ffs(BIT(n)) == n);
         |         ^
   lib/test_bitops.c:59:2: note: expanded from macro 'test_const_eval'
      59 |         BUILD_BUG_ON(!__builtin_constant_p(__test_expr));       \
         |         ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
      50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
         |         ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:423:2: note: expanded from macro '_compiletime_assert'
     423 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:416:4: note: expanded from macro '__compiletime_assert'
     416 |                         prefix ## suffix();                             \
         |                         ^
   <scratch space>:18:1: note: expanded from here
      18 | __compiletime_assert_178
         | ^
   1 error generated.


vim +74 lib/test_bitops.c

    62	
    63	static void test_bitops_const_eval(void)
    64	{
    65		/*
    66		 * On any supported optimization level (-O2, -Os) and if
    67		 * invoked with a compile-time constant argument, the compiler
    68		 * must be able to fold into a constant expression all the bit
    69		 * find functions. Namely: __ffs(), ffs(), ffz(), __fls(),
    70		 * fls() and fls64(). Otherwise, trigger a build bug.
    71		 */
    72		const int n = 10;
    73	
  > 74		test_const_eval(__ffs(BIT(n)) == n);
    75		test_const_eval(ffs(BIT(n)) == n + 1);
    76		test_const_eval(ffz(~BIT(n)) == n);
    77		test_const_eval(__fls(BIT(n)) == n);
    78		test_const_eval(fls(BIT(n)) == n + 1);
    79		test_const_eval(fls64(BIT_ULL(n)) == n + 1);
    80	}
    81	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2023-12-06 13:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  8:13 [RFC PATCH] lib: test_bitops: add compile-time optimization/evaluations assertions Vincent Mailhol
2023-11-30 10:27 ` [PATCH v2] " Vincent Mailhol
2023-11-30 16:25   ` kernel test robot
2023-12-06 13:27   ` kernel test robot [this message]
2023-12-17  7:12 ` [PATCH v3 0/5] bitops: optimize code and add tests Vincent Mailhol
2023-12-17  7:12   ` [PATCH v3 1/5] m68k/bitops: force inlining of all bitops functions Vincent Mailhol
2024-01-02 10:28     ` Geert Uytterhoeven
2024-01-07 12:01       ` Vincent MAILHOL
2023-12-17  7:12   ` [PATCH v3 2/5] m68k/bitops: use __builtin_{clz,ctzl,ffs} to evaluate constant expressions Vincent Mailhol
2024-01-02 10:49     ` Geert Uytterhoeven
2023-12-17  7:12   ` [PATCH v3 3/5] hexagon/bitops: force inlining of all bitops functions Vincent Mailhol
2023-12-17  7:12   ` [PATCH v3 4/5] hexagon/bitops: use __builtin_{clz,ctzl,ffs} to evaluate constant expressions Vincent Mailhol
2023-12-17  7:12   ` [PATCH v3 5/5] lib: test_bitops: add compile-time optimization/evaluations assertions Vincent Mailhol
2024-01-28  5:00 ` [PATCH v4 0/5] bitops: optimize code and add tests Vincent Mailhol
2024-01-28  5:00   ` [PATCH v4 1/5] m68k/bitops: force inlining of all bit-find functions Vincent Mailhol
2024-01-28  5:00   ` [PATCH v4 2/5] m68k/bitops: use __builtin_{clz,ctzl,ffs} to evaluate constant expressions Vincent Mailhol
2024-01-28  5:39     ` Finn Thain
2024-01-28  6:26       ` Vincent MAILHOL
2024-01-28 12:16         ` David Laight
2024-01-28 13:27           ` Vincent MAILHOL
2024-01-28 19:01             ` David Laight
2024-01-28 22:34             ` Finn Thain
2024-02-04 13:56               ` Vincent MAILHOL
2024-02-04 23:13                 ` Finn Thain
2024-02-05  9:17                   ` Vincent MAILHOL
2024-02-05  9:48                     ` Finn Thain
2024-02-05 10:43                       ` Vincent MAILHOL
2024-02-05 15:40                         ` [PATCH] m68k/bitops: always use compiler's builtin for bit finding functions Vincent Mailhol
2024-02-07  6:31                         ` [PATCH v4 2/5] m68k/bitops: use __builtin_{clz,ctzl,ffs} to evaluate constant expressions Finn Thain
2024-01-28  5:00   ` [PATCH v4 3/5] hexagon/bitops: force inlining of all bit-find functions Vincent Mailhol
2024-01-28  5:00   ` [PATCH v4 4/5] hexagon/bitops: use __builtin_{clz,ctzl,ffs} to evaluate constant expressions Vincent Mailhol
2024-01-28  5:00   ` [PATCH v4 5/5] lib: test_bitops: add compile-time optimization/evaluations assertions Vincent Mailhol

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=202312062158.60c1e6yt-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dianders@chromium.org \
    --cc=elver@google.com \
    --cc=geert+renesas@glider.be \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=ndesaulniers@google.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pmladek@suse.com \
    --cc=rdunlap@infradead.org \
    --cc=yury.norov@gmail.com \
    --cc=zhaoyang.huang@unisoc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.