public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8410] Enable -mlam=u57 by default when compiled with -fsanitize=hwaddress.
@ 2024-01-25  4:42 hongtao Liu
  0 siblings, 0 replies; only message in thread
From: hongtao Liu @ 2024-01-25  4:42 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:73f0a1a70c22e4d117ece7ddfa53661bb74137d4

commit r14-8410-g73f0a1a70c22e4d117ece7ddfa53661bb74137d4
Author: liuhongt <hongtao.liu@intel.com>
Date:   Tue Jan 23 14:21:58 2024 +0800

    Enable -mlam=u57 by default when compiled with -fsanitize=hwaddress.
    
    gcc/ChangeLog:
    
            * config/i386/i386-options.cc (ix86_option_override_internal):
            Enable -mlam=u57 by default when compiled with
            -fsanitize=hwaddress.

Diff:
---
 gcc/config/i386/i386-options.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index b6f634e9a32..e66a58ed926 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -2189,6 +2189,15 @@ ix86_option_override_internal (bool main_args_p,
       && opts->x_ix86_abi != DEFAULT_ABI)
     error ("%<-mabi=%s%> not supported with %<-fsanitize=thread%>", abi_name);
 
+  /* Hwasan is supported with lam_u57 only.  */
+  if (opts->x_flag_sanitize & SANITIZE_HWADDRESS)
+    {
+      if (ix86_lam_type == lam_u48)
+	warning (0, "%<-mlam=u48%> is not compatible with Hardware-assisted "
+		 "AddressSanitizer, override to %<-mlam=u57%>");
+      ix86_lam_type = lam_u57;
+    }
+
   /* For targets using ms ABI enable ms-extensions, if not
      explicit turned off.  For non-ms ABI we turn off this
      option.  */

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

only message in thread, other threads:[~2024-01-25  4:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25  4:42 [gcc r14-8410] Enable -mlam=u57 by default when compiled with -fsanitize=hwaddress hongtao Liu

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).