This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/82803] Wildly excessive calls to __tls_get_addr with optimizations enabled.
- From: "amohr at amohr dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 02 Nov 2017 17:02:39 +0000
- Subject: [Bug rtl-optimization/82803] Wildly excessive calls to __tls_get_addr with optimizations enabled.
- Auto-submitted: auto-generated
- References: <bug-82803-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82803
--- Comment #3 from Alex Mohr <amohr at amohr dot org> ---
FWIW a loop is not required. This generates 4 calls to __tls_get_addr:
static thread_local int x;
int g();
int f() {
int *px = &x;
if (g()) *px += g();
if (g()) *px += g();
if (g()) *px += g();
return *px;
}