Message ID | CABc96T-R-TY=T0KrnedV0hSyhLoa1=vuc_P9jwJ_gmEz4QjfJg@mail.gmail.com |
---|---|
State | New |
Headers | show |
>>>>> "Jie" == Jie Liu <lj8175@gmail.com> writes:
Jie> + *-*-rtems*)
Jie> + can_unwind_signal=no
Jie> + CHECKREFSPEC=-fcheck-references
Jie> + DIVIDESPEC=-fuse-divide-subroutine
Jie> + ;;
This part is OK with a ChangeLog entry.
Jie> +
Spurious newline addition.
Jie> But it does not work as we want, is there something wrong?
Did you rebuild all of libgcj?
If you did, then I don't know, you'll have to debug it, sorry.
I vaguely recollect that -fcheck-references adds a check for 'this' at
the start of final methods. If I'm misremembering, then that is
probably the problem.
Tom
> Jie> But it does not work as we want, is there something wrong? > > Did you rebuild all of libgcj? Yes. :) > > If you did, then I don't know, you'll have to debug it, sorry. > > I vaguely recollect that -fcheck-references adds a check for 'this' at > the start of final methods. If I'm misremembering, then that is > probably the problem. > The method length() is not a final method, as java/lang/String.java line 447: public int length() { return count; } Is this the problem? Thanks, Jie > Tom >
On Fri, Aug 12, 2011 at 8:27 AM, Jie Liu <lj8175@gmail.com> wrote: > The method length() is not a final method, as java/lang/String.java line 447: > > public int length() > { > return count; > } > > Is this the problem? As String is a final class, all its methods are implicitly final. Bryce
> If you did, then I don't know, you'll have to debug it, sorry. > > I vaguely recollect that -fcheck-references adds a check for 'this' at > the start of final methods. If I'm misremembering, then that is > probably the problem. In my debug, there appears no check for 'this' at start of String.length(): (gdb) s java::lang::VMDouble::parseDouble (str=0x0) at ../../../gcc-trunk/libjava/java/lang/natVMDouble.cc:165 165 int length = str->length(); (gdb) s java.lang.String.length()int (this=@336e44) at /mnt/gcj/gcj-rtems-work/gcc-trunk/libjava/java/lang/String.java:451 451 return count; (gdb) p count $5 = -268370093 (gdb) p this $6 = (java.lang.String *) 0x0 Thanks, Jie
>>>>> "Jie" == Jie Liu <lj8175@gmail.com> writes:
Jie> In my debug, there appears no check for 'this' at start of String.length():
Yeah, I looked for uses of flag_check_references and didn't see one when
building a method's body. So I guess I mis-remembered this.
In any case, the spot you found is just the tip of the problem. Any
method call in any of the C++ code could potentially have the same
issue.
Tom
Index: configure.host =================================================================== --- configure.host (revision 172224) +++ configure.host (working copy) @@ -347,8 +347,14 @@ slow_pthread_self= can_unwind_signal=yes ;; + *-*-rtems*) + can_unwind_signal=no + CHECKREFSPEC=-fcheck-references + DIVIDESPEC=-fuse-divide-subroutine + ;; esac + case "${host}" in *-cygwin* | *-mingw*) fallback_backtrace_h=sysdep/i386/backtrace.h