From: Florian Krohm Date: Wed, 4 Feb 2026 22:34:30 +0000 (+0000) Subject: s390: Fix s390_irgen_VGE[FG] and s390_irgen_VSCE[FG] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68b344ece023c55042fdd5e17d40547e94ce359b;p=thirdparty%2Fvalgrind.git s390: Fix s390_irgen_VGE[FG] and s390_irgen_VSCE[FG] Instead of creating a specification exception these run into an assertion: VEX: s390_vr_offset_by_index: invalid index for given type There are proper s390_insn_assert in s390_irgen_VGEF etc. However, the vassert happens in s390_format_VRV --> get_vr --> s390_vr_offset_by_index prior to s390_irgen_... being called. Fixed by adding s390_insn_assert to s390_format_VRV. Found by disasm-test. --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 939d9b0cc..219388eb6 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -3289,8 +3289,10 @@ s390_format_VRV(void (*irgen)(UChar v1, IRTemp op2addr, UChar m3), vassert(type == Ity_I32 || type == Ity_I64); IRExpr *x2; if(type == Ity_I32) { + s390_insn_assert(m3 < 4); x2 = unop(Iop_32Uto64, get_vr(v2, type, m3)); } else { + s390_insn_assert(m3 < 2); x2 = get_vr(v2, type, m3); } diff --git a/none/tests/s390x/disasm-test/disasm-test.post.exp b/none/tests/s390x/disasm-test/disasm-test.post.exp index 8742a9b74..fdfd38890 100644 --- a/none/tests/s390x/disasm-test/disasm-test.post.exp +++ b/none/tests/s390x/disasm-test/disasm-test.post.exp @@ -1,6 +1,6 @@ Looking for missed specification exceptions -Total: 42771 tests generated -Total: 42771 specification exceptions +Total: 43187 tests generated +Total: 43187 specification exceptions Looking for unexpected specification exceptions -Total: 153781 tests generated +Total: 153877 tests generated Total: 0 specification exceptions diff --git a/none/tests/s390x/disasm-test/disasm-test.vgtest b/none/tests/s390x/disasm-test/disasm-test.vgtest index ba921175a..79c993c3d 100644 --- a/none/tests/s390x/disasm-test/disasm-test.vgtest +++ b/none/tests/s390x/disasm-test/disasm-test.vgtest @@ -6,15 +6,10 @@ # exrl - Offset is expected to denote a decodable insn; no such scaffolding # kma - Cannot express constraint that r3 must be different from r1 and r2 # srnmb - The compile-time checkable constraint cannot be expressed in opcode.c -# The following need to be fixed -# vgef - runs into an assert instead of spec. exc. -# vgeg - runs into an assert instead of spec. exc. -# vscef - runs into an assert instead of spec. exc. -# vsceg - runs into an assert instead of spec. exc. - +# prereq: ./disasm-test --check-march=arch14 prog: /bin/true -post: ./disasm-test --gcc-flags=-march=arch14 --all --exclude exrl kma vgef vgeg vscef vsceg srnmb --summary +post: ./disasm-test --gcc-flags=-march=arch14 --all --exclude exrl kma srnmb --summary vgopts: -q stderr_filter: stderrB_filter: