https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111736
--- Comment #16 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to Richard Biener from comment #13) > The original testcase is fixed, appearantly slapping 'extern' on the int > makes it not effective. > > Possibly better amend the > > if (VAR_P (inner) && DECL_HARD_REGISTER (inner)) > return; > > check though. As indicated my fix fixed only VAR_DECL cases, there's > still pointer-based accesses (MEM_REF) to consider. So possibly even > the following is necessary I must admit that to create the patch from Comment #11 I just mindlessly searched for DECL_THREAD_LOCAL_P in asan.cc and amended the location with ADDR_SPACE_GENERIC_P check. However, ASAN should back off from annotating *any* gs: prefixed address. I'll test your patch from Comment #13 ASAP.