On 07/28/2017 01:32 PM, Richard Biener wrote:
> On Fri, Jul 28, 2017 at 1:19 PM, Jakub Jelinek <ja...@redhat.com> wrote:
>> On Fri, Jul 28, 2017 at 01:11:51PM +0200, Martin Liška wrote:
>>> Hello.
>>>
>>> Following patch fixed race where we first need to properly build
>>> all gimple_build_debug_bind (arg, var, NULL) and then DECL_HAS_VALUE_EXPR_P
>>> can be registered.
>>>
>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>>
>>> Ready to be installed?
>>> Martin
>>>
>>> gcc/ChangeLog:
>>>
>>> 2017-07-10  Martin Liska  <mli...@suse.cz>
>>>
>>>       PR sanitizer/81340
>>>       * sanopt.c (sanitize_rewrite_addressable_params):
>>
>> Missing description of what you've changed.  Also, it isn't immediately
>> clear why this is needed.  For force_gimple* etc. I'd understand that
>> setting DECL_VALUE_EXPR prematurely will result in gimplification of that
>> into the DECL_VALUE_EXPR, but gimple_build_assign or gimple_build_debug_bind
>> shouldn't do that.  Or does the former invoke match.pd and that cares about
>> it?
> 
> I think target_for_debug_bind () gets confused.

Exactly:

tree
target_for_debug_bind (tree var)
{
...

  if (DECL_HAS_VALUE_EXPR_P (var))
    return target_for_debug_bind (DECL_VALUE_EXPR (var));
...

There's fixed changelog entry:

    Set VALUE_EXPR after a debug stmt is generated (PR sanitizer/81340).
    
    gcc/ChangeLog:
    
    2017-07-10  Martin Liska  <mli...@suse.cz>
    
            PR sanitizer/81340
            * sanopt.c (sanitize_rewrite_addressable_params):
            Set VALUE_EXPR after gimple_build_debug_bind because
            it calls target_for_debug_bind and would confuse the function.
    
    gcc/testsuite/ChangeLog:
    
    2017-07-10  Martin Liska  <mli...@suse.cz>
    
            PR sanitizer/81340
            * g++.dg/asan/pr81340.C: New test.

Martin
> 
>>         Jakub

Reply via email to