diff --git a/gcc/asan.cc b/gcc/asan.cc
index 2424cf69ef1145e3209c0d5be69d55ad189ac8f2..8d0ffb497cc905c69feedc201ae3105e9d95d990 100644
--- a/gcc/asan.cc
+++ b/gcc/asan.cc
@@ -2291,6 +2291,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