In C and C++ frontends, we should set a tentative TLS model to avoid
tls_model attribute warnings due to lack of thread storage duration
and update it with the default TLS access model after a TLS variable
has been fully processed if the default TLS access model is stronger.

H.J. Lu (3):
  c++: Update TLS model after processing a TLS variable
  c: Update TLS model after processing a TLS variable
  testsuite: Add tests for PR c/107419 and PR c++/107393

 gcc/c/c-decl.cc                              | 16 +++++++++--
 gcc/cp/decl.cc                               |  5 +++-
 gcc/cp/decl2.cc                              |  9 ++++++
 gcc/cp/pt.cc                                 |  8 ++++--
 gcc/testsuite/c-c++-common/tls-attr-common.c | 17 ++++++++++++
 gcc/testsuite/c-c++-common/tls-attr-le-pic.c | 15 ++++++++++
 gcc/testsuite/c-c++-common/tls-attr-le-pie.c | 15 ++++++++++
 gcc/testsuite/g++.dg/tls/pr107393-1.C        | 14 ++++++++++
 gcc/testsuite/g++.dg/tls/pr107393-2.C        | 29 ++++++++++++++++++++
 9 files changed, 122 insertions(+), 6 deletions(-)
 create mode 100644 gcc/testsuite/c-c++-common/tls-attr-common.c
 create mode 100644 gcc/testsuite/c-c++-common/tls-attr-le-pic.c
 create mode 100644 gcc/testsuite/c-c++-common/tls-attr-le-pie.c
 create mode 100644 gcc/testsuite/g++.dg/tls/pr107393-1.C
 create mode 100644 gcc/testsuite/g++.dg/tls/pr107393-2.C

-- 
2.51.0

Reply via email to