diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
commit | e252b51ccde010cbd2a146485d8045103cd99533 (patch) | |
tree | e060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/tree-emutls.c | |
parent | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff) | |
parent | 104c05c5284b7822d770ee51a7d91946c7e56d50 (diff) | |
download | gcc-e252b51ccde010cbd2a146485d8045103cd99533.zip gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2 |
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/tree-emutls.c')
-rw-r--r-- | gcc/tree-emutls.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c index f105338..92cb619 100644 --- a/gcc/tree-emutls.c +++ b/gcc/tree-emutls.c @@ -242,16 +242,18 @@ get_emutls_init_templ_addr (tree decl) DECL_PRESERVE_P (to) = DECL_PRESERVE_P (decl); DECL_WEAK (to) = DECL_WEAK (decl); - if (DECL_ONE_ONLY (decl)) + if (DECL_ONE_ONLY (decl) || DECL_WEAK (decl)) { TREE_STATIC (to) = TREE_STATIC (decl); TREE_PUBLIC (to) = TREE_PUBLIC (decl); DECL_VISIBILITY (to) = DECL_VISIBILITY (decl); - make_decl_one_only (to, DECL_ASSEMBLER_NAME (to)); } else TREE_STATIC (to) = 1; + if (DECL_ONE_ONLY (decl)) + make_decl_one_only (to, DECL_ASSEMBLER_NAME (to)); + DECL_VISIBILITY_SPECIFIED (to) = DECL_VISIBILITY_SPECIFIED (decl); DECL_INITIAL (to) = DECL_INITIAL (decl); DECL_INITIAL (decl) = NULL; @@ -392,13 +394,13 @@ struct lower_emutls_data Append any new computation statements required to D->SEQ. */ static tree -gen_emutls_addr (tree decl, struct lower_emutls_data *d) +gen_emutls_addr (tree decl, struct lower_emutls_data *d, bool for_debug) { /* Compute the address of the TLS variable with help from runtime. */ tls_var_data *data = tls_map->get (varpool_node::get (decl)); tree addr = data->access; - if (addr == NULL) + if (addr == NULL && !for_debug) { varpool_node *cvar; tree cdecl; @@ -478,7 +480,7 @@ lower_emutls_1 (tree *ptr, int *walk_subtrees, void *cb_data) *ptr = t = unshare_expr (t); /* If we're allowed more than just is_gimple_val, continue. */ - if (!wi->val_only) + if (!wi->val_only || is_gimple_debug (wi->stmt)) { *walk_subtrees = 1; return NULL_TREE; @@ -534,7 +536,15 @@ lower_emutls_1 (tree *ptr, int *walk_subtrees, void *cb_data) return NULL_TREE; } - addr = gen_emutls_addr (t, d); + addr = gen_emutls_addr (t, d, is_gimple_debug (wi->stmt)); + if (!addr) + { + gimple_debug_bind_reset_value (wi->stmt); + update_stmt (wi->stmt); + wi->changed = false; + /* Stop walking operands. */ + return error_mark_node; + } if (is_addr) { /* Replace "&var" with "addr" in the statement. */ @@ -588,6 +598,7 @@ lower_emutls_phi_arg (gphi *phi, unsigned int i, memset (&wi, 0, sizeof (wi)); wi.info = d; wi.val_only = true; + wi.stmt = phi; walk_tree (&pd->def, lower_emutls_1, &wi, NULL); /* For normal statements, we let update_stmt do its job. But for phi |