linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* linux: master: x86_64: gcc-8: error: call to '__compiletime_assert_909' declared with attribute error: clamp() low limit dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3
@ 2025-01-30  9:31 Naresh Kamboju
  2025-01-30 19:39 ` David Laight
  0 siblings, 1 reply; 2+ messages in thread
From: Naresh Kamboju @ 2025-01-30  9:31 UTC (permalink / raw)
  To: lkft-triage, open list, Linux Regressions, Linux ARM
  Cc: David Laight, Arnd Bergmann, Dan Carpenter, Anders Roxell

The x86_64 and i386 build failed with defconfig with gcc-8 toolchain due to
following build warnings / errors on the Torvalds Linux master branch.
But gcc-13 builds pass.

First seen on v6.13-9485-g72deda0abee6 on Jan. 27, 2025
Good:  v6.13-7644-gc2da8b3f914f on Jan. 27, 2025
Bad:  v6.13-8265-g9c5968db9e62 on Jan. 27, 2025

i386:
  build:
    * gcc-8-i386_defconfig

x86_64:
  build:
    * gcc-8-x86_64_defconfig

Reported-by: Linux Kernel Functional Testing

Build log:
---
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86
CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc'
'HOSTCC=sccache gcc'
In file included from <command-line>:
In function 'intel_dp_dsc_compute_pipe_bpp_limits.isra.80',
    inlined from 'intel_dp_compute_config_limits' at
drivers/gpu/drm/i915/display/intel_dp.c:2547:3:
include/linux/compiler_types.h:542:38: error: call to
'__compiletime_assert_909' declared with attribute error: clamp() low
limit dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
                                      ^
include/linux/compiler_types.h:523:4: note: in definition of macro
'__compiletime_assert'
    prefix ## suffix();    \
    ^~~~~~
include/linux/compiler_types.h:542:2: note: in expansion of macro
'_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
  ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^~~~~~~~~~~~~~~~~~
include/linux/minmax.h:188:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(statically_true(ulo > uhi),    \
  ^~~~~~~~~~~~~~~~
include/linux/minmax.h:195:2: note: in expansion of macro '__clamp_once'
  __clamp_once(type, val, lo, hi, __UNIQUE_ID(v_), __UNIQUE_ID(l_),
__UNIQUE_ID(h_))
  ^~~~~~~~~~~~
include/linux/minmax.h:206:28: note: in expansion of macro '__careful_clamp'
 #define clamp(val, lo, hi) __careful_clamp(__auto_type, val, lo, hi)
                            ^~~~~~~~~~~~~~~
drivers/gpu/drm/i915/display/intel_dp.c:2506:25: note: in expansion of
macro 'clamp'
  limits->pipe.max_bpp = clamp(limits->pipe.max_bpp, dsc_min_bpc * 3,
dsc_max_bpc * 3);
                         ^~~~~
make[7]: *** [scripts/Makefile.build:194:
drivers/gpu/drm/i915/display/intel_dp.o] Error 1


Links:
---
 build log: https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.13-9485-g72deda0abee6/testrun/27066663/suite/build/test/gcc-8-x86_64_defconfig/log
 details: https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.13-9485-g72deda0abee6/testrun/27066663/suite/build/test/gcc-8-x86_64_defconfig/details/
 history: https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.13-9485-g72deda0abee6/testrun/27066663/suite/build/test/gcc-8-x86_64_defconfig/history/

Steps to reproduce:
------------
$ tuxmake --runtime podman --target-arch x86_64 --toolchain gcc-8
--kconfig x86_64_defconfig

metadata:
---
  git describe: v6.13-9485-g72deda0abee6
  git repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  git sha: 72deda0abee6e705ae71a93f69f55e33be5bca5c
  kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2sKEcVft7ytiSSvOSnAuAxlCgRH/config
  build url: https://storage.tuxsuite.com/public/linaro/lkft/builds/2sKEcVft7ytiSSvOSnAuAxlCgRH/
  toolchain: gcc8
  config: gcc-8-defconfig
  arch: i386 and x86_64

--
Linaro LKFT
https://lkft.linaro.org


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: linux: master: x86_64: gcc-8: error: call to '__compiletime_assert_909' declared with attribute error: clamp() low limit dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3
  2025-01-30  9:31 linux: master: x86_64: gcc-8: error: call to '__compiletime_assert_909' declared with attribute error: clamp() low limit dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3 Naresh Kamboju
@ 2025-01-30 19:39 ` David Laight
  0 siblings, 0 replies; 2+ messages in thread
