From 1cc58e418952fa75d902bf0bc02efd410aaf58a4 Mon Sep 17 00:00:00 2001 From: Andreas Arnez Date: Fri, 8 Nov 2024 14:52:11 +0100 Subject: [PATCH] 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. --- none/tests/s390x/misc3.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/none/tests/s390x/misc3.c b/none/tests/s390x/misc3.c index eeeea1163c..c5df05ea50 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() -- 2.47.2