]> gcc.gnu.org Git - gcc.git/commit
[PATCH] Backport fix for PR target/98952
authorMichael Meissner <meissner@linux.ibm.com>
Tue, 27 Apr 2021 02:45:02 +0000 (22:45 -0400)
committerMichael Meissner <meissner@linux.ibm.com>
Tue, 27 Apr 2021 02:45:02 +0000 (22:45 -0400)
commita633f7f96daac391fe0bc5d87427c0e7cf1ab1b3
tree21f6ace0f1f90cdf1d55a70d2ff2a9f33111a891
parentdc2e26fad8cc35dfb7a00f2bd758fd7b799f3107
[PATCH] Backport fix for PR target/98952

The test in the PowerPC 32-bit trampoline support is backwards.  It aborts
if the trampoline size is greater than the expected size.  It should abort
when the trampoline size is less than the expected size.  I fixed the test
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 again
and it passed.

I added a test case that runs on PowerPC 32-bit Linux systems and it calls
the __trampoline_setup function with a larger buffer size than the
compiler uses.  The test is not run on 64-bit systems, since the function
__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  <meissner@linux.ibm.com>

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 trunk
change on 4/23, 886b6c1e8af502b69e3f318b9830b73b88215878.
(__trampoline_setup, elfv2 #ifdef): Fix trampoline size comparison
in 32-bit by reversing test and combining load immediate with
compare.

gcc/testsuite/
2021-04-26  Michael Meissner  <meissner@linux.ibm.com>

PR target/98952
* gcc.target/powerpc/pr98952.c: New test.  Test backported from
trunk change on 4/23, 886b6c1e8af502b69e3f318b9830b73b88215878.
gcc/testsuite/gcc.target/powerpc/pr98952.c [new file with mode: 0644]
libgcc/config/rs6000/tramp.S
This page took 0.06188 seconds and 6 git commands to generate.