https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111736

--- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #10)
> Huh, is this really fixed?

IMO, this patch is also needed:

--cut here--
diff --git a/gcc/asan.cc b/gcc/asan.cc
index cfe83106460..54dcc3a38db 100644
--- a/gcc/asan.cc
+++ b/gcc/asan.cc
@@ -2764,7 +2764,9 @@ instrument_derefs (gimple_stmt_iterator *iter, tree t,
       && poly_int_tree_p (DECL_SIZE (inner), &decl_size)
       && known_subrange_p (bitpos, bitsize, 0, decl_size))
     {
-      if (VAR_P (inner) && DECL_THREAD_LOCAL_P (inner))
+      if (VAR_P (inner)
+         && (DECL_THREAD_LOCAL_P (inner)
+             || !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (TREE_TYPE (inner)))))
        return;
       /* If we're not sanitizing globals and we can tell statically that this
         access is inside a global variable, then there's no point adding
--cut here--

But unfortunately, it doesn't result in bootable kernel.

Reply via email to