This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81501] Unneccessary calls to __tls_get_addr() in simple thread-singleton pattern
- From: "jak at jak-linux dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Jul 2017 21:26:27 +0000
- Subject: [Bug target/81501] Unneccessary calls to __tls_get_addr() in simple thread-singleton pattern
- Auto-submitted: auto-generated
- References: <bug-81501-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81501
--- Comment #1 from Julian Andres Klode <jak@jak-linux.org> ---
To qualify the performance overhead, I added empty constructors and destructors
with noinline, and compiled the code with g++ and clang++, and then ran a loop
100000000 over the function.
The clang code took 6 nanosecond, the g++ code 8 nanosecond per iteration,
that's 33% worse. I think it's probably a neglectable overhead after all, but
it seems like that would be a sensible and maybe an easy optimization to do.