This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/49146] segv from libgcc_s when raising an exception, or unwinding stack with backtrace


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49146

--- Comment #2 from Ariel Burton <ariel.burton at roguewave dot com> 2011-05-24 17:31:22 UTC ---
f and f_ms_abi are identical with the exception that f_ms_abi
is annoted with __attribute__((ms_abi)). This causes the compiler
to emit code to save registers not otherwise saved.  The DWARF
thus also contains directives for these registers.

I believe that the problem is that the arrays of registers in
struct _Unwind_Context and _Unwind_FrameState *fs are too small
to accommodate the higher-numbered registers saved in the prologues
of the ms_abi annotated functions.

This change made the segv go away:

*** src/gcc-4.6.0/gcc/config/i386/i386.h        2011-05-18 22:43:30.642575000
-0400
--- tmp/gcc-4.6.0/gcc/config/i386/i386.h        2011-01-14 16:03:22.000000000
-0500
***************
*** 889,899 ****
  #define FIRST_PSEUDO_REGISTER 53

  /* Number of hardware registers that go into the DWARF-2 unwind info.
     If not defined, equals FIRST_PSEUDO_REGISTER.  */

! // #define DWARF_FRAME_REGISTERS 17

  /* 1 for registers that have pervasive standard uses
     and are not available for the register allocator.
     On the 80386, the stack pointer is such, as is the arg pointer.

--- 889,899 ----
  #define FIRST_PSEUDO_REGISTER 53

  /* Number of hardware registers that go into the DWARF-2 unwind info.
     If not defined, equals FIRST_PSEUDO_REGISTER.  */

! #define DWARF_FRAME_REGISTERS 17

  /* 1 for registers that have pervasive standard uses
     and are not available for the register allocator.
     On the 80386, the stack pointer is such, as is the arg pointer.


However, the wrong backtrace remained.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]