Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1451585pxy; Sat, 1 May 2021 14:14:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTfF7RgHpWhSbabGydJToaILkD3kq0AQRgxa3bGSSCiVoP5jiOiVrlv+y3scd4kX7Pb/uI X-Received: by 2002:a17:906:430f:: with SMTP id j15mr10159170ejm.543.1619903668996; Sat, 01 May 2021 14:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619903668; cv=none; d=google.com; s=arc-20160816; b=TR10rAEmwz8jjJwcI5UcX9peK/2Azr0GzzwBOmBaBq8EbKBMzGof9jALtzU8GEXyq2 ezsL8I+mxr8Glm4VS+9ihKE26Mj7ldwft1Wb/Yia3VQGlZkCLohQzMfctu23RS/EMWIN kdmZgO+7vi4Jxs5J0QbcwvZPkGh9ultA5+HyMZ5bd2jl16z/02uw1JCOYUzlQ7KIwo5v wkkqyuGlJxfYR+osvcbf6hI+EepdKNzwm2I3+68+PgtRPyczKBPiAj6sE4lAoV8JvO76 MqLZUdAY6IGP2OReaQ9auOWWm2ht0MjKXyzfJDO2mx0GVi/vhJFzo1FSHCGBWeUCRT4o VUzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AcbSLwuICr6Udix8ctgEOYjRfptG+tEIQT5YVV6bUi8=; b=psAKGHKpfFbRzPa4Vc27IKQBtzp4KgNSCPKS2eqV8NkNRkDSC9349cXHOUoCEKqUQL SpNOk0iN9W/q4CBvJf5JJX1ynys97qRdwsi/U9ST3nKL5rfplrT3riHa7lIrzP3dy2QO X1pdU/SQJsq8/YtgJohYaX3VFsJLJlUdDD9AH6NP6Xuwu2GFfWzconsYlgNtOmR/iV2j k/S79To+gNZuuFQNN3cIZ0wFqQS+mb1E40nfXebeQ2rILPfrM5Sq7f3JeztauFenMglN p1/6plU5a5m3ug6dRqKbmvXNDphGfgep+lnG7i6O0Tokk5EVuqrgaFa7G0T5+tN13Vbb aZmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=R+qKBo8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz21si6821187ejb.239.2021.05.01.14.13.17; Sat, 01 May 2021 14:14:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=R+qKBo8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231782AbhEAVEf (ORCPT + 99 others); Sat, 1 May 2021 17:04:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231547AbhEAVEe (ORCPT ); Sat, 1 May 2021 17:04:34 -0400 Received: from vulcan.natalenko.name (vulcan.natalenko.name [IPv6:2001:19f0:6c00:8846:5400:ff:fe0c:dfa0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C88DC06174A for ; Sat, 1 May 2021 14:03:43 -0700 (PDT) Received: from localhost (unknown [151.237.229.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id 8DC33A5DF54; Sat, 1 May 2021 23:03:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1619903018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AcbSLwuICr6Udix8ctgEOYjRfptG+tEIQT5YVV6bUi8=; b=R+qKBo8+Odi+ppTFSIOpPGb8VaxfcVkkhTqC4TE0dsGVraIuFto8vUJM1p3s+WYkrA1JIQ 7I+tt3lWzHq7mfTV52Y+RB0MgE/jVJ8gZ4PAwDEKxqqFxLQB7xWu8GS1SdkOOEWwj8w1M9 52Rggvh2enI1e83tRL9WDcbTEGAikkg= Date: Sat, 1 May 2021 23:03:37 +0200 From: Oleksandr Natalenko To: Linus Torvalds Cc: Vineet Gupta , Arnd Bergmann , Peter Zijlstra , Masahiro Yamada , Jann Horn , lkml , arcml , "linux-arch@vger.kernel.org" Subject: Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3 Message-ID: <20210501210337.66qxgomc643lbdyi@spock.localdomain> References: <75d07691-1e4f-741f-9852-38c0b4f520bc@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On Fri, Apr 30, 2021 at 03:06:30PM -0700, Linus Torvalds wrote: > On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta wrote: > > > > I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 > > causing wrong codegen. > > I'd be more than happy to just disable CC_OPTIMIZE_FOR_PERFORMANCE_O3 entirely. FWIW, we used to find real bugs using -O3 in the past [1]. > The advantages are very questionable - with a lot of the optimizations > at O3 being about loops, something which the kernel to a close > approximation doesn't have. > > Most kernel loops are "count on one hand" iterations, and loop > optimizations generally just make things worse. > > And we've had problems with -O3 before, because not only are the > optimizations a bit esoteric, they are often relatively untested. If > you look around at various projects (outside the kernel), -O2 is > generally the "default". > > And that's entirely ignoring the gcc history - where -O3 has often > been very buggy indeed. It's gotten much better, but I just don't see > the upside of using -O3. > > In fact, it looks like we already have that > > depends on ARC > > for -O3, exactly because nobody really wants to use this. > > So this bug seems to be entirely ARC-specific, in that only ARC can > use -O3 for the kernel already. > > Linus [1] https://lore.kernel.org/lkml/673b885183fb64f1cbb3ed2387524077@natalenko.name/ -- Oleksandr Natalenko (post-factum)