This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: IA64 HP-UX Unwind patch
- From: Richard Henderson <rth at redhat dot com>
- To: Steve Ellcey <sje at cup dot hp dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Wed, 14 Aug 2002 11:02:20 -0700
- Subject: Re: IA64 HP-UX Unwind patch
- References: <200208141745.KAA23953@hpsje.cup.hp.com>
On Wed, Aug 14, 2002 at 10:45:00AM -0700, Steve Ellcey wrote:
> The first is what _URC_ code does _Unwind_DeleteException call the
> cleanup routine with. HP uses _URC_NO_REASON and GCC uses
> _URC_FOREIGN_EXCEPTION_CAUGHT. My fix for this was to create
> _URC_EXPECTED_BY_CLEANUP in unwind.h and define it to
> _URC_FOREIGN_EXCEPTION_CAUGHT if it was not already defined and then use
> that in __gxx_exception_cleanup (libstdc++-v3/libsupc++/eh_throw.cc).
> Then I put my own definition of _URC_EXPECTED_BY_CLEANUP in
> libstdc++-v3/config/os/hpux/os_defines.h for HP-UX.
This, IMO, is a bug in the HPUX library. Section 1.4
"If a given runtime resumes normal execution after catching a
foreign exception..."
Anyway, it's not worth adding macros for this. Instead, modify
the two places to expect *both* _URC_FOREIGN_EXCEPTION_CAUGHT
and _URC_NO_REASON, with a comment about the different behaviour
of the hpux library.
> The second problem is with _Unwind_SetIP. Even in ILP32 mode, the HP-UX
> Unwind library expects you to pass in a 64 bit pointer on IA64. So, I
> created a macro in os_defines.h called UNWIND_SETIP to use instead of
> calling _Unwind_SetIP if it is defined. I also ifdef'ed the
> _Unwind_SetIP declaration in unwind.h so I could have my own version in
> os_defines.h with different arg types.
Good lord.
How does the function call ABI work? If we changed the prototype
to a void* would it work? I really dislike this part of the patch.
> + extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned __attribute__((__mode__(__word__))));
In any case, this is _Unwind_Word.
r~