https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65809
--- Comment #10 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #9) > Then perhaps one needs to check > > TREE_CODE (decl) == VAR_DECL > && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)) > && decl_tls_model (decl) != TLS_MODEL_NONE > > instead. except for: (gdb) p decl_tls_model(decl) $4 = TLS_MODEL_NONE which doesn't seem right .. but haven't got a chance to debug further right now.