This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nptl: Fix invalid Systemtap probe in pthread_join [BZ #24211]
On 2/11/19 4:40 PM, Florian Weimer wrote:
> * Carlos O'Donell:
>
>>> - LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd->result);
>>> + LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd_result);
>>
>> What prevents the compiler from optimizing away pd_result and using
>> pd->result directly again?
>
> The __free_tcb call acts as an implicit optimization barrier, like any
> function call that doesn't have attributes that say otherwise.
Sorry, yes, that's right, global memory accesses should not move around
that call, so I guess that means that the original pd_result store wont
move past __free_tcb() (and we don't do IPO/LTO yet).
>> The actions of __free_tcb() and their consequences are not visible
>> to the compiler.
>
> Exactly. The compiler cannot rematerialize the value from pd->result
> because it has no way of knowing if the value is still the same.
Yes, OK, let me review this again.
--
Cheers,
Carlos.