public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-10387] sanitizer/111736 - skip ASAN for globals in alternate address-space
@ 2024-04-23 17:09 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2024-04-23 17:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:61d1962e7c3c32da6962d9cb20f6fd996501f3f2

commit r12-10387-g61d1962e7c3c32da6962d9cb20f6fd996501f3f2
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Dec 5 14:00:43 2023 +0100

    sanitizer/111736 - skip ASAN for globals in alternate address-space
    
            PR sanitizer/111736
            * asan.cc (asan_protect_global): Do not protect globals
            in non-generic address-space.
    
    (cherry picked from commit 7e40497805c0831596334fe474112f991276e11b)

Diff:
---
 gcc/asan.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/asan.cc b/gcc/asan.cc
index 72d1ef28be8..0c5afa36cb8 100644
--- a/gcc/asan.cc
+++ b/gcc/asan.cc
@@ -2251,6 +2251,8 @@ asan_protect_global (tree decl, bool ignore_decl_rtl_set_p)
       || (DECL_SECTION_NAME (decl) != NULL
 	  && !symtab_node::get (decl)->implicit_section
 	  && !section_sanitized_p (DECL_SECTION_NAME (decl)))
+      /* Don't protect variables in non-generic address-space.  */
+      || !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))
       || DECL_SIZE (decl) == 0
       || ASAN_RED_ZONE_SIZE * BITS_PER_UNIT > MAX_OFILE_ALIGNMENT
       || TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-23 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 17:09 [gcc r12-10387] sanitizer/111736 - skip ASAN for globals in alternate address-space Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).