Add valgrind-3.17.0-ppc64-test-isa-3-1.patch

This commit is contained in:
Mark Wielaard 2021-08-25 16:10:44 +02:00
parent defd9797da
commit b35e0b892c
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,38 @@
commit 60ff013998de8aa168e01b7b1c1743bcbdee99b1
Author: Will Schmidt <will_schmidt@vnet.ibm.com>
Date: Thu Aug 12 15:41:50 2021 -0500
Hi
This reworks the modulo operation as seen in
valgrind/none/tests/ppc64/test_isa_3_1_common.c:
initialize_source_registers(). Due to a GCC issue (PR101882), we
will try to avoid a modulo operation with both input and outputs set to
a hard register.
In this case, we can apply the modulo operation to the args[] array
value used to initialize the ra value.
diff --git a/none/tests/ppc64/test_isa_3_1_common.c b/none/tests/ppc64/test_isa_3_1_common.c
index 8222a857fc..7c3dc6f009 100644
--- a/none/tests/ppc64/test_isa_3_1_common.c
+++ b/none/tests/ppc64/test_isa_3_1_common.c
@@ -2261,12 +2261,17 @@ void initialize_source_registers () {
if (has_rb) rb = 2*vrbi;
/* note special case for is_insert_double, see set_up_iterators () */
if (has_ra) ra = 4*vrai;
if (is_insert_double) {
/* For an insert_double, the results are undefined
- for ra > 8, so modulo those into a valid range. */
- ra = ra % 9;
+ for ra > 8, so modulo those into a valid range.
+ Since ra is defined as a hard register, and due to gcc
+ issue (PR101882) where a modulo operation fails with
+ both input and output regs set to a hard register, this
+ assignment references the args[] array again, versus
+ ra = ra % 9;. */
+ ra = args[vrai] % 9;
}
}
if (uses_buffer) {
if (has_rb) {

View File

@ -166,6 +166,9 @@ Patch18: valgrind-3.17.0-ppc64-statfs64.patch
# KDE#441474 vgdb might eat all memory while waiting for sigstop
Patch19: valgrind-3.17.0-vgdb-queued-signals.patch
# KDE#440906 update test_isa_3_1_common.c to avoid modulo against hard regs
Patch20: valgrind-3.17.0-ppc64-test-isa-3-1.patch
BuildRequires: make
BuildRequires: glibc-devel
@ -324,6 +327,7 @@ touch memcheck/tests/s390x/vistr.stdout.exp
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%build
# LTO triggers undefined symbols in valgrind. Valgrind has a --enable-lto
@ -551,6 +555,7 @@ fi
%changelog
* Wed Aug 25 2021 Mark Wielaard <mjw@fedoraproject.org>
- Add valgrind-3.17.0-vgdb-queued-signals.patch
- Add valgrind-3.17.0-ppc64-test-isa-3-1.patch
* Fri Aug 6 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-11
- Add valgrind-3.17.0-ppc64-statfs64.patch