]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: Replace absolute jump for a relative one
authorTulio Magno Quites Machado Filho <tuliom@redhat.com>
Wed, 14 Jun 2023 14:28:38 +0000 (11:28 -0300)
committerMark Wielaard <mark@klomp.org>
Thu, 15 Jun 2023 15:01:18 +0000 (17:01 +0200)
The bne instruction expects an absolute target address and it isn't
best-suited for implementing a short range jump, such as the one in
XCHG_M_R().
Replace it with jne which expects a relative address that can be
correctly computed a link time.

Interestingly, the jump is almost never taken. If it would, this would
crash the test.  However, linkers may complain when relacating the
target address used in bne.

helgrind/tests/tc11_XCHG.c

index f6ff1c9846bde88141f8afde2e3ad7ca92a31226..08e34a0b577a42141f647fa9d74023f3ab0f1316 100644 (file)
@@ -81,7 +81,7 @@
         __asm__ __volatile__(                                \
            "0: l   0,%[global]\n\t"                          \
            "   cs  0,%[local],%[global]\n\t"                 \
-           "   bne 0b\n\t"                                   \
+           "   jne 0b\n\t"                                   \
            "   lr  %[local],0\n\t"                           \
            : /*out*/ [global]"+m"(_addr), [local]"+d"(_lval) \
            : /*in*/                                          \