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.129.124]) by sourceware.org (Postfix) with ESMTPS id 71ACF3858C52 for ; Sat, 12 Nov 2022 02:47:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71ACF3858C52 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=1668221252; 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=PmPscy2OOIpmm8bb6wp3R8l65HoiafOiTQhX3PDyF6HvzXW89hLyLj7Y05d/dkrGy1rmid bTNSh3FhtMUjWirqpbVtOzlPDHEkyic5PIjpwsivl1gUcy8vhgz70/ySgL5VLOLMVrLOc0 z7QVeQE1GBZAI2X3nPF6xWgQrH8RXb8= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-515-H9NuvjM9PNWNWOJPYqN5Qw-1; Fri, 11 Nov 2022 21:47:30 -0500 X-MC-Unique: H9NuvjM9PNWNWOJPYqN5Qw-1 Received: by mail-ed1-f71.google.com with SMTP id t4-20020a056402524400b004620845ba7bso4585064edd.4 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=Rx6gsyQq/bR6jeM7KacZ3sM49bS/vgXNx1M4n2YoULscOLcMBUq5O7xGZkGD43Eir+ NhQ+NTZSmJGZDEbW2DsSBqLIFayaw+xBvI5usVmoPuPwBqwa/oAh60+iVK5D8HlSzu3G V8SxpH8Ofr8JEj39iQAT0MXjav3TmSzzqY3PtvXbmVVk3t0Xwt1aq6riQgluckQcDSUr Lycn6M+l76qFjLQuPRNTB1JOvjygsXMSimbrPSdccZXJp7XR46GJL1orh8hoAgw8yqv+ wriY8lSEKqJf4H+4V2YoMZMs/ZYyVX4l2fDMmo09ajG+orD81WRTONkxkxhvr9wQWfmO uA4Q== X-Gm-Message-State: ANoB5pmwQ5r0K0hAFpGUb0s+Jl2kFtkV/DbIMBKAzg5rGP5tcKY9zz8G NcDJYy0MNqTn7oKAAcaU5f/adK0lciUB1e4v9ReE+vrbcvhF75w3DNM49Gydw8WuSJCC3Ho30aG 3cO6mPYbzQwS/as9bl/l7bRbkoJQ62FE= X-Received: by 2002:a05:6402:229b:b0:457:d794:f5ee with SMTP id cw27-20020a056402229b00b00457d794f5eemr4026416edb.227.1668221249715; 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.3 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.