This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix PR41357


Jie Zhang wrote:
Richard Guenther wrote:
On Wed, Sep 16, 2009 at 11:37 AM, Dave Korn
<dave.korn.cygwin@googlemail.com> wrote:
Richard Guenther wrote:
On Wed, Sep 16, 2009 at 9:34 AM, Dave Korn
gcc/ChangeLog:

* varasm.c (default_encode_section_info): Set SYMBOL_REF_TLS_MODEL
even for emulated tls.


If there are no regressions, OK for HEAD?
Isn't it enough to remove the targetm.have_tls check? Thus, DECL_TLS_MODEL
should already be TLS_MODEL_EMULATED, no?
That's what I would have thought at first too, but I read Jakub's comment
#13(*) as suggesting that we should hardcode TLS_MODEL_EMULATED because
(somewhat to our surprise) the tls model value in the decl looked strange and
possibly bogus (tls-local-exec?), so it makes sense to override it here with
what we know is the right value to show to the backend. I haven't
investigated to find out how the decl's tls model got to be that way and if
it's intended or accidental. (And I'd really rather not get sidetracked into
investigating all the plumbing of the tls emulation layer when I just want to
get bootstrap fixed so I can get on with updating to head all the huge patches
awaiting review that I'm currently carrying around...)

I think the variable should have a proper DECL_TLS_MODEL from the start. Where does it get (not) set?

My question here is TLS_MODEL_EMULATED should be exclusive with other models or not?

After tracing for a while, I think I probably can answer the question myself. :-) It seems TLS_MODEL_EMULATED is only set to emutls-prefixed variable, like __emutls_v.gomp_tls_data. For the original __thread variable, gomp_tls_data in this case, other TLS_MODEL should be used. So we cannot set TLS_MODEL_EMULATED from the start.


Jie



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