Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-13 Thread Martin Liška
On 06/13/2017 03:49 PM, Richard Biener wrote: > On Tue, Jun 13, 2017 at 1:09 PM, Martin Liška wrote: >> On 06/09/2017 03:35 PM, Richard Biener wrote: >>> You can directly transform to no_sanitize with integer mask, not sure why >>> you'd need an intermediate step with a string? >> >> Hello. >> >>

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-13 Thread Richard Biener
On Tue, Jun 13, 2017 at 1:09 PM, Martin Liška wrote: > On 06/09/2017 03:35 PM, Richard Biener wrote: >> You can directly transform to no_sanitize with integer mask, not sure why >> you'd need an intermediate step with a string? > > Hello. > > Done in attached patch, I'm sending both incremental an

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-13 Thread Martin Liška
On 06/09/2017 03:35 PM, Richard Biener wrote: > You can directly transform to no_sanitize with integer mask, not sure why > you'd need an intermediate step with a string? Hello. Done in attached patch, I'm sending both incremental and final version (complete patch). I also decided to support no_

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Richard Biener
On Fri, Jun 9, 2017 at 2:51 PM, Martin Liška wrote: > On 06/09/2017 02:27 PM, Richard Biener wrote: >> >> On Fri, Jun 9, 2017 at 2:08 PM, Martin Liška wrote: >>> >>> On 06/09/2017 01:05 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 12:49 PM, Martin Liška wrote: > >

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Martin Liška
On 06/09/2017 02:27 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 2:08 PM, Martin Liška wrote: On 06/09/2017 01:05 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 12:49 PM, Martin Liška wrote: On 06/09/2017 12:39 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 12:17 PM, Martin Lišk

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Richard Biener
On Fri, Jun 9, 2017 at 2:08 PM, Martin Liška wrote: > On 06/09/2017 01:05 PM, Richard Biener wrote: >> >> On Fri, Jun 9, 2017 at 12:49 PM, Martin Liška wrote: >>> >>> On 06/09/2017 12:39 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 12:17 PM, Martin Liška wrote: > > >>>

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Martin Liška
On 06/09/2017 11:42 AM, Jakub Jelinek wrote: 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

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Martin Liška
On 06/09/2017 01:05 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 12:49 PM, Martin Liška wrote: On 06/09/2017 12:39 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 12:17 PM, Martin Liška wrote: On 06/09/2017 12:12 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 11:29 AM, Martin Liš

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Richard Biener
On Fri, Jun 9, 2017 at 12:49 PM, Martin Liška wrote: > On 06/09/2017 12:39 PM, Richard Biener wrote: >> >> On Fri, Jun 9, 2017 at 12:17 PM, Martin Liška wrote: >>> >>> On 06/09/2017 12:12 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 11:29 AM, Martin Liška wrote: > > >>

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Martin Liška
On 06/09/2017 12:39 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 12:17 PM, Martin Liška wrote: On 06/09/2017 12:12 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 11:29 AM, Martin Liška wrote: On 06/08/2017 03:47 PM, Jakub Jelinek wrote: Hi! I'd still prefer to handle it with the

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Richard Biener
On Fri, Jun 9, 2017 at 12:17 PM, Martin Liška wrote: > On 06/09/2017 12:12 PM, Richard Biener wrote: >> >> On Fri, Jun 9, 2017 at 11:29 AM, Martin Liška wrote: >>> >>> On 06/08/2017 03:47 PM, Jakub Jelinek wrote: Hi! I'd still prefer to handle it with the flags infrastruc

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Martin Liška
On 06/09/2017 12:12 PM, Richard Biener wrote: On Fri, Jun 9, 2017 at 11:29 AM, Martin Liška wrote: On 06/08/2017 03:47 PM, Jakub Jelinek wrote: Hi! I'd still prefer to handle it with the flags infrastructure instead, but if Richard wants to do it this way, then at least: On Thu, Jun 08, 201

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Richard Biener
On Fri, Jun 9, 2017 at 11:29 AM, Martin Liška wrote: > On 06/08/2017 03:47 PM, Jakub Jelinek wrote: >> >> Hi! >> >> I'd still prefer to handle it with the flags infrastructure instead, but >> if >> Richard wants to do it this way, then at least: >> >> On Thu, Jun 08, 2017 at 03:30:49PM +0200, Mart

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Jakub Jelinek
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

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-09 Thread Martin Liška
On 06/08/2017 03:47 PM, Jakub Jelinek wrote: Hi! I'd still prefer to handle it with the flags infrastructure instead, but if Richard wants to do it this way, then at least: On Thu, Jun 08, 2017 at 03:30:49PM +0200, Martin Liška wrote: +/* Return true when flag_sanitize & FLAG is non-zero. If

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-08 Thread Jakub Jelinek
Hi! I'd still prefer to handle it with the flags infrastructure instead, but if Richard wants to do it this way, then at least: On Thu, Jun 08, 2017 at 03:30:49PM +0200, Martin Liška wrote: > +/* Return true when flag_sanitize & FLAG is non-zero. If FN is non-null, > + remove all flags mention

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-08 Thread Martin Liška
On 06/02/2017 12:40 PM, Richard Biener wrote: > On Wed, May 31, 2017 at 4:13 PM, Martin Liška wrote: >> On 05/31/2017 03:31 PM, Richard Biener wrote: >>> On Wed, May 31, 2017 at 2:28 PM, Martin Liška wrote: On 05/31/2017 02:04 PM, Richard Biener wrote: > On Wed, May 31, 2017 at 1:51 PM,

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-02 Thread Richard Biener
On Wed, May 31, 2017 at 4:13 PM, Martin Liška wrote: > On 05/31/2017 03:31 PM, Richard Biener wrote: >> On Wed, May 31, 2017 at 2:28 PM, Martin Liška wrote: >>> On 05/31/2017 02:04 PM, Richard Biener wrote: On Wed, May 31, 2017 at 1:51 PM, Jakub Jelinek wrote: > On Wed, May 31, 2017 at

