From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1938B3838001; Mon, 26 Apr 2021 23:59:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1938B3838001 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/98952] powerpc*: __trampoline_setup inverted test for trampoline size Date: Mon, 26 Apr 2021 23:59:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: meissner at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 23:59:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98952 --- Comment #6 from CVS Commits --- The releases/gcc-9 branch has been updated by Michael Meissner : https://gcc.gnu.org/g:39f46514ca8a78a0fc2e1e0a73d0934fe515a78d commit r9-9467-g39f46514ca8a78a0fc2e1e0a73d0934fe515a78d Author: Michael Meissner Date: Mon Apr 26 19:58:45 2021 -0400 [PATCH] Backport fix for PR target/98952 The test in the PowerPC 32-bit trampoline support is backwards. It abo= rts if the trampoline size is greater than the expected size. It should ab= ort when the trampoline size is less than the expected size. I fixed the t= est so the operands are reversed. I then folded the load immediate into the compare instruction. I verified this by creating a 32-bit trampoline program and manually changing the size of the trampoline to be 48 instead of 40. The program aborted with the larger size. I updated this code and ran the test aga= in and it passed. I added a test case that runs on PowerPC 32-bit Linux systems and it ca= lls the __trampoline_setup function with a larger buffer size than the compiler uses. The test is not run on 64-bit systems, since the functi= on __trampoline_setup is not called. I also limited the test to just Linux systems, in case trampolines are handled differently in other systems. libgcc/ 2021-04-26 Michael Meissner PR target/98952 * config/rs6000/tramp.S (__trampoline_setup, elfv1 #ifdef): Fix trampoline size comparison in 32-bit by reversing test and combining load immediate with compare. Fix backported from tru= nk change on 4/23, 886b6c1e8af502b69e3f318b9830b73b88215878. (__trampoline_setup, elfv2 #ifdef): Fix trampoline size compari= son in 32-bit by reversing test and combining load immediate with compare. gcc/testsuite/ 2021-04-26 Michael Meissner PR target/98952 * gcc.target/powerpc/pr98952.c: New test. Test backported from trunk change on 4/23, 886b6c1e8af502b69e3f318b9830b73b88215878.=