public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/xry111/heads/loongarch-sanitizer-test)] add TARGET_ASAN_SHADOW_OFFSET for LoongArch
@ 2022-07-11 11:01 Xi Ruoyao
  0 siblings, 0 replies; only message in thread
From: Xi Ruoyao @ 2022-07-11 11:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b06c430e24938e57d8e785e61d9b896373120cde

commit b06c430e24938e57d8e785e61d9b896373120cde
Author: Xi Ruoyao <xry111@xry111.site>
Date:   Mon Jul 11 18:31:59 2022 +0800

    add TARGET_ASAN_SHADOW_OFFSET for LoongArch

Diff:
---
 gcc/config/loongarch/loongarch.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
index 8b0d7f459e0..1be6275861e 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -5782,6 +5782,14 @@ loongarch_starting_frame_offset (void)
   return crtl->outgoing_args_size;
 }
 
+/* Implement TARGET_ASAN_SHADOW_OFFSET.  */
+
+static unsigned HOST_WIDE_INT
+loongarch_asan_shadow_offset (void)
+{
+  return TARGET_64BIT ? (HOST_WIDE_INT_1 << 46) : 0;
+}
+
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
@@ -5964,6 +5972,9 @@ loongarch_starting_frame_offset (void)
 #undef  TARGET_HAVE_SPECULATION_SAFE_VALUE
 #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed
 
+#undef TARGET_ASAN_SHADOW_OFFSET
+#define TARGET_ASAN_SHADOW_OFFSET loongarch_asan_shadow_offset
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #include "gt-loongarch.h"


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

only message in thread, other threads:[~2022-07-11 11:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 11:01 [gcc(refs/users/xry111/heads/loongarch-sanitizer-test)] add TARGET_ASAN_SHADOW_OFFSET for LoongArch Xi Ruoyao

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