gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: gcc-3.3 bugs Debian unstable hppa


From: Camm Maguire
Subject: [Gcl-devel] Re: gcc-3.3 bugs Debian unstable hppa
Date: 08 Mar 2004 07:27:59 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  GCL can mark the C stack via a simple heuristic algorithm
given its bottom (taken at program start) and top (at point of GBC
marking).  It cannot mark items in registers, so it must flush the
registers to the C stack first.  This is typically done with setjmp,
but for some reason this wasn't working on hppa.   Are we catching all
the regs in the code below?

Take care,

Carlos O'Donell <address@hidden> writes:

> On Sat, Mar 06, 2004 at 08:51:45PM -0500, Camm Maguire wrote:
> > Greetings, and thanks for your reply!  
> 
> Thanks for your interest!
>  
> > OK you've triggered one possibility in my mind -- for some time we
> > have had hppa specific assembler in our garbage collector to make sure
> > the registers are flushed when marking the C stack.  The bug in
> > question has the markings of a possible gbc bug in which some string
> > object, possibly on the C stack, was not marked.  You're mentioning of
> > volatile variables brought this to mind.
> 
> What are the flushing requirements?
>  
> > Here is the assembler:
> > 
> > =============================================================================
> > #if defined(__hppa__) /* Courtesy of Lamont Jones */
> > /* the calling sequence */
> > struct regs {
> >     void *callee_saves[16];
> > };
> > void hppa_save_regs(struct regs);
> > 
> > /* the code */
> > 
> >     asm(".code");
> >     asm(".export hppa_save_regs, entry");
> >     asm(".proc");
> >     asm(".callinfo");
> >     asm(".label     hppa_save_regs");
> >     asm(".entry");
> > 
> >     asm("stw        %r3,0(%arg0)");
> >     asm("stw        %r4,4(%arg0)");
> >     asm("stw        %r5,8(%arg0)");
> >     asm("stw        %r6,12(%arg0)");
> >     asm("stw        %r7,16(%arg0)");
> >     asm("stw        %r8,20(%arg0)");
> >     asm("stw        %r9,24(%arg0)");
> >     asm("stw        %r10,28(%arg0)");
> >     asm("stw        %r11,32(%arg0)");
> >     asm("stw        %r12,36(%arg0)");
> >     asm("stw        %r13,40(%arg0)");
> >     asm("stw        %r14,44(%arg0)");
> >     asm("stw        %r15,48(%arg0)");
> >     asm("stw        %r16,52(%arg0)");
> >     asm("stw        %r17,56(%arg0)");
> >     asm("bv 0(%rp)");
> >     asm("stw        %r18,60(%arg0)");
> > 
> >     asm(".exit");
> >     asm(".procend");
> >     asm(".end");
> > #endif
> > 
> > static void
> > mark_c_stack(jmp_buf env1, int n, void (*fn)(void *,void *,int)) {
> > 
> > #if defined(__hppa__)
> >   struct regs hppa_regs;
> > #endif
> >   jmp_buf env;
> >   int where;
> >   if (n== N_RECURSION_REQD)
> >     c_stack_where = (long *) (void *) &env;
> >   if (n > 0 ) {  
> > #if defined(__hppa__)
> >     hppa_save_regs(hppa_regs);
> > #else    
> >     setjmp(env);
> > #endif
> > =============================================================================
> > 
> > Apparently setjmp did not flush the regs on hppa when we put this in.
> 
> Flush? You mean save the registers to the stack?
> GCC should already be saving all the required registers to the stack.
> 
> Please explain your requirements?
> 
> c.
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]