From: David Laight @ 2025-01-30 19:39 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: lkft-triage, open list, Linux Regressions, Linux ARM,
	David Laight, Arnd Bergmann, Dan Carpenter, Anders Roxell,
	Ankit Nautiyal, Suraj Kandpal

On Thu, 30 Jan 2025 15:01:21 +0530
Naresh Kamboju <naresh.kamboju@linaro.org> wrote:

> The x86_64 and i386 build failed with defconfig with gcc-8 toolchain due to
> following build warnings / errors on the Torvalds Linux master branch.
> But gcc-13 builds pass.
> 
> First seen on v6.13-9485-g72deda0abee6 on Jan. 27, 2025
> Good:  v6.13-7644-gc2da8b3f914f on Jan. 27, 2025
> Bad:  v6.13-8265-g9c5968db9e62 on Jan. 27, 2025
> 
> i386:
>   build:
>     * gcc-8-i386_defconfig
> 
> x86_64:
>   build:
>     * gcc-8-x86_64_defconfig
> 
> Reported-by: Linux Kernel Functional Testing
> 
> Build log:
> ---
> make --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86
> CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc'
> 'HOSTCC=sccache gcc'
> In file included from <command-line>:
> In function 'intel_dp_dsc_compute_pipe_bpp_limits.isra.80',
>     inlined from 'intel_dp_compute_config_limits' at
> drivers/gpu/drm/i915/display/intel_dp.c:2547:3:
> include/linux/compiler_types.h:542:38: error: call to
> '__compiletime_assert_909' declared with attribute error: clamp() low
> limit dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3
...
> drivers/gpu/drm/i915/display/intel_dp.c:2506:25: note: in expansion of
> macro 'clamp'
>   limits->pipe.max_bpp = clamp(limits->pipe.max_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3);

The code is:

static void
intel_dp_dsc_compute_pipe_bpp_limits(struct intel_dp *intel_dp,
                                     struct link_config_limits *limits)
{
        struct intel_display *display = to_intel_display(intel_dp);
        int dsc_min_bpc = intel_dp_dsc_min_src_input_bpc();
        int dsc_max_bpc = intel_dp_dsc_max_src_input_bpc(display);
 
        limits->pipe.max_bpp = clamp(limits->pipe.max_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3);
        limits->pipe.min_bpp = clamp(limits->pipe.min_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3);
}

with:

int intel_dp_dsc_min_src_input_bpc(void)
{
        /* Min DSC Input BPC for ICL+ is 8 */
        return 8;
}
     
int intel_dp_dsc_max_src_input_bpc(struct intel_display *display)
{
        /* Max DSC Input BPC for ICL is 10 and for TGL+ is 12 */
        if (DISPLAY_VER(display) >= 12)
                return 12;
        if (DISPLAY_VER(display) == 11)
                return 10;

        return 0;
}

Although the little functions aren't static the compiler can assume that the local
versions will be called and inline them.

It can then move the clamp() code into the conditionals in
intel_dp_dsc_max_src_input_bpc()
It then sees clamp(limit->pipe.max_bpp, 24, 0) and quite rightly complains.

Broken by 160672b86b0dd

	David



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-30 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-30  9:31 linux: master: x86_64: gcc-8: error: call to '__compiletime_assert_909' declared with attribute error: clamp() low limit dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3 Naresh Kamboju
2025-01-30 19:39 ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).