MIPS Wrong-code regression.
David Daney
ddaney@avtrex.com
Thu Feb 1 16:00:00 GMT 2007
Andrew Haley wrote:
> David Daney writes:
> > Tom Tromey wrote:
> > >>>>>> "David" == David Daney <ddaney@avtrex.com> writes:
> > >
> > > David> The call to _ZN4java4lang6ObjectC1Ev is being generated as non-pic,
> > > David> even though that symbol is defined in libgcj.so. The assembler and
> > > David> linker conspire to jump to address 0x00000000 for this call.
> > >
> > > Could also be the problem reported at the end of:
> > >
> > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30606
> > >
> > > Tom
> >
> > I suspect it is the same problem. APH's patch would not have fixed it
> > if it were.
>> OK. Does your patch work? If it does, I'm going to trace through jc1
> to see if I can find the real origin of this regression.
>>I am testing a new patch that (I think) fixes the real problem. I am
not sure why it regressed as Richard added the code that was being made
to fail last March. The bad code was in class.c when green committed it
over 8 years ago. Several months ago Tromey removed it and then added
it back a few days later.
The problem is that in is_compiled_class() we were erroneously saying
that a candidate class was being emitted to the object file *if* it was
the current_class being parsed. This does not hold because many classes
are parsed that are not emitted so that jc1 can calculate the class
layout and load the symbol tables.
The real fix,I think, is the one I made to is_compiled_class(). I left
the change to layout_class_method() where we don't re-check for
DECL_EXTERNAL if it is already set as a micro-optimization. I tested
both with and without this and obtained correct results, so it is not
really needed.
I also wonder if your previous patch setting DECL_EXTERNAL is still
needed after this has been applied. I didn't check.
I am currently regression testing the attached patch on
x86_64-pc-linux-gnu, and will post it to gcc-patches@ if it passes.
David Daney.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class.c.diff
Type: text/x-patch
Size: 1792 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20070201/bded8c58/attachment.bin>
More information about the Java
mailing list