From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id AFE053858D38 for ; Thu, 17 Aug 2023 07:55:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFE053858D38 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-x236.google.com with SMTP id 38308e7fff4ca-2b95d5ee18dso112057771fa.1 for ; Thu, 17 Aug 2023 00:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692258940; x=1692863740; 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=sWM25WGSVzEQ3ZvsvtDLLXb+/c0kWjaEs6OwtYAXW7g=; b=F4q1glXEBVNQYkh+rqydDkHplHn6Rp0/ptUJVGOgFRVyybxjIdWazR9iNGIdY7GcB3 KvhwRXhrAzms1ozlMhHvjc106eyM66MmVPx6+gwEWzzo3ikjCVXIynMiGpJ/lOxgAdye DmbkwEc+0F3MAe7T96eduNVou2y6IBAI73nAEPiFuUFaraXcfxe39A0x0VLBLQRRqlBI FCvLDaS5DugpzIoARcSayC71UkAP9D1neTAsY8NGDCE+vXoM83tvsWY7d3G5xw60hnyt 8iqs45e8qO2Hhhw9M8ngfy+Q5jE/ZAd8Ggin4tS4pcMVjeAUgHTlSSLkJUuAyy3tFs/Z 7F8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692258940; x=1692863740; 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=sWM25WGSVzEQ3ZvsvtDLLXb+/c0kWjaEs6OwtYAXW7g=; b=J+ZP1harsXNwdzGjY+mWB11RMvjMSVjkdliW1baKNzz+Msyl41w1WlttslSbizS96U dQkffISUW75KMYvWCtZGXDK5DOTPXpQeZUxm3RUf3CiHzB59UVgXtKVTWvILG0WNVUI1 8iG9/0tAesQUQw8PcsKdoETagrELlq9LNgNThb+gQ2h1gUWw09phxCUJ4wsITM7c3kud C/P/bbZT//H/vKdaE+t6KoCiQw4YVeVPvU8CpoIA3qAD+x+llbTilVuOUOz8Z7c3hjWC iBmYOiqjulhVJJCaMaO85urw5N1aR8q4kLYVEGkVT3/gYdFGU7i6ieG7IVhdSMG4x5lC kGRA== X-Gm-Message-State: AOJu0YwYQ8JOAMy2fNCxG6b8yvBrb1zvZD+anG6P+UpRYcLJFoK5a3rO G+CU+AXjU8/BRIzFz1XTyb8nlaCsMlwtkMHmuNg= X-Google-Smtp-Source: AGHT+IFOKNfAVeM7y8w2eq1T58GSqkMkzwsgKGsnZxtZgnnJvgT0OngeNBqrLq0Kb7FEvh7XdND/vsYG8N4X9YOMCB4= X-Received: by 2002:a2e:700f:0:b0:2b6:a057:8098 with SMTP id l15-20020a2e700f000000b002b6a0578098mr3237949ljc.0.1692258939738; Thu, 17 Aug 2023 00:55:39 -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: Thu, 17 Aug 2023 09:54:19 +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.7 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 Wed, Aug 16, 2023 at 12:48=E2=80=AFAM Bradley Lucier = wrote: > > First, if this is no longer the appropriate group for this discussion, > please tell me where to send it. > > I've been working to understand all the comments here. From them, I thin= k: > > 1. It's OK to have gcc report back to the user whether each particular > call in tail position is optimized when -foptimize-sibling-calls is set > as a compiler option; or, to report only those calls that have not been > optimized. > > 2. Given (1), the question is what form that information should take, > and which gcc option should cause it to be expressed. > > From comments in this thread and the documentation for today's mainline > gcc, I configured and built Gambit Scheme with > > ./configure CC=3D"/pkgs/gcc-mainline/bin/gcc -fopt-info-missed" > --enable-single-host > > thinking that info about missed optimizations would be a good place to > export information about non-optimized sibling calls. > > This may not have been a good idea, however, as I ended up with 93367 > lines about missed optimizations. > > Is this the right direction to proceed in? The documentation says about > -fopt-info-missed > > One or more of the following option keywords can be used to > describe a group of optimizations: > > 'ipa' > Enable dumps from all interprocedural optimizations. > 'loop' > Enable dumps from all loop optimizations. > 'inline' > Enable dumps from all inlining optimizations. > 'omp' > Enable dumps from all OMP (Offloading and Multi Processing) > optimizations. > 'vec' > Enable dumps from all vectorization optimizations. > 'optall' > Enable dumps from all optimizations. This is a superset of > the optimization groups listed above. > > I'd like to limit the number of missed optimization warnings, but I > don't know where sibling call optimization would fit into these categorie= s. I think it needs a new category, 'inline' is probably the "closest" existin= g one but that also tends to be noisy. Maybe 'call' would be a good name? We co= uld report things like tail-recursion optimization, tail-calling and sibling ca= lling optimizations there, possibly also return/argument copy elision. Richard. > > Brad