From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1D10C433DF for ; Mon, 19 Oct 2020 09:03:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 604EB22268 for ; Mon, 19 Oct 2020 09:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729966AbgJSJDS (ORCPT ); Mon, 19 Oct 2020 05:03:18 -0400 Received: from gate.crashing.org ([63.228.1.57]:36886 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729751AbgJSJDR (ORCPT ); Mon, 19 Oct 2020 05:03:17 -0400 X-Greylist: delayed 1577 seconds by postgrey-1.27 at vger.kernel.org; Mon, 19 Oct 2020 05:03:16 EDT Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 09J8WSVC005033; Mon, 19 Oct 2020 03:32:28 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 09J8WPVE005032; Mon, 19 Oct 2020 03:32:25 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 19 Oct 2020 03:32:25 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Joel Stanley , Arnd Bergmann , Masahiro Yamada , Andrew Morton , linux-arch@vger.kernel.org, linuxppc-dev , Linux Kernel Mailing List Subject: Re: [PATCH] asm-generic: Force inlining of get_order() to work around gcc10 poor decision Message-ID: <20201019083225.GN2672@gate.crashing.org> References: <96c6172d619c51acc5c1c4884b80785c59af4102.1602949927.git.christophe.leroy@csgroup.eu> <0bd0afae-f043-2811-944b-c94d90e231d2@csgroup.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0bd0afae-f043-2811-944b-c94d90e231d2@csgroup.eu> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Mon, Oct 19, 2020 at 07:50:41AM +0200, Christophe Leroy wrote: > Le 19/10/2020 à 06:55, Joel Stanley a écrit : > >>In the old days, marking a function 'static inline' was forcing > >>GCC to inline, but since commit ac7c3e4ff401 ("compiler: enable > >>CONFIG_OPTIMIZE_INLINING forcibly") GCC may decide to not inline > >>a function. > >> > >>It looks like GCC 10 is taking poor decisions on this. > >1952 bytes smaller with your patch applied. Did you raise this with > >anyone from GCC? > > Yes I did, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97445 > > For the time being, it's at a standstill. The kernel should just use __always_inline if that is what it *wants*; that is true here most likely. GCC could perhaps improve its heuristics so that it no longer thinks these functions are often too big for inlining (they *are* pretty big, but not after basic optimisations with constant integer arguments). Segher