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]

Re: testandset on powerpc


Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:

> I finally found the main problem, Greg's bounded pointer work rendered 
> sysdeps/powerpc/strchr.S unusable without bounded pointers.

Sorry.  I was lazy about running the testsuite.  That won't happen again.

The problem was that the rSTR (which aliases rRTN) was unconditionally
zeroed during some clever coding designed to avoid taking a branch.
Here's an alternative patch.

> Greg, my patch for strchr.S is probably not correct for the bounded pointer 
> case, so please have a look again.

Unfortunately, it isn't.  In the BP case rRTN isn't the return value,
but rather a pointer to the return value, which must be stored into.
Your patch assigns to rRTN, and so clobbers the pointer to the address
of the return value before storing into it.  The net effect is that
we scribble 4 bytes of the string starting at the place where strchr
found a match, or of no match was found, we scribble at NULL.

Anyway, your patch is fine for now since it restores functionality
for the normal case.  I thought I had a patch that would work for
both non-BP and BP, but it fails test case 7.  I'll submit something
when it all works.

Greg

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