This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: _Unwind_RaiseException problem
- To: Jason Merrill <jason_merrill at redhat dot com>
- Subject: Re: _Unwind_RaiseException problem
- From: Richard Henderson <rth at redhat dot com>
- Date: Wed, 25 Apr 2001 14:58:58 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <m3zod4lx6l.fsf@prospero.cambridge.redhat.com>
On Wed, Apr 25, 2001 at 06:13:38PM +0100, Jason Merrill wrote:
> It seems that using __builtin_eh_return currently breaks normal return from
> a function on the x86, so if unwind doesn't find a handler it tries to
> return to __cxa_throw and ends up in the middle of nowhere.
Fixed thus.
r~
* config/i386/i386.c (ix86_expand_epilogue): Properly compute size
of registers to restore along non eh_return path.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.254
diff -c -p -d -r1.254 i386.c
*** i386.c 2001/04/25 09:51:25 1.254
--- i386.c 2001/04/25 21:55:13
*************** ix86_expand_epilogue (style)
*** 2591,2598 ****
ix86_compute_frame_layout (&frame);
! /* Calculate start of saved registers relative to ebp. */
! offset = -frame.nregs * UNITS_PER_WORD;
#ifdef FUNCTION_BLOCK_PROFILER_EXIT
if (profile_block_flag == 2)
--- 2591,2604 ----
ix86_compute_frame_layout (&frame);
! /* Calculate start of saved registers relative to ebp. Special care
! must be taken for the normal return case of a function using
! eh_return: the eax and edx registers are marked as saved, but not
! restored along this path. */
! offset = frame.nregs;
! if (current_function_calls_eh_return && style != 2)
! offset -= 2;
! offset *= -UNITS_PER_WORD;
#ifdef FUNCTION_BLOCK_PROFILER_EXIT
if (profile_block_flag == 2)