From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id B996A3857428 for ; Tue, 17 May 2022 08:31:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B996A3857428 Received: by mail-wr1-x42c.google.com with SMTP id j25so22654685wrc.9 for ; Tue, 17 May 2022 01:31:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=daS+RwcYcnM8kVo6ybHRk1KpnBBsup/YpuxRewNP8jY=; b=1aYOzO3v6j/GyGf/6qrqwvCd7xCu+GNm3haFmf/vr5EWswRrB33gR9chbHsJKQdE6t Ancje7telviDhPj2/GUcmn6riogHtAxTP9alo+xItzsMevF4t0dC0f0LNVX0YgnSf9cl Umz9PLEtrUW+xLZnov25lqMsTFMsMSyZAsdN5voA2VKCmFIAhV8CIz8DY4yj+bmvULb1 q0FWM7s26rt8yxp3TTkRDD1CpCThBO3LlalJAcuizrl0l+dT70b7xAIF4oJ/dMndzxcX QsbVOKamL7L5a8ztJUIugquNugjUTRVjXLnTl9A3cRPTDaV+dJ/86Nj5KSNXdT25bxWP 2UXQ== X-Gm-Message-State: AOAM532I1spdllbFleX71nTbq6sz9M7WVtC1mFe5TfOWG7bYfzMaIhQi yY6bkzOtX3bKC3Jrc4U6TSG2QCC8ypJIgKfpPTk= X-Google-Smtp-Source: ABdhPJwFpZ2ZfbpgMD3fYtubkrrnBSsOcfeKEX6aIrjW3i8h7JTUCyInlAf/oIoTneZLpVxBleVTQYyyeYDYkjwEu9A= X-Received: by 2002:adf:e28e:0:b0:20c:fdbf:b136 with SMTP id v14-20020adfe28e000000b0020cfdbfb136mr11778001wri.544.1652776267585; Tue, 17 May 2022 01:31:07 -0700 (PDT) MIME-Version: 1.0 References: <062812e4-e912-4eaf-876c-91006a6c47a6@gmx.net> In-Reply-To: <062812e4-e912-4eaf-876c-91006a6c47a6@gmx.net> From: Jonathan Wakely Date: Tue, 17 May 2022 09:30:56 +0100 Message-ID: Subject: Re: gcc optimization options and lto (detailed info) To: "muzungu@gmx.net" Cc: gcc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Tue, 17 May 2022 08:31:10 -0000 On Tue, 17 May 2022 at 07:57, muzungu--- via Gcc-help wrote: > * does every -f have a -fno-? Nearly all, yes: "Many options have long names starting with -f or with -W --- for example, -fmove-loop-invariants, -Wformat and so on. Most of these have both positive and negative forms; the negative form of -ffoo is -fno-foo. This manual documents only one of these two forms, whichever one is not the default." > * would I be able able to disable single optimizations activated via -O using -fno- after -O? Yes. > * When LTO is enabled, are the optimizations only effective at link time = and not during the compilation into IR (GIMPLE)? Both. > * Or are the optimizations effective in different stages of the build pro= cess? Are there information which options is applied when? If a particular optimization is only effective before/during LTO I think that will be mentioned in the manual. If it isn't mentioned, assume it is effective at both times. > Are there information available what the different optimizations do (whic= h I know, is a long list) and how such unwanted optimization can be avoided= respective the unwanted effects of the optimizations No, it would be an entire book, and rapidly be outdated. All the available documentation is already in the GCC manual. Of course the source code is the ultimate guide, but it's not clear to follow unless you already know how GCC works. > * Since there is a rather long list of optimization options which would v= ery likely exceed the command line length, what is the solution to activate= a custom set of optimzations? I could not find a --configfile option or si= milar to replace the command line. See the @file option. But if you need so many options that you exceed the command-line limits, maybe you're doing something wrong. That would be unusual.