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]

Re: g++ and aliasing bools


On Fri, 25 Jan 2002, Mark Mitchell wrote:

> > Let's proceed in another way.  I think that, for the purpose of Dan's
> > proof, he should be allowed to accept as a postulate that c_get_alias_set
> > is correct when applied to C.  If this postulate is not acceptable,
> > then it seems that if someone owes us a proof, it is Mark, not Daniel.
> > However, c_get_alias_set has been there long enough that we have
> > reasonable confidence in it.
> 
> Agreed.
> 
> > I think it's also fair to assume as a postulate that the current
> > conservative cxx_get_alias_set is safe.  Again, long experience.
> 
> Agreed.
> 
> > cxx_get_alias_set ()
> > {
> > 	if (AGGREGATE_TYPE && HAS_BASECLASSES && HAS_VIRTUALS)
> > 		return 0;
> > 	return c_get_alias_set();
> > }
> >
> 
> > While this is not a formal proof, it's enough to convince me that Daniel's
> > change is safe.
> 
> Your proof has at least one bug.  A type that has no baseclasses or
> virtuals can contain (as a data member) a type that does; such a type
> is at least as complex as the contained type.

However, that type would have alias set 0 already, because it would have 
failed the above test.  So any accesses to something inside of it would be 
assumed to alias everything else anyway.


--Dan


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