On Thu, Jul 31, 2025 at 6:58 AM Alexander Monakov <amona...@ispras.ru> wrote: > > > On Wed, 30 Jul 2025, H.J. Lu wrote: > > > According to the TLS spec, linker can optimize the TLS access by > > overriding the TLS access model. Do the same in compiler by using > > the default TLS mode if it is more optimized than the TLS model > > attribute. > > > > gcc/ > > > > PR c/121318 > > * doc/extend.texi: Update the tls_model attribute. > > > > gcc/c-family/ > > > > PR c/121318 > > * c-attribs.cc (handle_tls_model_attribute): Use the default TLS > > mode if it is more optimized. > > > > gcc/testsuite/ > > > > PR c/121318 > > * gcc.dg/tls/pr121318.c: New test. > > We have a few pre-existing tests that verify that the attribute is honored, > such as those added by commit 1d561e1851c4. Do they actually not fail with > this patch?
There are no regressions. BTW, I will see what I can do with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107353 Frontends should call set_decl_tls_model only after a variable has been fully processed, not in the middle of processing it. > https://gcc.gnu.org/cgit/gcc/commit/?id=1d561e1851c466a4952081caef17747781609b00 > > Thanks. > Alexander -- H.J.