LKML Archive on
help / color / mirror / Atom feed
From: Nick Desaulniers <>
	Rasmus Villemoes <>,, Arnd Bergmann <>,
	Nathan Chancellor <>
Subject: Re: linux-next: build failure while building Linus' tree
Date: Fri, 10 Sep 2021 15:02:14 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Sep 9, 2021 at 3:50 PM Nick Desaulniers <> wrote:
> + Rasmus
> This was introduced in
> commit f0907827a8a91 ("compiler.h: enable builtin overflow checkers and add
> fallback code")
> which added division using the `/` operator, which is problematic when checking
> for overflows of 64b operands on 32b targets.
> We'll probably need helpers from linux/math64.h and some combination of
> __builtin_choose_expr/__builtin_types_compatible_p.
> That will help us fix another compiler bug for older clang releases, too.

Ok, I have something hacked up that I think will work:
This incomplete diff is a little hacked up to reproduce the issue with
a known-bad revision of clang that demonstrates a similar issue to GCC
4.9.  You can ignore the movement of check_mul_overflow and friends in

I think I'm going to break that up into 2 or 3 patches:
1. move is_signed_type from include/linux/overflow.h to perhaps
2. add div64_x64, div_x64, and div_64 to include/linux/math64.h, use
them in include/linux/overflow.h to fix GCC 4.9
3. move multiply fallbacks out of
~Nick Desaulniers

  reply	other threads:[~2021-09-10 22:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  8:25 linux-next: build failure while building Linus' tree Stephen Rothwell
2021-09-09 22:50 ` Nick Desaulniers
2021-09-10 22:02   ` Nick Desaulniers [this message]
2021-09-10 22:17     ` Nick Desaulniers
2021-09-10 22:26       ` Nick Desaulniers
2021-09-10 22:34         ` Nick Desaulniers

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).