Module Name:    src
Committed By:   nakayama
Date:           Fri Apr  5 12:15:41 UTC 2019

Modified Files:
        src/sys/arch/sparc64/include: psl.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/sparc64/include/psl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.58 src/sys/arch/sparc64/include/psl.h:1.59
--- src/sys/arch/sparc64/include/psl.h:1.58	Fri Feb  8 20:09:24 2019
+++ src/sys/arch/sparc64/include/psl.h	Fri Apr  5 12:15:41 2019
@@ -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

Reply via email to