Re: [PATCH v2] Implement no_sanitize function attribute

2017-06-01 Thread Bernhard Reutner-Fischer
On 31 May 2017 14:25:09 CEST, "Martin Liška" wrote: >I've got written that on my TODO list. Will work on that some time in >the stage1. BTW.. May I ask you to put it below https://gcc.gnu.org/PR65534 (the tailcall resp. IPA-ICF thing :-) Many TIA and cheers,

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
On 05/31/2017 03:31 PM, Richard Biener wrote: > On Wed, May 31, 2017 at 2:28 PM, Martin Liška wrote: >> On 05/31/2017 02:04 PM, Richard Biener wrote: >>> On Wed, May 31, 2017 at 1:51 PM, Jakub Jelinek wrote: On Wed, May 31, 2017 at 01:46:00PM +0200, Richard Biener wrote: > Just wanting t

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Richard Biener
On Wed, May 31, 2017 at 2:28 PM, Martin Liška wrote: > On 05/31/2017 02:04 PM, Richard Biener wrote: >> On Wed, May 31, 2017 at 1: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

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
On 05/31/2017 02:04 PM, Richard Biener wrote: > On Wed, May 31, 2017 at 1: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 v

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
On 05/31/2017 02:06 PM, Richard Biener wrote: > On Wed, May 31, 2017 at 2:01 PM, Jakub Jelinek wrote: >> 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 wa

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Richard Biener
On Wed, May 31, 2017 at 2:01 PM, Jakub Jelinek wrote: > 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

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Richard Biener
On Wed, May 31, 2017 at 1: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 >>

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Jakub Jelinek
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 does

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
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 a

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
On 05/31/2017 01:46 PM, Richard Biener wrote: > On Wed, May 31, 2017 at 1:33 PM, Jakub Jelinek wrote: >> On Wed, May 31, 2017 at 01:24:47PM +0200, Martin Liška wrote: >>> On 05/31/2017 10:35 AM, Jakub Jelinek wrote: On Wed, May 31, 2017 at 10:04:53AM +0200, Martin Liška wrote: > diff --gi

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Jakub Jelinek
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 a

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Richard Biener
On Wed, May 31, 2017 at 1:33 PM, Jakub Jelinek wrote: > On Wed, May 31, 2017 at 01:24:47PM +0200, Martin Liška wrote: >> On 05/31/2017 10:35 AM, Jakub Jelinek wrote: >> > On Wed, May 31, 2017 at 10:04:53AM +0200, Martin Liška wrote: >> >> diff --git a/gcc/common.opt b/gcc/common.opt >> >> index 13

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Jakub Jelinek
On Wed, May 31, 2017 at 01:24:47PM +0200, Martin Liška wrote: > On 05/31/2017 10:35 AM, Jakub Jelinek wrote: > > On Wed, May 31, 2017 at 10:04:53AM +0200, Martin Liška wrote: > >> diff --git a/gcc/common.opt b/gcc/common.opt > >> index 13305558d2d..5e9942d5100 100644 > >> --- a/gcc/common.opt > >>

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
On 05/31/2017 10:31 AM, Alexander Monakov wrote: > On Wed, 31 May 2017, Martin Liška wrote: >> I added to common.opt: >> Common RejectNegative Joined UInteger Var(flag_no_sanitize_fn) PerFunction >> No sanitize flags for a function > > This needs a period at the end ("for a function."). Ah, I see

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
On 05/31/2017 10:35 AM, Jakub Jelinek wrote: > On Wed, May 31, 2017 at 10:04:53AM +0200, Martin Liška wrote: >> diff --git a/gcc/common.opt b/gcc/common.opt >> index 13305558d2d..5e9942d5100 100644 >> --- a/gcc/common.opt >> +++ b/gcc/common.opt >> @@ -222,9 +222,13 @@ bool flag_opts_finished >> V

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Jakub Jelinek
On Wed, May 31, 2017 at 10:04:53AM +0200, Martin Liška wrote: > diff --git a/gcc/common.opt b/gcc/common.opt > index 13305558d2d..5e9942d5100 100644 > --- a/gcc/common.opt > +++ b/gcc/common.opt > @@ -222,9 +222,13 @@ bool flag_opts_finished > Variable > unsigned int flag_sanitize > > +### > +C

Re: [PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Alexander Monakov
On Wed, 31 May 2017, Martin Liška wrote: > I added to common.opt: > Common RejectNegative Joined UInteger Var(flag_no_sanitize_fn) PerFunction > No sanitize flags for a function This needs a period at the end ("for a function."). > FAIL: compiler driver --help=optimizers option(s): "^ +-.*[^:.]$"

[PATCH v2] Implement no_sanitize function attribute

2017-05-31 Thread Martin Liška
Hi. Having a discussion with Jakub on IRC, I decided to implement it in a bit different way: I added to common.opt: Common RejectNegative Joined UInteger Var(flag_no_sanitize_fn) PerFunction No sanitize flags for a function and this per function flag is used to save no_sanitize values, then che