g++ and aliasing bools

Dan Nicolaescu dann@ics.uci.edu
Sun Jan 27 17:04:00 GMT 2002


Joe Buck <jbuck@synopsys.com> writes:

  > > 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.


The above code is intended to be very conservative, to make g++
compile C code at least as good as gcc does 
(see  http://gcc.gnu.org/ml/gcc/2002-01/msg01478.html)

We can relax the checks ss soon as we convinve ourselves that more
cases are acceptable. 
Is a patch like this acceptable at this point, or should I wait until
3.1 branches? 



More information about the Gcc mailing list