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
This commit is contained in:
Ryan Libby 2024-06-23 18:20:47 -07:00
parent 6095f4b04c
commit 88478cc02a

View file

@ -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