[cfe-commits] Please review: enable TBAA at "-O0 -fthread-sanitizer"
Kostya Serebryany
kcc at google.com
Mon Apr 23 01:09:28 PDT 2012
Hello,
Please review the following updated patch.
TBAA should be generated for ThreadSanitizer regardless of opt level
and relaxed-aliasing.
Thanks,
--kcc
On Wed, Apr 11, 2012 at 4:37 AM, Kostya Serebryany <kcc at google.com> wrote:
> ping?
>
>
> On Thu, Apr 5, 2012 at 5:17 PM, Kostya Serebryany <kcc at google.com> wrote:
>
>>
>>
>> On Thu, Apr 5, 2012 at 1:56 PM, Chris Lattner <clattner at apple.com> wrote:
>>
>>>
>>> On Apr 5, 2012, at 10:50 AM, Kostya Serebryany wrote:
>>>
>>>
>>>
>>> On Thu, Apr 5, 2012 at 10:37 AM, Chris Lattner <clattner at apple.com>wrote:
>>>
>>>>
>>>> On Apr 5, 2012, at 9:43 AM, Kostya Serebryany wrote:
>>>>
>>>> > Hello,
>>>> >
>>>> > Please review the following patch:
>>>> > ThreadSanitizer instrumentation relies on TBAA for correctness, so we
>>>> need to generate TBAA at "-O0 -fthread-sanitizer".
>>>>
>>>> This is close, but not the right solution. TBAA can cause a semantic
>>>> change when enabled (though I admit it is unlikely given that nearly all of
>>>> the optimizers are disabled at -O0).
>>>>
>>>> The right fix is for TSAN to generate *vtable* TBAA info, but not other
>>>> TBAA info.
>>>>
>>>
>>> Ok...
>>> Do you mean that we need to check "CodeGenOpts.OptimizationLevel > 0"
>>> inside CodeGenTBAA methods?
>>> Or pass a flag to CodeGenTBAA::CodeGenTBAA saying that we need
>>> only vtable TBAA?
>>>
>>>
>>> The former is probably the right way.
>>>
>>
>> New patch attached, please take a look.
>>
>> Alternatively we may create a CodeGenTBAA object unconditionally and
>> check all the flags
>> (CodeGenOpts.RelaxedAliasing, CodeGenOpts.OptimizationLevel,
>> LangOpts.ThreadSanitizer)
>> inside CodeGenTBAA methods.
>>
>> --kcc
>>
>>
>>>
>>> -Chris
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120423/5af3f6b4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tbaa-O0.patch
Type: application/octet-stream
Size: 3945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120423/5af3f6b4/attachment.obj>
More information about the cfe-commits
mailing list