From: Andreas Arnez Date: Wed, 9 Oct 2024 15:10:08 +0000 (+0200) Subject: s390x: Add missing early-clobber to GET_STARTREGS X-Git-Tag: VALGRIND_3_24_0~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=943669f4ea16381154ec0cb26237e901d34e6d83;p=thirdparty%2Fvalgrind.git s390x: Add missing early-clobber to GET_STARTREGS The inline assembly for GET_STARTREGS in m_libcassert.c writes to its output before using the input argument. But since the compiler doesn't know this, it is allowed to allocate the same register for both, causing problems. This has been seen when compiling Valgrind with -O0, after which memcheck/tests/leak-autofreepool-5 fails due to SIGSEGV. Fix this by declaring the output as early-clobber, so the compiler knows about the restriction. --- diff --git a/coregrind/m_libcassert.c b/coregrind/m_libcassert.c index db9d43d87..257c26bc6 100644 --- a/coregrind/m_libcassert.c +++ b/coregrind/m_libcassert.c @@ -177,7 +177,7 @@ "std %%f5, 64(%1);" \ "std %%f6, 72(%1);" \ "std %%f7, 80(%1);" \ - : /* out */ "=r" (ia) \ + : /* out */ "=&r" (ia) \ : /* in */ "a" (&block[0]) \ : /* trash */ "memory" \ ); \