From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B27B03858D28; Wed, 20 Mar 2024 21:45:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B27B03858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710971117; bh=5unvJjdrv6RPks3PpepGGP4tTLCJ010Yrgq21V3U++w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SbAwaQpUVRaP4+zQbQXeJprYggfgcesybbsQNB+f6Xmd7UuvvDq6t3Md9vviPFnic f5w55dM6Uv4Wdgb+TwrAUQwplgp/QTkTWjN2EU0rgQELKEU1P4sl69OxYCTVVF8YyG eMBDlfkOU8DGU2iC5EdJg4vRsR6K88UMihpY5qhc= From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/111736] Address sanitizer is not compatible with named address spaces Date: Wed, 20 Mar 2024 21:45:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: addr-space, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111736 --- Comment #11 from Uro=C5=A1 Bizjak --- (In reply to Uro=C5=A1 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 t= his access is inside a global variable, then there's no point adding --cut here-- But unfortunately, it doesn't result in bootable kernel.=