This is the mail archive of the gcc-patches@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: [tree-ssa] Fix problems with void * and GIMPLE typecasts [patch]


Jeff Sturm writes:
 > On Sun, 21 Sep 2003, Andrew Haley wrote:
 > > Jason Merrill writes:
 > >  > On Sat, 20 Sep 2003 18:21:44 -0400 (EDT), Jeff Sturm <jsturm@one-point.com> wrote:
 > >  >
 > >  > > On Fri, 19 Sep 2003, Diego Novillo wrote:
 > >  > >> OK, so the solution in this case would be for the Java FE to consider
 > >  > >> the two types as having conflicting alias sets?
 > >  > >
 > >  > > Yes.  Given the existing mechanisms, I don't know how to do that without
 > >  > > conservatively placing all Java class types in alias set zero.
 > >  >
 > >  > I think you want to use the subset code in alias.c.  It's not clear to me
 > >  > why the default get_alias_set code doesn't do what you want.
 > >
 > > Me neither.  Java uses simple single inheritance, so whatever C++ uses
 > > should work correctly.
 > 
 > Indeed, but Java doesn't use C++'s get_alias_set langhook.  I created the
 > patch because I thought the langhook omission was by accident.
 > 
 > Jason mentioned that C++ abandons alias analysis on types with
 > virtual base classes:
 > 
 > /* Check if a C++ type is safe for aliasing.
 >    Return TRUE if T safe for aliasing FALSE otherwise.  */
 > 
 > static bool
 > ok_to_generate_alias_set_for_type (tree t)
 > {
 >   ...
 >           /* Classes with virtual baseclasses are not.  */
 >           if (TYPE_USES_VIRTUAL_BASECLASSES (t))
 >             return false;
 > 
 > I have no idea why this is needed, but thought Java might need the same.

It's probably because the C++ people haven't yet written alias
analysis code for virtual base classes.  But Java's single inheritance
mechanism is the simple case, and doesn't need all the complexity due
to multiple inheritance.

Andrew.


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