This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/82803] Wildly excessive calls to __tls_get_addr with optimizations enabled.


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;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]