This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] Implement no_sanitize function attribute
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 31 May 2017 14:01:52 +0200
- Subject: Re: [PATCH v2] Implement no_sanitize function attribute
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.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 DB29A80053
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DB29A80053
- References: <72103b1d-0119-f05d-043d-ca2edf242bf3@suse.cz> <beb96c01-d217-b126-baaa-bcf5682889f4@suse.cz> <20170531083543.GQ24023@tucnak> <83f8580a-03e1-81eb-3216-a1c998810b90@suse.cz> <20170531113321.GT24023@tucnak> <CAFiYyc1G6vsFQiGdreyrf9Vw+E0JuoQYGazXSrENaGzvhy+F=g@mail.gmail.com> <20170531115102.GU24023@tucnak> <67e48d3c-0043-41e3-611f-85ae7fa01826@suse.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, May 31, 2017 at 01:57:48PM +0200, Martin Liška wrote:
> On 05/31/2017 01:51 PM, Jakub Jelinek wrote:
> > On Wed, May 31, 2017 at 01:46:00PM +0200, Richard Biener wrote:
> >> Just wanting to add that "ab-"using options/variables to implement
> >> what are really
> >> function attributes doesn't look very clean. Unless the plan is to get rid of
> >> function attributes in favor of per-function options.
> >
> > Function attribute here is one thing (the way user writes it) and that
> > combined with the command line options determines the sanitization performed
> > (the function attributes only say what sanitization flags should be
> > ignored). The proposed per-function variable is just a cache of this
> > information, because parsing function attributes every time is way too
> > expensive.
>
> But one the other hand every function decorated with such attribute will lead
> to having a separate copy of struct cl_optimization, which is quite big structure.
Separate? I thought cl_optimization structs are shared, so if you have 2
functions that have the same no_sanitize* attributes and all other
optimization flags same as well, they should share OPTIMIZATION_NODE.
Jakub