public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Stephan Bergmann <sbergman@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755]
Date: Fri, 11 Nov 2022 22:00:31 +0100	[thread overview]
Message-ID: <ec586283-36b3-14c5-83ea-5096901ebd29@redhat.com> (raw)
In-Reply-To: <20221111053043.563832-1-jwakely@redhat.com>

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 <regex>
> int main(int, char ** argv) {
>     std::regex_traits<char>().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<char, std::char_traits<char>, std::allocator<char> > std::__cxx11::regex_traits<char>::transform<char*>(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<char> const* std::__try_use_facet<std::__cxx11::collate<char> >(std::locale const&)'
> clang-15: error: linker command failed with exit code 1 (use -v to see invocation)


  reply	other threads:[~2022-11-11 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  5:30 Jonathan Wakely
2022-11-11 21:00 ` Stephan Bergmann [this message]
2022-11-12  2:47   ` Jonathan Wakely
2022-11-13 19:22     ` Stephan Bergmann
2022-11-13 19:38       ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec586283-36b3-14c5-83ea-5096901ebd29@redhat.com \
    --to=sbergman@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).