Skip to contentSkip to conversation

include/vdso/math64.h:14:3: error: implicit declaration of function 'OPTIMIZER_HIDE_VAR'

PATCH kernel test robot 1 participant 1 message Sep 30

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/vdso
head:   ca46a07c4b68246c4e400ce3649ab7228a878d8f
commit: 37db375ad90467d7e3ce4e450b3d1c4f297d4ed3 [1/4] vdso/math64: Use OPTIMIZER_HIDE_VAR() in __iter_div_u64_rem()
config: m68k-randconfig-r2307-20260930 (https://download.01.org/0day-ci/archive/20260930/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 10.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260930/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from include/linux/math64.h:8,
from include/linux/time.h:6, from include/linux/stat.h:19, from kernel/ucount.c:3:
include/vdso/math64.h: In function '__iter_div_u64_rem':

>> include/vdso/math64.h:14:3: error: implicit declaration of function 'OPTIMIZER_HIDE_VAR' [-Werror=implicit-function-declaration]
      14 |   OPTIMIZER_HIDE_VAR(dividend);
         |   ^~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/OPTIMIZER_HIDE_VAR +14 include/vdso/math64.h

     4	
     5	static __always_inline u32 __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
     6	{
     7		u32 ret = 0;
     8	
     9		while (dividend >= divisor) {
    10			/*
    11			 * Prevent the compiler from optimising this loop into a
    12			 * modulo operation.
    13			 */
  > 14			OPTIMIZER_HIDE_VAR(dividend);
    15	
    16			dividend -= divisor;
    17			ret++;
    18		}
    19	
    20		*remainder = dividend;
    21	
    22		return ret;
    23	}
    24	

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