public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95571] New: xtensa stack unwinding doesn't work well with asynchronous register spilling
@ 2020-06-08  7:25 jcmvbkbc at gcc dot gnu.org
  2020-06-08  7:33 ` [Bug target/95571] " jcmvbkbc at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jcmvbkbc at gcc dot gnu.org @ 2020-06-08  7:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95571

            Bug ID: 95571
           Summary: xtensa stack unwinding doesn't work well with
                    asynchronous register spilling
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jcmvbkbc at gcc dot gnu.org
  Target Milestone: ---

Xtensa architecture with variable register windows store registers of the
spilled register windows in two separate locations: registers a0-a3 of the
current function caller are stored right below the stack pointer of current
function in the location known as a base save area, and the registers a4-a7 (or
a4-a11) are stored in the top of the caller's stack frame in a location known
as an extra save area, right under the base save area of is own caller. To
spill or restore registers a4-a7/a11 of the function its caller stack pointer
is used to find its extra save area.

Interrupt handlers on bare metal xtensa targets spill registers of all active
register windows in the interrupted code except the current topmost window.

Stack unwinding code for xtensa copies base save area of the context being
installed into the base save area under the _Unwind_RaiseException stack
pointer so that return from _Unwind_RaiseException reload registers of that
context. However when it happens in a function called from
_Unwind_RaiseException an interrupt can spill registers of the
_Unwind_RaiseException to its extra save area. The location of this area is
lost once base save area under the _Unwind_RaiseException stack pointer is
overwritten resulting in bogus values being reloaded into registers a4-a7
usually resulting in a crash.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-09  1:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08  7:25 [Bug target/95571] New: xtensa stack unwinding doesn't work well with asynchronous register spilling jcmvbkbc at gcc dot gnu.org
2020-06-08  7:33 ` [Bug target/95571] " jcmvbkbc at gcc dot gnu.org
2020-06-08  8:07 ` jcmvbkbc at gcc dot gnu.org
2020-06-09  1:44 ` cvs-commit at gcc dot gnu.org
2020-06-09  1:49 ` jcmvbkbc at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).