[parisc-linux] Re: [PATCH] HPPA Linuxthreads.

John David Anglin dave@hiauly1.hia.nrc.ca
Thu, 22 May 2003 11:53:44 -0400 (EDT)


> On Thu, May 22, 2003 at 11:09:02AM -0400, Carlos O'Donell wrote:
> > > > +	while (__ldcw (addr) == 0)
> > > > +		while (*addr == 0) ;
> > > 
> > > This is plain wrong.  addr at least must be volatile.
> > 
> > __ldcw is volatile.
> 
> yes, but *addr can be optimized out of the while loop.

Yes, you are correct.  This is the code from the inner loop:

  1c:   0f 40 10 93     ldw 0(,r26),r19
  20:   86 60 3f f5     cmpib,= 0,r19,20 <__pthread_spin_lock+0x20>
  24:   08 00 02 40     nop

Don't know how I missied that :(

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)