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: BC ABI: Don't initialize vtable pointer


Andrew Haley writes:
 > Bryce McKinlay writes:
 >  > Andrew Haley wrote:
 >  > > +  volatile jclass new_class
 >  > > +    = (jclass)_Jv_AllocObj (sizeof (java::lang::Class),
 >  > > +			    &java::lang::Class::class$);
 >  > > +  const char *src = class_initializer + sizeof (void*);
 >  > > +  volatile char *dst = (volatile char*)new_class + sizeof (void*);
 >  > >   
 >  > Why "volatile" ?
 > 
 > Aliasing.  The same object is being accessed as java::lang::Class and
 > as void*.

I take that back.  I'm thinking about an earlier version of this code
that actually had an aliasing issue.  I rewrote it to make the
aliasing go away, but I left in the volatile.  I'l fix it before I
check it in.

Andrew.


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