This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++ and aliasing bools
- From: Joe Buck <jbuck at synopsys dot COM>
- To: dann at godzilla dot ics dot uci dot edu (Dan Nicolaescu)
- Cc: mark at codesourcery dot com (Mark Mitchell),dan at dberlin dot org (Daniel Berlin), gcc at gcc dot gnu dot org (gcc at gcc dot gnu dot org)
- Date: Fri, 25 Jan 2002 18:10:41 -0800 (PST)
- Subject: Re: g++ and aliasing bools
> I bootstrapped this version on sparc-sun-solaris2.8:
>
> {
> if (AGGREGATE_TYPE_P (t) &&
> !((TREE_CODE (t) == RECORD_TYPE)
> && !CLASSTYPE_NON_POD_P(t)
> && !CLASSTYPE_N_BASECLASSES(t)))
> return 0;
> }
CLASSNAME_NON_POD_P returns false if there are any methods or if there
is a constructor or destructor, right? If so, then I think we're going
to get little gain: much of the payoff from better aliasing in C++ will
come if we don't get false aliasing complaints for things like STL
iterators. At least in my code, I don't have many NON_PODs; even if
it's a plain struct otherwise, I use a constructor to initialize it.
On the other hand, some of the STL iterators are derived classes. Sigh.