From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 378963858D38 for ; Sat, 12 Nov 2022 02:47:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 378963858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668221251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DgXmUTV1qRwaxtb7YdquY+jv08tFGa3g929AuBrjH28=; b=aM+AETyOGP23WNUkB/AmFQezjaSpYYejNc//EbFkrXYc9No0B5rL8pzxd0wO76kKiwqzec YV8BeApY5d1ITwUpSWnjGwuOBZlTcvRrt9QS13nh7/i1O6RB7C/B3i27PguH+6vpXQ8EtJ FEMmLU+qDiXZQruWjz2ngOHGPldCD5I= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-444-nwruusuWPEqlPrz9UlBv5g-1; Fri, 11 Nov 2022 21:47:30 -0500 X-MC-Unique: nwruusuWPEqlPrz9UlBv5g-1 Received: by mail-ej1-f70.google.com with SMTP id jg27-20020a170907971b00b007ad9892f5f6so3730044ejc.7 for ; Fri, 11 Nov 2022 18:47:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=DgXmUTV1qRwaxtb7YdquY+jv08tFGa3g929AuBrjH28=; b=JRRgFlfR/d9xx53qrcX9sy9IoIWXu+iZW7Vlwl/h+IhSUADGbh1UNgtNbhjPwiTgD7 Gu2Sx7T6siXgC8wD+4XteAJv1V8XyPwdSiF/PpwgvVJM3tpSzYGKLmUQwqbuJyujg8X4 qTQT9u46DGqcFFE7ns4ZmKWcSf4v9+s1B8w8IOGAva/cXzY7Vxs3WxcLTcuSRlZkUmBD Li5tYHvE2NC7mj5iAg8nJ0NcMptl7ohwb/d3PsmIvyk13DTRPMO9rvaOzsQPQdfbss7g ZBrwKWIRoBfE85wq3iWa3Iaf/DKVPzeNHpj26inG8fxN0SUWDD0GckZuWdzdP5TZ5+F2 +jZA== X-Gm-Message-State: ANoB5pnRdbmpditlWYRX7SlCbPU9Mg2D13OA+PIzDu01RiISDTRFTMy2 0p2LpCc+vTIiMA6rMGFwJ94E3oI/M4n/+dsjMJ2QwpzTPzeRBZfBqMQq2t0ZgmMWgagQM8c+TmL OhcHAefv0UHF1qGAhZdf7YV9DZIZW7LIrgA== X-Received: by 2002:a05:6402:229b:b0:457:d794:f5ee with SMTP id cw27-20020a056402229b00b00457d794f5eemr4026410edb.227.1668221249566; Fri, 11 Nov 2022 18:47:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf50YWijdaFa2QLp5e9O8mGD95Ft/SjEbAB3/6+RpIIJdhsCGnT2KI9hZSNTU67LnneZvS17/kAga0bbtieRZc0= X-Received: by 2002:a05:6402:229b:b0:457:d794:f5ee with SMTP id cw27-20020a056402229b00b00457d794f5eemr4026404edb.227.1668221249407; Fri, 11 Nov 2022 18:47:29 -0800 (PST) MIME-Version: 1.0 References: <20221111053043.563832-1-jwakely@redhat.com> In-Reply-To: From: Jonathan Wakely Date: Sat, 12 Nov 2022 02:47:18 +0000 Message-ID: Subject: Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755] To: Stephan Bergmann Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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, 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=3D... -fsanitize=3Dundefined -O2 test.cc > > /usr/bin/ld: /tmp/test-c112b1.o: in function `std::__cxx11::basic_strin= g, std::allocator > std::__cxx11::regex_= traits::transform(char*, char*) const': > > test.cc:(.text._ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic= _stringIcSt11char_traitsIcESaIcEEET_S9_[_ZNKSt7__cxx1112regex_traitsIcE9tra= nsformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_]+0x1b): undefi= ned 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. The makefile deps for libstdc++ don't really support incremental builds. More precisely, the lack of deps. That symbol should be defined in src/c++11/cxx11-locale-inst.o which wasn't changed by the patch, but it includes src/c++11/locale-inst.cc which was changed. So an incremental rebuild will only rebuild the latter, and so you won't get the new symbols that should be in the former. But if you're seeing that with a clean build I'll have to investigate.