[Bug target/77687] frame access after release without redzone on powerpc
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 20 21:49:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77687
--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Wed Sep 20 21:48:31 2017
New Revision: 253033
URL: https://gcc.gnu.org/viewcvs?rev=253033&root=gcc&view=rev
Log:
rs6000: Don't touch below the stack pointer (PR77687)
With the 32-bit SVR4 ABI we don't have a red zone, so we have to restore
the callee-saved registers before we restore the stack pointer.
The previous fix for this PR failed in two ways, for huge frames: first,
we use a negative offset from r11 in that case, so the (mem:BLK 11) access
does no good; second, sched does not handle accesses to mem:BLK correctly
in this case (does not make dependencies).
This patch fixes it by doing a store to (mem:BLK (scratch)) instead.
This means no unrelated (not to stack) loads/stores can be moved over the
stack restore either, but so be it.
PR target/77687
* config/rs6000/rs6000.md (stack_restore_tie): Store to a scratch
address instead of to r1 and r11.
gcc/testsuite/
PR target/77687
* gcc.target/powerpc/pr77687.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.target/powerpc/pr77687.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.md
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list