This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/65416] xtensa: memory allocated by alloca is used before the stack pointer is updated
- From: "jcmvbkbc at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Jun 2018 18:26:39 +0000
- Subject: [Bug target/65416] xtensa: memory allocated by alloca is used before the stack pointer is updated
- Auto-submitted: auto-generated
- References: <bug-65416-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65416
--- Comment #3 from jcmvbkbc at gcc dot gnu.org ---
Author: jcmvbkbc
Date: Tue Jun 19 18:26:07 2018
New Revision: 261755
URL: https://gcc.gnu.org/viewcvs?rev=261755&root=gcc&view=rev
Log:
xtensa: fix PR target/65416
The issue is caused by reordering of stack pointer update after stack
space allocation with instructions that write to the allocated stack
space. In windowed ABI register spill area for the previous call frame
is located just below the stack pointer and may be reloaded back into
the register file on movsp.
Implement allocate_stack pattern for windowed ABI configuration and
insert an instruction that prevents reordering of frame memory access
and stack pointer update.
gcc/
2018-06-19 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec
constant.
(allocate_stack, frame_blockage, *frame_blockage): New patterns.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/xtensa/xtensa.md