The test memcheck/tests/memcmp currently fails on s390x because it yields
the expected "conditional jump or move depends on uninitialised value(s)"
message twice instead of just once.
This is caused by the handling of the s390x instruction CLC, see
s390_irgen_CLC_EX(). When comparing two bytes from the two input strings,
the implementation uses the comparison result for a conditional branch to
the next instruction. But if no further bytes need to be compared, the
comparison result is also used for generating the resulting condition
code.
There are two cases: Either the inputs are equal; then the resulting
condition code is zero. This is what happens in the memcmp test case. Or
the inputs are different; then the resulting condition code is 1 or 2 if
the first or second operand is greater, respectively.
At least in the first case it is easy to avoid the additional dependency,
by clearing the condition code explicitly. Just do this.
417452 s390_insn_store_emit: dst->tag for HRcVec128
417578 Add suppressions for glibc DTV leaks
417906 clone with CLONE_VFORK and no CLONE_VM fails
+418435 s390x: memcmp test yields extra "Conditional jump or move depends on uninitialised value(s)"
Release 3.15.0 (12 April 2019)
put_counter_dw0(binop(Iop_Add64, mkexpr(counter), mkU64(1)));
iterate_if(binop(Iop_CmpNE64, mkexpr(counter), mkexpr(length)));
put_counter_dw0(mkU64(0));
+
+ /* Equal. Clear CC, to avoid duplicate dependency on the comparison. */
+ s390_cc_set_val(0);
}
static void