This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Do not sanitize in lower_omp_target context (PR, sanitizer/78815).
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Jan 2017 10:31:27 +0100
- Subject: Re: [PATCH] Do not sanitize in lower_omp_target context (PR, sanitizer/78815).
- Authentication-results: sourceware.org; auth=none
- References: <cfcd9d95-8e06-48be-3469-2bfa71310ef1@suse.cz> <520dceec-1ca4-c0e1-0466-bbc0b1d4e9a7@suse.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jan 04, 2017 at 10:19:28AM +0100, Martin Liška wrote:
> PING^1
>
> On 12/16/2016 01:04 PM, Martin Liška wrote:
> > Currently, use-after-scope relies on fact that entry point of gimplify_decl_expr
> > is gimplify_function_tree. Fixed by checking if asan_poisoned_variables is non-null.
> >
> > Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> >
> > Ready to be installed?
Looking at asan_poisoned_variables, my preference would be to guard:
asan_poisoned_variables = new hash_set<tree> ();
with
if (asan_sanitize_use_after_scope ()
&& !asan_no_sanitize_address_p ())
the delete asan_poisoned_variables; with if (asan_poisoned_variables)
and all the poisoning stuff in the gimplifier also with if
(asan_poisoned_variables) and no need to repeat there the asan_sanitize_use_after_scope
() and !asan_no_sanitize_address_p () tests.
if (asan_poisoned_variables != NULL
&& asan_poisoned_variables->contains (t))
is already fine,
if (asan_sanitize_use_after_scope ()
&& !asan_no_sanitize_address_p ()
&& !is_vla
&& TREE_ADDRESSABLE (decl)
&& !TREE_STATIC (decl)
&& !DECL_HAS_VALUE_EXPR_P (decl)
&& dbg_cnt (asan_use_after_scope))
should replace the first 2 conditions with asan_poisoned_variables,
if (asan_sanitize_use_after_scope ()
&& asan_used_labels != NULL
&& asan_used_labels->contains (label))
asan_poison_variables (asan_poisoned_variables, false, pre_p);
should replace asan_sanitize_use_after_scope () with
asan_poisoned_variables. IMHO no need to add comments, especially not one
mentioning omp lowering - the gimplifier is called from lots of various
places.
Jakub