Commit 77e1381e authored by Matthias Braun's avatar Matthias Braun
Browse files

fix TLS emitting

[r12643]
parent a926c632
......@@ -530,6 +530,14 @@ void ia32_emit_am(ia32_emit_env_t *env, const ir_node *node) {
if (is_ia32_am_sc_sign(node))
be_emit_char(env, '-');
be_emit_ident(env, id);
if(get_entity_owner(ent) == get_tls_type()) {
if (get_entity_visibility(ent) == visibility_external_allocated) {
be_emit_cstring(env, "@INDNTPOFF");
} else {
be_emit_cstring(env, "@NTPOFF");
}
}
}
if(offs != 0) {
......
......@@ -39,46 +39,6 @@
#include "gen_ia32_regalloc_if.h"
#include "gen_ia32_machine.h"
/**
* Returns the ident of an entity
* @param ent The entity
* @return The ident of the entity
*/
ident *ia32_get_ent_ident(ir_entity *ent) {
ir_type *owner = get_entity_owner(ent);
ident *id = get_entity_ld_ident(ent);
if (owner == get_tls_type()) {
if (get_entity_visibility(ent) == visibility_external_allocated)
id = mangle(id, new_id_from_chars("@INDNTPOFF", 10));
else
id = mangle(id, new_id_from_chars("@NTPOFF", 7));
}
return id;
}
#if 0
/**
* Returns the ident of a SymConst.
* @param symc The SymConst
* @return The ident of the SymConst
*/
static ident *get_sc_ident(ir_node *symc) {
switch (get_SymConst_kind(symc)) {
case symconst_addr_name:
return get_SymConst_name(symc);
case symconst_addr_ent:
return ia32_get_ent_ident(get_SymConst_entity(symc));
default:
assert(0 && "Unsupported SymConst");
}
return NULL;
}
#endif
/**
* returns true if a node has x87 registers
*/
......
......@@ -6,7 +6,7 @@ __thread int tls_i[10];
__thread int tls_j = 5;
int test(int i) {
tls_j = i;
tls_j = i;
return tls_i[i];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment