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

dvyukov at google dot com gcc-bugzilla@gcc.gnu.org
Tue Nov 22 09:19:00 GMT 2016


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

--- Comment #25 from Dmitry Vyukov <dvyukov at google dot com> ---
> The question is if we want to change this or not and in what way.

I would say that we need to change something, because current behavior is
counter-intuitive.

In tsan runtime we have a declaration with the attribute and definition without
the attribute. For most of other things (e.g. static) attributes/qualifiers are
propagated from declaration to definition.

I would do the obvious propagation automatically, and then maybe warn about all
other cases (e.g. conflicting tls models, or addition of initial-exec after the
variable was already used).


More information about the Gcc-bugs mailing list