This is the mail archive of the
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: Fri, 9 Jun 2017 11:42:03 +0200
- Subject: Re: [PATCH v2] Implement no_sanitize function attribute
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.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 E18C537EE1
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E18C537EE1
- References: <CAFiYyc1G6vsFQiGdreyrf9Vw+E0JuoQYGazXSrENaGzvhy+Ffirstname.lastname@example.org> <20170531115102.GU24023@tucnak> <CAFiYyc0iFrCCKS152LXzsksE=1ZrOLvWsm=ykX-0=A-SMuHUemail@example.com> <firstname.lastname@example.org> <CAFiYyc22nMjc=9L4bDRUs9aFqwcNqphhvQaCYyr+Uo7YcJzFxg@mail.gmail.com> <email@example.com> <CAFiYyc1Xd-jTFhBGw7H80PLcqbTbgnuhprCQyZgn-h9i9QmVbw@mail.gmail.com> <firstname.lastname@example.org> <20170608134715.GV2154@tucnak> <email@example.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jun 09, 2017 at 11:29:06AM +0200, Martin Liška wrote:
> Having that inlined would be great, however we'll need to put it to tree.h
> and thus we have to include "options.h" before tree.h in multiple source files.
Doesn't that mean that tree.h is not the right header to put this into?
It has nothing to do with the stuff normally in tree.h.
We don't have a common sanitizer header, just asan.h (which already has
similar partially inline checks), ubsan.h and tsan.h, but perhaps putting it
into one of those would be certainly better than tree.h.
> > If there is a previous attribute already, can't you modify it in
> > place? If not, as it could be perhaps shared? with other functions
> > somehow, at least you should avoid adding a new attribute if
> > (old_value | flags) == old_value.
> Yep, we should definitely share, I'll add test-case for that.
I was worried about stuff like templates, where a template has one
no_sanitize attribute and the implied "no sanitize flags", and then
you instantiate it or specialize it with extra attributes.
Are you sure it can't be ever shared between multiple functions?