This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove dead code in asan.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Jun 2017 12:15:31 +0200
- Subject: Re: [PATCH] Remove dead code in asan.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6B3C4EB9CD
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6B3C4EB9CD
- References: <e620fd3b-3f39-4d32-1197-330c6d00eb52@suse.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jun 30, 2017 at 12:00:36PM +0200, Martin Liška wrote:
> Hi.
>
> Following crap code was added by me when I added use-after-scope.
> Actually decl always points to LASANPC, so asan_handled_variables->contains (decl)
> is always false.
>
> Well, originally the idea was to not clear content (place in shadow memory in between
> red zoner) of auto variables, but as we emit 0xf5 in order to have working use-after-return,
> it probably does not worth for doing an optimization?
use-after-return is only runtime conditional, defaults to off.
And your patch doesn't bring the code to anything close to what we had
before the -fsanitize-use-after-scope changes, just look what it did before
- only cleared the shadow spots that weren't known to be 0, clearing the
whole shadow might be too expensive. Consider many KB large local
variables.
You can find the right decl in decls[l / 2] or decls[l / 2 - 1] or so.
Jakub