SUMMARY Due to a GCC issue (PR101882) seen against recent GCC builds, we want to rework our code to avoid attempting a modulo operation with both the input and output defined as a hard register. ra is earlier defined as register uint64_t ra __asm__ ("r20"); and current code attempts a ra = ra % 9; In this case, we can apply the modulo operation to the args[] array value that was previously used to initialize the ra value. ra = args[vrai] % 9; Patch attached. STEPS TO REPRODUCE 1. Build valgrind for power9 or power10 using a recent (~ Aug 2021) GCC. 2. See "impossible constraint" error emitted from GCC. 3. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Created attachment 140674 [details] proposed patch to rework modulo operation
FYI, issue initially seen with the gcc compiler in the AT at-next-16.0-0-alpha build. Issue reproduced using a build of the GCC compiler from the mainline gcc tree.
Proposed patch reviewd, tested and committed. commit 733aba84822efe101a098446079b4798f1b51faf (HEAD -> master, origin/master, origin/HEAD) Author: Carl Love <cel@us.ibm.com> Date: Fri Sep 3 17:14:50 2021 +0000 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
patch committed closing