This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]