From: Andreas Arnez Date: Fri, 13 Mar 2020 16:18:55 +0000 (+0100) Subject: s390x: Mark VRs as clobbered by helper calls X-Git-Tag: VALGRIND_3_16_0~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4ce6da03a8c886e1fab14eaa1f9b4f091308c3d;p=thirdparty%2Fvalgrind.git s390x: Mark VRs as clobbered by helper calls According to the s390x ABI, all vector registers are call-clobbered (except for their portions that overlap with the call-saved FPRs). But the s390x backend doesn't mark them as such when determining the register usage of helper call insns. Fix this in s390_insn_get_reg_usage when handling S390_INSN_HELPER_CALL. --- diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 43b89c9253..de267078e1 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -770,6 +770,11 @@ s390_insn_get_reg_usage(HRegUsage *u, const s390_insn *insn) addHRegUse(u, HRmWrite, s390_hreg_fpr(i)); } + /* Ditto for all allocatable vector registers. */ + for (i = 16; i <= 31; ++i) { + addHRegUse(u, HRmWrite, s390_hreg_vr(i)); + } + /* The registers that are used for passing arguments will be read. Not all of them may, but in general we need to assume that. */ for (i = 0; i < insn->variant.helper_call.details->num_args; ++i) {