From: Andreas Arnez Date: Fri, 8 Nov 2024 13:52:11 +0000 (+0100) Subject: s390x regtest: Add missing register clobber in misc3.c X-Git-Tag: VALGRIND_3_25_0~250 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cc58e418952fa75d902bf0bc02efd410aaf58a4;p=thirdparty%2Fvalgrind.git s390x regtest: Add missing register clobber in misc3.c Depending on compiler options, the translation of test_mvcrl() in `misc3.c' can misbehave because the inline assembly writes to r0 and doesn't declare that. Add a register clobber to fix this. Also, tell the compiler the actual length of `from' and `to' instead of the decremented value. --- diff --git a/none/tests/s390x/misc3.c b/none/tests/s390x/misc3.c index eeeea1163..c5df05ea5 100644 --- a/none/tests/s390x/misc3.c +++ b/none/tests/s390x/misc3.c @@ -144,13 +144,12 @@ static void test_all_select() static void test_mvcrl(char *to, char *from, size_t len) { - len -= 1; __asm__("lgr 0,%[len]\n\t" ".insn sse,0xe50a00000000,%[to],%[from]\n\t" : [to] "+Q" (*(char (*)[len]) to) : [from] "Q" (*(char (*)[len]) from), - [len] "d" (len) - : ); + [len] "d" (len - 1) + : "0"); } static void test_all_mvcrl()