From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 10C603858C20 for ; Thu, 10 Mar 2022 15:32:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 10C603858C20 Received: by mail-wm1-x330.google.com with SMTP id n31-20020a05600c3b9f00b003898fc06f1eso5713019wms.1 for ; Thu, 10 Mar 2022 07:32:37 -0800 (PST) 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; bh=jJ+PtTigtGoPbHq1dAx4M4Xq91fcwLY+C7tFFDedgk0=; b=s5QBJ4QwbApNjC62cn4yxVIQY4ztlhRe9y8NWXxNxiudskjrN/CrEOFnbJJ24D2oQZ YB3uJr0341IR9GbocxfddXLv9Vn13/6evhapF3DiVSoBuXN8vgKfMMzaHSr++cDo0a17 No1ZCoxkNhWUNtOx7NKaI76PtzpLCB8hbBnXBO3rVOJCuOcr1cojuq5MENWyvmybDZrN dLg38GjxgwHNV28kNeKmIEnyoKFyuUWcqUKyoAv19YSNljSe2vYmWKee2akVBQXEutIv oTh2gqsU54jI8v+fKKc6TGffnh9GVuUT3oSyMOvdJUEGEPeGK5papLVYEKycJbJKEPyB nXiA== X-Gm-Message-State: AOAM5337oZAkcoemVhd56CUplZDyh8hiSx3zrvSiXNYPB5U0tI0oY99n /EeN2tTP/WlhsBZtYlbCCr+Sp4RSVrMbId5yZs0= X-Google-Smtp-Source: ABdhPJznKn/LTfSmb7l8U5RXqWiKXhOofIU4y0Ub9JFix7chCsjJauhVkD99o6Fh7IqvMw/cTMf4J/v0MJwEtuKLz+Y= X-Received: by 2002:a05:600c:3483:b0:380:edaf:d479 with SMTP id a3-20020a05600c348300b00380edafd479mr12211225wmq.20.1646926355313; Thu, 10 Mar 2022 07:32:35 -0800 (PST) MIME-Version: 1.0 References: <20220301220821.1732163-1-ppalka@redhat.com> <1de0b889-66e7-8202-5c5e-526b728a36e8@redhat.com> <6b2257e0-cd0f-4771-7c12-1be4dbf88423@idea> In-Reply-To: <6b2257e0-cd0f-4771-7c12-1be4dbf88423@idea> From: Jonathan Wakely Date: Thu, 10 Mar 2022 15:32:21 +0000 Message-ID: Subject: Re: [PATCH] c++: fold calls to std::move/forward [PR96780] To: Patrick Palka Cc: Jason Merrill , gcc-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2022 15:32:41 -0000 On Thu, 10 Mar 2022 at 15:27, Patrick Palka wrote: > Here's a patch that extends the folding to as_const and addressof (as > well as __addressof, which I'm kind of unsure about since it's > non-standard). N.B. libstdc++ almost never uses std::addressof, because that calls std::__addressof, so we just use that directly to avoid the double indirection. I plan to change that in stage 1 and make std::addressof just call the built-in directly, so that it won't have the extra overhead. If they both get folded that wouldn't matter so much (it would still be useful for Clang, and would presumably make GCC compile ever so slightly faster).