From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753390AbbKWH7m (ORCPT ); Mon, 23 Nov 2015 02:59:42 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:53588 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbbKWH7j (ORCPT ); Mon, 23 Nov 2015 02:59:39 -0500 From: Arnd Bergmann To: Nicolas Pitre Cc: Russell King - ARM Linux , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines Date: Mon, 23 Nov 2015 08:59:34 +0100 Message-ID: <4172767.ihrTf0eWtM@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <4206238.8hPtvbUZ9X@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:o1xc92BH0mMtdGsG6MYaIpo6KFayPSvPtQp8le2jsSNeMEnix7m oWReuY4TsXTTFhe3y8glyDUwFd0t0W2Qbh/pyqyHKUmtE7lsZK8Rmwfm9FZdZmsF7KNeBKx yz6WgGX2RzB2bkPyYY5yaEhXGxQW3FtWnJTS4GC1HpCnnWMTP2JQiMI9iaAlrkYFUeiyJXk pMiCiG0yug6IlWFxdozog== X-UI-Out-Filterresults: notjunk:1;V01:K0:blDx9lqQrt8=:J24vJCgjyrB+mRNv5+B5Nh nRUSsp/FiFP1A5bIuvIpVGG8H4/LBBByoM0G0WJvJSRAyZ45Pt/Bjh3YWfCx+CPaEW4wX/Xyp aIJCtYgpNzIsB1wOaI/r94FQTI/yFSwLyDVFKazKmn3fdNYTf1wPUk2O2JoMXD1iqNGxjq7fg 8LQghUQl7NLcVPVyLPZSvOmNQJVgDn+lyrKL0cBcg8oa+co1v+k9XWAdKYytyMhD5hJp3Omjg kQiUo9Wk9KESPrc6duyTHvcge4bLNuKbpokk6fz1ZxPKLXYiRgK8MVK7poAFgc8pisRNrfXzh OFO4UEyNdGsG6ULdCmwQLKIAqmiScqubYApeJ2HeGEZI05KZHPQwS2LjXByRtcZdMchtO/PPO m7K518clIaJ1ePkebq35SDNqQN930xNX0lvbq1JvjdpdqE18WmBJIpcOVVBYOODTchzkb05AM cH9rH/KLIaHUtyLvt+ECz7K+vHPAfJJq0OjxEA/ckZYrZPu4OaAZ8AISe8uUoxRsLLkhUNzGa CJst36YTxR3ZjOVeYjJFVSjDR5ZUvhpi5L5CQ9nrSsIxHmJmwupx8wuqpdjUrS+n/AOSPgYEa ei+NjWJvjRl3A/sP76SSH4kgHww6KRLFkq73ybLppuqOKvn67Xno9Fj8/mxsVyMu5J6T6xu8k qr2hmKWPXRKUDORsoEqc4Giqb/rpE+aLPAf7396iauC5Rx2Lf0C5pmFvjoTHdpnNOJ4Uta7o3 ixGlVu5O4Gb6HcU9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 22 November 2015 17:28:33 Nicolas Pitre wrote: > On Sun, 22 Nov 2015, Arnd Bergmann wrote: > > On Monday 16 November 2015 20:20:38 you wrote: > > I'm now getting a build regressing with the attached randconfig configuration, > > when compiling drivers/net/wireless/iwlegacy/common.o: > > > > drivers/built-in.o: In function `il_send_rxon_timing': > > :(.text+0xbbac80): undefined reference to `__aeabi_uldivmod' > > :(.text+0xbbac9c): undefined reference to `__aeabi_uldivmod' > > :(.text+0xbbacdc): undefined reference to `__aeabi_uldivmod' > > :(.text+0xbbadc8): undefined reference to `__aeabi_uldivmod' > > :(.text+0xbbadf8): undefined reference to `__aeabi_uldivmod' > > :(.text+0xbbae3c): more undefined references to `__aeabi_uldivmod' follow > > drivers/built-in.o: In function `il_send_rxon_timing': > > :(.text+0xbbb11c): undefined reference to `____ilog2_NaN' > > This looks like some gcc bug from a few years ago. Yes, I clearly remember debugging something in this area before, but I don't remember what we did about it. We already have the workaround for OABI (which you kept), and I have another workaround to disable the optimized function for ARMv3 as well, as newer gcc versions also get that wrong here (internal compiler error IIRC). We could add yet another such workaround for CONFIG_PROFILE_ALL_BRANCHES, but I don't have a good feeling about doing this unless we understand well enough why it breaks. At some point, I did this workaround, which is still in my randconfig tree: --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -144,7 +144,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); */ #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) #define __trace_if(cond) \ - if (__builtin_constant_p((cond)) ? !!(cond) : \ + if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ({ \ int ______r; \ static struct ftrace_branch_data \ However, it doesn't seem related to the problem at hand. I think it was about some false 'maybe uninitialized' warning, but I currently don't see any difference with or without that patch for either issues. > > I've verified that this goes away if I turn off CONFIG_PROFILE_ALL_BRANCHES, > > and it only shows up with gcc-5.0 through gcc-5.2.1, but not 4.9.3. > > > > Aside from those, I have not been able to reduce the failure scenario. > > > > Also, I have only tested on ARM32, no idea if this shows up elsewhere. > > What if you revert "ARM: asm/div64.h: adjust to generic codde" and > recompile? Without that patch, it works again. Arnd