From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 315DD3854804 for ; Wed, 20 Jan 2021 19:44:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 315DD3854804 Received: by mail-wm1-x32f.google.com with SMTP id c128so3888828wme.2 for ; Wed, 20 Jan 2021 11:44:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C6HCMPK5VEQvqo8qoBx8znyu6rQE3Uww2/czPywoRaM=; b=s0udoYCJmwAFa2bzS8fKJtWeNRHm2oxpvIbxqOFh14JnpzJ6fvFxKkzipZ822cPX24 yVP4plqRGXuBwS2BqbGQgOMa5JvrPJZxFDpoIl5caP+lcwMjn+HTgPR9SO8gHa63sXy0 wn06vRcBHZOPH4j+jVZAo7Lkwb+PtzCDO4GnBhhoXxVVlDAEI4B6WltH1aMy0zRPQrZP haI2+hykhQW4t5Ip0O1k1GS0yKMzZfHyHUydnlcqaI+aGaXDmxr9+HrUdrH8WDnpQ28C fxduum34NhukX/N1SiQi3qGf4rtbbR9YlqBy+YIpNe3rTepg9TzGgq966baqy8vblV3t Gq4Q== X-Gm-Message-State: AOAM530Q/hextc04jTmY6PTu006ckxPuk7+s8uixSrsWsK+bHTPka06X b64oZpP6LSAJoQf9PTbxN4CLI+Kn1LGZn27XQLQ= X-Google-Smtp-Source: ABdhPJz4U6+AMUJzuRFBi0z+9WBknvJIBifyovTFwvZrz361MlubRqGSq/9UNuYMukR66M2hOqgaeYWHTPnkr57HJuI= X-Received: by 2002:a1c:bac1:: with SMTP id k184mr5905062wmf.17.1611171862172; Wed, 20 Jan 2021 11:44:22 -0800 (PST) MIME-Version: 1.0 References: <0de29d09-268f-613d-4cf3-338746488c18@mbari.org> <92e88082-da27-2751-551c-096959c99340@foss.arm.com> <68c37787-70eb-11c4-d314-af1181f70d2c@yahoo.com> In-Reply-To: <68c37787-70eb-11c4-d314-af1181f70d2c@yahoo.com> From: Jonathan Wakely Date: Wed, 20 Jan 2021 19:44:11 +0000 Message-ID: Subject: Re: In GCC 10.2, -O2 optimization enables more than docs suggest To: mark_at_yahoo Cc: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2021 19:44:24 -0000 On Wed, 20 Jan 2021 at 19:06, mark_at_yahoo wrote: > > On 1/20/21 10:50 AM, Jonathan Wakely wrote: > > > That's a different situation though. With -O0 **NO** optimization is done, > > at all. Any -f options for optimization passes are ignored entirely. > > > > The difference between -O1 and -O2 is the set of -f flags that differ, and > > some specific checks for >= -O2. But the difference between -O0 and -O1 is > > the difference between zero and non-zero. Completely off, or on. > > > > That's interesting, Jonathan. You know far better than I do, and I > haven't tried it in over a year (on an older version of GCC-ARM), but I > swore the following did do something: It might have done something, but it didn't optimize anything (and so most of those options were ignored). https://gcc.gnu.org/wiki/FAQ#optimization-options