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]

EH vs. register windows


I've looked a bit more at c++/4012.  It has to do with the failings of
exception handling on SPARC.  My finding is that registers r24 and r25 are
corrupt on entry to a handler.  Both are callee-saved according to the
ABI.

Everything is OK up until these statements in __gxx_personality_v0:

  _Unwind_SetGR (context, __builtin_eh_return_data_regno (0),
                 (_Unwind_Ptr) &xh->unwindHeader);
  _Unwind_SetGR (context, __builtin_eh_return_data_regno (1),
                 handler_switch_value);
  _Unwind_SetIP (context, landing_pad);
  return _URC_INSTALL_CONTEXT;

These clobber r24 and r25, which surely are return value registers, but
not in the target context.  Indeed, the registers I need to modify aren't
anywhere in the target stack frame.  They are input registers of the
called function.  I need to somehow assign r24/r25 prior to a window
restore.

Unfortunately I have no idea how to fix this.  Doesn't GCC have other
targets with register windows?  What do they do?

Jeff


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