Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jun 2024 01:30:55 GMT
From:      Ryan Libby <rlibby@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 88478cc02a20 - main - i386 kernel __storeload_barrier: quiet gcc -Warray-bounds
Message-ID:  <202406240130.45O1Utat049940@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rlibby:

URL: https://cgit.FreeBSD.org/src/commit/?id=88478cc02a20b04094183b805c3b6357f198c64e

commit 88478cc02a20b04094183b805c3b6357f198c64e
Author:     Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2024-06-24 01:20:47 +0000
Commit:     Ryan Libby <rlibby@FreeBSD.org>
CommitDate: 2024-06-24 01:20:47 +0000

    i386 kernel __storeload_barrier: quiet gcc -Warray-bounds
    
    Use a constant input operand instead of an output operand to tell the
    compiler about __OFFSETOF_MONITORBUF.  If we tell it we are writing to
    *(u_int *)__OFFSETOF_MONITORBUF, it rightly complains, but we aren't.
    The memory clobber already covers the necessary semantics for the
    compiler.
    
    Reviewed by:    kib
    Sponsored by:   Dell EMC Isilon
    Differential Revision:  https://reviews.freebsd.org/D45695
---
 sys/i386/include/atomic.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h
index 5aca9fb15181..144b8f1d114c 100644
--- a/sys/i386/include/atomic.h
+++ b/sys/i386/include/atomic.h
@@ -49,8 +49,8 @@ static __inline void
 __mbk(void)
 {
 
-	__asm __volatile("lock; addl $0,%%fs:%0"
-	    : "+m" (*(u_int *)__OFFSETOF_MONITORBUF) : : "memory", "cc");
+	__asm __volatile("lock; addl $0,%%fs:%c0"
+	    : : "i" (__OFFSETOF_MONITORBUF) : "memory", "cc");
 }
 
 static __inline void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406240130.45O1Utat049940>