[Bug sanitizer/111736] Address sanitizer is not compatible with named address spaces
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 20 21:45:16 GMT 2024
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.
More information about the Gcc-bugs
mailing list