This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11222] New: arm/thumb __Unwind_SjLj_Register prologue optimization causes crash on interrupts
- From: "mrbolha at ukonline dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jun 2003 15:08:34 -0000
- Subject: [Bug optimization/11222] New: arm/thumb __Unwind_SjLj_Register prologue optimization causes crash on interrupts
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11222
Summary: arm/thumb __Unwind_SjLj_Register prologue optimization
causes crash on interrupts
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mrbolha@ukonline.co.uk
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: -O2 -fexceptions -mthumb
GCC host triplet: i686-pc-cygwin
GCC target triplet: arm-elf-gcc
The generated code for thumb instruction set with -O2 optimization, when using
exceptions, has the "sub sp" instruction (ergo the allocation of local
variables) called after data manipulation on the local vars in the stack
unwinding prologue, which causes data to be corrupted on the event of an
interruption.
NOTE: it was so in Ecos, because it switches the processor mode back to
supervisor, causing the same stack pointer to be used both in the running thread
and the interrupt handler.