From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 2E3483858288 for ; Mon, 21 Aug 2023 07:48:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E3483858288 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2bba6fc4339so47583171fa.2 for ; Mon, 21 Aug 2023 00:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692604131; x=1693208931; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PtV2qsh1jOWVd5jtGDTA6vYKtQj3U0NaR++8/guYQJg=; b=H1vW88jaVU6e12uaFg+Skyy01MkfcOA+4cSwIXUaqwqExRa05/f5ILj0qgSXurJQLD TN8XeFoC71dybxSqawDInBBAOysOCR4yjYjiUT1iqbBAP5+s7k4LhDjES8/qijARx6V0 EB9q0I2hXiKooBHkMsjBHrU7czdmmgMeOtGXQb4c17+rIQhJ3dQNZIDzPd3fXvhJbIYI Cgxb9JBPMSvHMV7URifRhDlumx2aoQsZamjRT+nTfQ43HqQUPnfwxQ4mnUo+D44MSaVC BTb992dEwOe8cIEO5QgUey8Zy4Gfo80/YEqGQD4ZhmLEpXvYPOIfirR0Si32n+/rMY35 W9iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692604131; x=1693208931; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PtV2qsh1jOWVd5jtGDTA6vYKtQj3U0NaR++8/guYQJg=; b=ePkjHTquP2f8zDUqb7k/1PzHCFT3jTvJjk+1uNoMBfdAlGRfgPzUxJYKqh93RO9M6t jPwQEZtc0nH8NDK2GDYfvnpJAAEQe7HwnI20lpjYYj1AfnnOjS4OzYLhEYeMsLZDGq9N zkRWrvam1Hdonk5I7SsbNBectyJC2tyZx0QjkW4xM6lNyrEOH50Fh+GntZPrUebV0tJ6 0D0JhKYRkGJ/cJlV5CCyBaztRgRler1IkMJqtA6Lx0PwyxEzQ3HXk0beZHLHSVFL4u/N YcE+0X+uEBdWRbBApqZd6FvT80DxfojWHyJOeXR3cQEcXvDREH0b/LAIxanB+ZifdG6M 26BA== X-Gm-Message-State: AOJu0Yz0R7QyAgqyRZEb/t4YselaHOA3jqYT+9UgZWujEPFuFqN91s+k rI8khi1N1oLtDtP45wxuqFi3jPH+UWHkkwCHQE8= X-Google-Smtp-Source: AGHT+IEbABjxGJ/tixDJt1Gbrw5nKhucJhFbad04kBqGYAiAZIrssoyn9zugLjXPFiGp/m4rThn+ZBtoTYAU3yueRp4= X-Received: by 2002:a2e:6818:0:b0:2b6:e159:2c3e with SMTP id c24-20020a2e6818000000b002b6e1592c3emr3827781lja.33.1692604130398; Mon, 21 Aug 2023 00:48:50 -0700 (PDT) MIME-Version: 1.0 References: <07d4723b-d449-ccd1-d3cb-c7ee80bb97a0@purdue.edu> <767a986316b6c934c29af5070cdd5dd4d3ba81e6.camel@redhat.com> <39c17c5a5d2136906e71d089407adcbb536a63d2.camel@redhat.com> In-Reply-To: From: Richard Biener Date: Mon, 21 Aug 2023 09:47:23 +0200 Message-ID: Subject: Re: [PATCH] Add -Wdisabled-optimization warning for not optimizing sibling calls To: Bradley Lucier Cc: David Malcolm , Prathamesh Kulkarni , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.6 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Aug 18, 2023 at 7:13=E2=80=AFPM Bradley Lucier = wrote: > > On 8/17/23 3:54 AM, Richard Biener wrote: > > I think it needs a new category, 'inline' is probably the "closest" exi= sting one > > but that also tends to be noisy. Maybe 'call' would be a good name? W= e could > > report things like tail-recursion optimization, tail-calling and siblin= g calling > > optimizations there, possibly also return/argument copy elision. > > OK, thanks. > > I have two questions: > > 1. Is the information dumped by -fopt-info intended for compiler > developers, to see something of the internal logic of gcc, or for end use= rs? -fopt-info is for the user. Note when you dump -all instead of -missed or -optimized you will get a lot of extra and eventually less useful things. Basically -fopt-info splices out info from passes that's both useful to users and als= o things that are mostly interesting to compiler developers (that's -all). > 2. You say that "'inline' ... tends to be noisy". Most of the output I > see from -fopt-info-missed is basically > > _io.c:103829:4: missed: not inlinable: ___H___io/396 -> > __builtin_expect/2486, function body not available > > Is ___builtin_expect truly a function whose body is not available, or > should -fopt-info-missed not report these instances? Yeah, that looks like a mis-classification to me. It's using the assigned CIF code (cif-code.def), and yes, we don't have a function body for __builtin_expect but that's not the reason we should present to users. Instead of MSG_MISSED_OPTIMIZATION for these class of callees we should use MSG_NOTE. At least to me a missed optimization should point out places we would eventually expect to be optimized either by providing enough of the constraints required in the source or by fixing a missed optimization capability in the compiler. Richard. > Brad