mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
Bug 418435 - s390x: Avoid extra value dependency in CLC implementation
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.
This commit is contained in:
parent
3d6a8157d5
commit
91bf2d2d8c
1
NEWS
1
NEWS
@ -129,6 +129,7 @@ n-i-bz Fix non-glibc build of test suite with s390x_features
|
||||
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)
|
||||
|
||||
@ -12840,6 +12840,9 @@ s390_irgen_CLC_EX(IRTemp length, IRTemp start1, IRTemp start2)
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user