This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Enable experimental TSAN support for Ada
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Bernd Edlinger <bernd dot edlinger at hotmail dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>
- Date: Fri, 9 Jan 2015 10:57:14 +0100
- Subject: Re: [PATCH] Enable experimental TSAN support for Ada
- Authentication-results: sourceware.org; auth=none
- References: <DUB118-W45B65843D93119073A62C3E45A0 at phx dot gbl> <54AAED52 dot 5040506 at redhat dot com>
On Mon, Jan 5, 2015 at 9:00 PM, Jeff Law <law@redhat.com> wrote:
> On 01/03/15 06:49, Bernd Edlinger wrote:
>>
>> Hi,
>>
>> I was experimenting with enabling TSAN for Ada recently.
>> I think this gives rather interesting results.
>>
>> The Instrumentation worked almost out of the box, we just have
>> the problem that it is not gimple-OK to fold something like
>> "& VIEW_CONVERT_EXPR(x)", and this happens in Ada all the time.
>>
>> Boot-Strapped and regression-tested on x86_64-linux-gnu.
>> OK for trunk?
>>
>>
>> Thanks
>> Bernd.
>>
>>
>>
>> changelog-tsan-ada.txt
>>
>>
>> gcc/ChangeLog:
>> 2015-01-03 Bernd Edlinger<bernd.edlinger@hotmail.de>
>>
>> Enable experimental TSAN support for Ada.
>> * tsan.c (instrument_expr): Handle VIEW_CONVERT_EXPR.
>
> OK for the trunk with a comment before the new block of code indicating why
> we need to handle VIEW_CONVERT_EXPR specially here (specifically we can't
> call build_fold_addr_expr on the VIEW_CONVERT_EXPR).
There may be multiple VIEW_CONVERT_EXPRs in a reference chain
so simply stripping the outermost only doesn't work (the assert).
I wonder why you do all the special-casing when you have already
called get_inner_reference on the reference. The address is
simply &base + offset + bitpos / BITS_PER_UNIT, the bitfield
case is detectable via bitpos % BITS_PER_UNIT != 0.
Sth else I noticed, instead of checking points-to in the weird way
you do you simply want if (DECL_P (base) && !may_be_aliased (base)).
Richard.
> Jeff
>