[Bug middle-end/78294] [5/6/7 Regression] -fsanitize=thread broken by ignoring __attribute__((tls_model("initial-exec")))

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 16 07:35:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294

--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Well, GCC has always required that the tls_model attribute is specified on all
the declarations/definitions (since the introduction of the extension) rather
than just one of them, and matches in between them.  Apparently LLVM
implemented the GNU extension differently.
The question is if we want to change this or not and in what way.
Do we want to error out if there are multiple tls_model attributes with
different arguments, or silently pick up something from those (both gcc and
llvm is quiet on the mismatches right now)?
What do we want to do when merging the decls?  The decl without tls_model
attribute gets the default tls model, the one with the attribute gets the
chosen one.  Shall we pick the more optimized one of those two (LE wins over
IE, which wins over LD which wins over GD)?  Or shall we keep the tls model
from the decl that has tls_model attribute if any (and again, what to do if
there are mismatches)?


More information about the Gcc-bugs mailing list