This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, take 2] Fix PR41357
Dave Korn wrote:
> Okeydokey, I'll respin and retest.
And in fact I ended up respinning once more again after some further
discussion in the PR comment trail. Here is the final patch I tested.
gcc/ChangeLog:
PR middle-end/41357
* varasm.c (default_encode_section_info): Copy TLS model into
sym_ref flags regardless of backend support for TLS, for all
model types except TLS_MODEL_EMULATED.
Bootstrapped on i686-pc-cygwin and i686-pc-linux-gnu. Tests run before(*)
and after(**) on Linux with no regressions. Verified on Cygwin that it fixes
the testcase (and indeed bootstrap), but it'll be days before the results come
in; I think we'll be OK, and I'll be around to fix any fallout if it does crop up.
Ok for HEAD?
cheers,
DaveK
--
(*) - http://gcc.gnu.org/ml/gcc-testresults/2009-09/msg01450.html
(**) - http://gcc.gnu.org/ml/gcc-testresults/2009-09/msg01454.html
Index: varasm.c
===================================================================
--- varasm.c (revision 151703)
+++ varasm.c (working copy)
@@ -6417,8 +6417,8 @@ default_encode_section_info (tree decl, rtx rtl, i
flags |= SYMBOL_FLAG_FUNCTION;
if (targetm.binds_local_p (decl))
flags |= SYMBOL_FLAG_LOCAL;
- if (targetm.have_tls && TREE_CODE (decl) == VAR_DECL
- && DECL_THREAD_LOCAL_P (decl))
+ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl)
+ && DECL_TLS_MODEL (decl) != TLS_MODEL_EMULATED)
flags |= DECL_TLS_MODEL (decl) << SYMBOL_FLAG_TLS_SHIFT;
else if (targetm.in_small_data_p (decl))
flags |= SYMBOL_FLAG_SMALL;