This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: V3 patch causes EH failures in ILP32 mode
- From: "B. Kosnik" <bkoz at nabi dot net>
- To: mark at codesourcery dot com
- Cc: zack at codesourcery dot com, libstdc++ at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Wed, 23 Jun 2004 13:19:16 -0500
- Subject: Re: V3 patch causes EH failures in ILP32 mode
- References: <200406231741.i5NHfZbO019592@sirius.codesourcery.com>
>you added seemingly pointless implementations of __upcast_result's
>copy constructor and assignment operator; these versions are almost
>identical to the implicit definitions. On HP-UX in ILP32 mode, this
>change is causing several G++ testsuite failures relating to upcasts
>during EH processing.
Wow.
Well, I added these so that -Weffc++ could be used in CXXFLAGS while
building libstdc++. This was a longstanding issue w/ v3 that was an
annoyance to several C++ maintainers (myself included, naturally!).
I wasn't expecting any issues like this to surface.
This seems like a potentially serious codegen problem, but I'll let you
do a full analysis. Is this in bugzilla? If you'd like to temporarily
revert this patch on the release branch, as an aid in fixing the codegen
problem, I'm for it.
Just out of curiosity, can't you also change this (AFAICT) textbook C++
to something that doesn't check for self, and produce equivalent code to
the implicitly generated functions? If not, is there a way to produce
equivalent code with explicit definitions? I'm surprised that there's
such a difference: can you humor me with additional details?
best,
benjamin
// __upcast_result is used to hold information during traversal of a class
// hierarchy when catch matching.
struct __class_type_info::__upcast_result
{
const void *dst_ptr; // pointer to caught object
__sub_kind part2dst; // path from current base to target
int src_details; // hints about the source type hierarchy
const __class_type_info *base_type; // where we found the target,
// if in vbase the __class_type_info of vbase
// if a non-virtual base then 1
// else NULL
__upcast_result (int d)
:dst_ptr (NULL), part2dst (__unknown), src_details (d), base_type (NULL)
{}
explicit
__upcast_result(const __upcast_result& r)
: dst_ptr(r.dst_ptr), part2dst(r.part2dst), src_details(r.src_details),
base_type(r.base_type)
{ }
__upcast_result&
operator=(const __upcast_result& r)
{
if (&r != this)
{
dst_ptr = r.dst_ptr;
part2dst = r.part2dst;
src_details = r.src_details;
base_type = r.base_type;
}
return *this;
}
};