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]

Re: libjava gcc-3_0-branch, klass timing out in testsuite again



On Fri, 4 May 2001, Gordon Sadler wrote:
> For a more thorough look at what happenned for me on i686 last
> time, please see:
> http://gcc.gnu.org/ml/gcc/2001-04/msg00663.html
> http://gcc.gnu.org/ml/gcc/2001-04/msg00676.html

Your stack trace looks a lot like mine, minus line number information.

Clue #1 is that it aborts in clone(), but line 8 calls equals(),
not clone().  Clue #2 is that the class pointer (actually first word
of the vtable) doesn't point to a class at all.

That is, it behaves exactly as if these lines in Class.h do nothing:

    // C++ ctors set the vtbl pointer to point at an offset inside the
vtable
    // object. That doesn't work for Java, so this hack adjusts it back.
    void *p =  ((void **)this)[0];
    ((void **)this)[0] = (void *)((char *)p-2*sizeof (void *));
 
Rebuilding libjava with -fno-strict-aliasing is the quick fix:

PASS: klass compilation from source
PASS: klass execution from source compiled test
PASS: klass output from source compiled test

Can some C++ person comment on the code fragment above in terms of
aliasing?

Jeff


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