From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id C6CF3384F00C; Sun, 13 Nov 2022 19:39:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C6CF3384F00C 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-ed1-x52c.google.com with SMTP id z18so14449814edb.9; Sun, 13 Nov 2022 11:39:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=THOX2DyYjh2l5jcEGl5G40737SytxGZTO+kdl6AL61s=; b=pxkcELQe1F6LtJV20Fd+kx4nlDvSKDz+R8GPOMmWOwScpQy7iGYUGA+m40q2rnDJ3i RK3DoeJ7lk+Bi+9Ti7TvSJczk/5LcCy2a18edngc//mAVKUKRhgmiYX83lkDScBgCFyW e+oJM3GzsvaKMCDFbQS0bkTgyKHmPhpwUFda+BKrLLcqDiLFeHqL/aon1Ywgf9NEMseb Jl4SyOgMzKIr3C/kReCy133TOkqTWBSmLF8Ha+CRlYsZmoW2bImJFQHsM407AtcXA8AB 7EKofPJO+ZZ3inb1bDSJNIebCdh740FWK5Ygtk6exNb83mItxNkF7NzbZzc4QYOAT4+e FWDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=THOX2DyYjh2l5jcEGl5G40737SytxGZTO+kdl6AL61s=; b=xD5l1jfVpXnZ7Uwq4UZVoYS7pGXOzGIdYqCpctf/TDkSjTmmdHNEfgCJqlm5vKxPi3 pITgdVcCdtiIRrb1yk3uI77r3/kL9aC7ErdnzyWhkDeiGeML5QdlnowRHZLHfIuSxKVF s13U8XhrnAZqJ1P/9MgxqMTwp8uAdgp6bj6PyHl8GoX7FZGDKfauuw7fSpvdnbHwxW6b SIoefs+oJefeZhpCYK5YcQulr8eZjAOlOT9bYc82YrEICmjnw1jHuPrZKSDToTSHehJa +AsBG7/hMdhz/R05w3jD4V80jBKSNm+xjTWRoq4lyvuTes3+KPuSbaes3yjRaKxwzA1v k8og== X-Gm-Message-State: ANoB5pmTizKZQV7KDiryM7Jorl0KctmcnQvSCD/VhHFtC1f7PAvVlPIO EonXEYPQ/7KT9yYNVdvMgUaAqCEPGs7Teccos0I= X-Google-Smtp-Source: AA0mqf7QT71MKbX7DVat2iurdKQVkfO5KmEgACS7gELdkr6QlkW0LNmvacy4Ck3f+d71AfuEpZM07LJ78dtd6qqYZ4w= X-Received: by 2002:aa7:d4d3:0:b0:45f:b80f:1fe8 with SMTP id t19-20020aa7d4d3000000b0045fb80f1fe8mr8577384edr.118.1668368344568; Sun, 13 Nov 2022 11:39:04 -0800 (PST) MIME-Version: 1.0 References: <20221111053043.563832-1-jwakely@redhat.com> <57ee8a3e-c7b4-54ee-9274-21e387a48037@redhat.com> In-Reply-To: <57ee8a3e-c7b4-54ee-9274-21e387a48037@redhat.com> From: Jonathan Wakely Date: Sun, 13 Nov 2022 19:38:51 +0000 Message-ID: Subject: Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755] To: Stephan Bergmann Cc: Jonathan Wakely , "libstdc++" , gcc-patches Content-Type: multipart/alternative; boundary="0000000000008857db05ed5f4664" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,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: --0000000000008857db05ed5f4664 Content-Type: text/plain; charset="UTF-8" On Sun, 13 Nov 2022, 19:23 Stephan Bergmann via Libstdc++, < libstdc++@gcc.gnu.org> wrote: > On 11/12/22 03:47, Jonathan Wakely wrote: > > On Fri, 11 Nov 2022 at 21:00, Stephan Bergmann > wrote: > >> > >> On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote: > >>> As discussed in the PR, this makes it three times faster to construct > >>> iostreams objects. > >>> > >>> Tested x86_64-linux. Pushed to trunk. > >> > >> I haven't yet tried to track down what's going on, but with various > >> versions of Clang (e.g. clang-15.0.4-1.fc37.x86_64): > >> > >>> $ cat test.cc > >>> #include > >>> int main(int, char ** argv) { > >>> std::regex_traits().transform(argv[0], argv[0] + 1); > >>> } > >> > >>> $ clang++ --gcc-toolchain=... -fsanitize=undefined -O2 test.cc > >>> /usr/bin/ld: /tmp/test-c112b1.o: in function > `std::__cxx11::basic_string, > std::allocator > > std::__cxx11::regex_traits::transform(char*, char*) const': > >>> > test.cc:(.text._ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_[_ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_]+0x1b): > undefined reference to `std::__cxx11::collate const* > std::__try_use_facet >(std::locale const&)' > >>> clang-15: error: linker command failed with exit code 1 (use -v to see > invocation) > > > > That should be present, andis present in my builds: > > > > _ZSt15__try_use_facetINSt7__cxx117collateIcEEEPKT_RKSt6locale > > std::__cxx11::collate const* > > std::__try_use_facet >(std::locale const&) > > version status: compatible > > GLIBCXX_3.4.31 > > type: function > > status: added > > > > Was this a clean build, or incremental? I'm guessing the latter. > > Yes, indeed. And a full rebuild fixed the issue for me. > Ah good. > Sorry for the noise. > No problem, you do a good job of keeping us working well with clang. --0000000000008857db05ed5f4664--