This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RE: patch for presumed typo in boehm-gc/misc.c
- To: "'Per Bothner'" <per at bothner dot com>, tromey at redhat dot com
- Subject: RE: patch for presumed typo in boehm-gc/misc.c
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Thu, 5 Apr 2001 13:55:05 -0700
- Cc: java-patches at gcc dot gnu dot org, "Boehm, Hans" <hans_boehm at hp dot com>
Sorry about that. This is unfortunately a case of one bug hiding another.
The real problem is that random_no should have been declared static. Since
it wasn't, gcc -O usually manages to eliminate the branch of the if with the
erroneous GC_clear_stack_inner call, thus hiding the problem there. (I
suspect you were building without -O and the rest of us weren't. -O builds
probably work as it stands.)
I'll generate a patch that backs out most of this. I'll adjust the constant
in the stack clearing code, but basically revert it to what it was before.
Hans
> -----Original Message-----
> From: Per Bothner [mailto:per@bothner.com]
> Sent: Thursday, April 05, 2001 11:58 AM
> To: tromey@redhat.com
> Cc: java-patches@gcc.gnu.org; hans_boehm@hp.com
> Subject: Re: patch for presumed typo in boehm-gc/misc.c
>
>
> Well, my fix doesn't work. GC_clear_stack_inner is *also* not being
> defined. This is on Red Hat 7.0, on a i686. I guess the first
> question is: *should* GC_clear_stack_inner be defined?
>
> I configured with --enable-threads. I see in misc.c the following:
>
> #if defined(ASM_CLEAR_CODE) && !defined(THREADS)
> extern ptr_t GC_clear_stack_inner();
> #endif
>
> #if !defined(ASM_CLEAR_CODE) && !defined(THREADS)
> /* Clear the stack up to about limit. Return arg. */
> /*ARGSUSED*/
> ptr_t GC_clear_stack_inner(arg, limit)
> ptr_t arg;
> word limit;
> {
> ...
> }
> #endif
>
> So GC_clear_stack_inner is only defined if THREADS is defined. But
> GC_clear_stack calls GC_clear_stack_inner whether or not THREADS is
> defined (using two different pieces of code).
> --
> --Per Bothner
> per@bothner.com http://www.bothner.com/~per/
>