From 733aba84822efe101a098446079b4798f1b51faf Mon Sep 17 00:00:00 2001 From: Carl Love Date: Fri, 3 Sep 2021 17:14:50 +0000 Subject: [PATCH] Fix impossible constraint issue in P10 testcase. 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. https://bugs.kde.org/show_bug.cgi?id=440906 --- NEWS | 1 + none/tests/ppc64/test_isa_3_1_common.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5643be5e47..f869343326 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 439590 glibc-2.34 breaks suppressions against obj:*/lib*/libc-2.*so* 440670 unhandled ppc64le-linux syscall: 252 (statfs64) and 253 (fstatfs64) 432387 s390x: z15 instructions support +440906 Fix impossible constraint issue in P10 testcase. 441512 Remove a unneeded / unnecessary prefix check. To see details of a given bug, visit 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 @@ -2263,8 +2263,13 @@ void initialize_source_registers () { 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; } } -- 2.43.5