Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/include Put "memory" to asm inline reading ...



details:   https://anonhg.NetBSD.org/src/rev/8383f668affe
branches:  trunk
changeset: 455522:8383f668affe
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Fri Apr 05 12:15:41 2019 +0000

description:
Put "memory" to asm inline reading privilege registers for clang to
prevent it from being removed by excessive optimization.

diffstat:

 sys/arch/sparc64/include/psl.h |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r a90e323c2a1b -r 8383f668affe sys/arch/sparc64/include/psl.h
--- a/sys/arch/sparc64/include/psl.h    Fri Apr 05 12:11:26 2019 +0000
+++ b/sys/arch/sparc64/include/psl.h    Fri Apr 05 12:15:41 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: psl.h,v 1.58 2019/02/08 20:09:24 palle Exp $ */
+/*     $NetBSD: psl.h,v 1.59 2019/04/05 12:15:41 nakayama Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -292,8 +292,9 @@
  * Put "memory" to asm inline on sun4v to avoid issuing rdpr %ver
  * before checking cputyp as a result of code moving by compiler
  * optimization.
+ * For clang, to prevent it from being removed by optimization.
  */
-#ifdef SUN4V
+#if defined(SUN4V) || defined(__clang__)
 #define constasm_clobbers "memory"
 #else
 #define constasm_clobbers



Home | Main Index | Thread Index | Old Index