This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] fix parisc atomic locking builtins for libgomp


On Mon, Nov 24, 2008 at 12:09 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> This patch implies a bug in the kernel code.
>>
>> Under what condition is lws_errno == 0 and lws_ret != oldval?
>
> The issue is this code:
>
>        /* The load and store could fail */
> 1:      ldw     0(%sr3,%r26), %r28
>        sub,<>  %r28, %r25, %r0
> 2:      stw     %r24, 0(%sr3,%r26)
>
> The return value is not changed if the store at 2 is not done.
> However, I don't think the interface can be changed now.

When is the store at 2 not completed?

The only case I am aware of is that the store at 2 faults.

If the store at 2 faults, the kernel exception handler executes:
        /* Free lock */
        stw     %r20, 0(%sr2,%r20)
...
        b       lws_exit
        ldo     -EFAULT(%r0),%r21       /* set errno */

Which sets lws_error to -EFAULT.

Cheers,
Carlos.


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