From 0378dd3a632b0d577239a3226360727d9cf5ea70 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Feb 08 2022 16:46:26 +0000 Subject: Add valgrind-3.18.1-ppc64-cmov.patch --- diff --git a/valgrind-3.18.1-ppc64-cmov.patch b/valgrind-3.18.1-ppc64-cmov.patch new file mode 100644 index 0000000..9e5ee62 --- /dev/null +++ b/valgrind-3.18.1-ppc64-cmov.patch @@ -0,0 +1,33 @@ +commit fb6a77ed78876083e8ba4c2f92384db5c2e41be8 +Author: Mark Wielaard +Date: Tue Feb 8 16:36:08 2022 +0100 + + ppc64 --track-origins=yes failure because of bad cmov addHRegUse + + For Pin_CMov getRegUsage_PPCInstr called addHRegUse for the dst + register with HRmWrite, but since this is a conditional move the + register could be both read and written (read + write = modify). + This matches the dst of Pin_FpCMov and Pin_AvCMov. + + In a very rare case, and only with --track-origins=yes, this + could cause bad code generation. + + This is slightly amazing, this code is from 2005 and as far as + I know we never seen an issue with --track-origins=yes on power + before. And I have been unable to come up simple reproducer. + + https://bugs.kde.org/show_bug.cgi?id=449672 + +diff --git a/VEX/priv/host_ppc_defs.c b/VEX/priv/host_ppc_defs.c +index 3ae0f6e08..4222b4786 100644 +--- a/VEX/priv/host_ppc_defs.c ++++ b/VEX/priv/host_ppc_defs.c +@@ -2590,7 +2590,7 @@ void getRegUsage_PPCInstr ( HRegUsage* u, const PPCInstr* i, Bool mode64 ) + return; + case Pin_CMov: + addRegUsage_PPCRI(u, i->Pin.CMov.src); +- addHRegUse(u, HRmWrite, i->Pin.CMov.dst); ++ addHRegUse(u, HRmModify, i->Pin.CMov.dst); + return; + case Pin_Load: + addRegUsage_PPCAMode(u, i->Pin.Load.src); diff --git a/valgrind.spec b/valgrind.spec index 7dded8b..340b727 100644 --- a/valgrind.spec +++ b/valgrind.spec @@ -140,6 +140,9 @@ Patch21: valgrind-3.18.1-ppc-hwcaps.patch # KDE#447991 s390x: Valgrind indicates illegal instruction on wflrx Patch22: valgrind-3.18.1-s390x-wflrx.patch +# KDE#449672 ppc64 --track-origins=yes failure because of bad cmov addHRegUse +Patch23: valgrind-3.18.1-ppc64-cmov.patch + BuildRequires: make BuildRequires: glibc-devel @@ -294,6 +297,7 @@ Valgrind User Manual for details. %patch20 -p1 %patch21 -p1 %patch22 -p1 +%patch23 -p1 %build # LTO triggers undefined symbols in valgrind. Valgrind has a --enable-lto @@ -523,6 +527,9 @@ fi %endif %changelog +* Tue Feb 8 2022 Mark Wielaard +- Add valgrind-3.18.1-ppc64-cmov.patch + * Sat Jan 22 2022 Fedora Release Engineering - 1:3.18.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild