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

--- Comment #1 from Kito Cheng <kito.cheng at gmail dot com> ---
Confirmed, a hot fix here, will send to gcc-patch after test.

diff --git a/gcc/toplev.c b/gcc/toplev.c
index 7e0b9216dea..5dd5b66b89c 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1744,20 +1744,12 @@ process_options (void)
   /* Address Sanitizer needs porting to each target architecture.  */

   if ((flag_sanitize & SANITIZE_ADDRESS)
-      && !FRAME_GROWS_DOWNWARD)
+      && (!FRAME_GROWS_DOWNWARD || targetm.asan_shadow_offset == NULL))
     {
       warning_at (UNKNOWN_LOCATION, 0,
                  "%<-fsanitize=address%> and %<-fsanitize=kernel-address%> "
                  "are not supported for this target");
-      flag_sanitize &= ~SANITIZE_ADDRESS;
-    }
-
-  if ((flag_sanitize & SANITIZE_USER_ADDRESS)
-      && targetm.asan_shadow_offset == NULL)
-    {
-      warning_at (UNKNOWN_LOCATION, 0,
-                 "%<-fsanitize=address%> not supported for this target");
-      flag_sanitize &= ~SANITIZE_ADDRESS;
+      flag_sanitize &= ~(SANITIZE_ADDRESS | SANITIZE_USER_ADDRESS);
     }

  /* Do not use IPA optimizations for register allocation if profiler is active

Reply via email to