This is the mail archive of the gcc@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]

C++ Unwind question (IA64 HP-UX)


On the IA64 HP-UX platform I have been building C++ to use HP's unwind
library instead of building the unwind code into libgcc.  This seems to
be working well and minimizes the differences between HP C++ and G++.

I have run into one issue though and before submitting a patch I thought
I would run it by folks to see if this is a bug or just a difference
that needs to be dealt with.

The problem is that the GNU and HP versions of _Unwind_DeleteException
are slightly different in that the GNU version calls the cleanup routine
(__gxx_exception_cleanup in libstdc++) with the constant
_URC_FOREIGN_EXCEPTION_CAUGHT as the first argument and the HP version
passes the constant _URC_NO_REASON as the first argument.

Is there a "correct" argument to be passing?  I looked at the IA64
exception handling ABI but that didn't make it clear to me if there
was a correct argument to be passing.

Currently I have a change in gcc/unwind.h to set a new macro:

#ifdef __ia64__
#ifdef __hpux__
#define _URC_EXPECTED_BY_CLEANUP _URC_NO_REASON
#endif
#endif

And then modified libstdc++-v3/libsupc++/eh_throw.cc
to add:

#ifndef _URC_EXPECTED_BY_CLEANUP
#define _URC_EXPECTED_BY_CLEANUP _URC_FOREIGN_EXCEPTION_CAUGHT
#endif

and changed __gxx_exception_cleanup to check for _URC_EXPECTED_BY_CLEANUP
instead of _URC_FOREIGN_EXCEPTION_CAUGHT.

I don't know if this change is acceptable or if there is a better way to
handle it but it was the best I could come up with due to the lack of
includes in unwind.h which I think is used when building the compiler
and libgcc and libstdc++-v3.

If it looks OK I can do a formal patch but if anyone has a better idea
for handling or fixing this difference I would be interested in their
opinion.

Steve Ellcey
sje@cup.hp.com


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