Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-29 Thread H.J. Lu
On Fri, Nov 29, 2013 at 12:02 PM, Marek Polacek wrote: > On Fri, Nov 29, 2013 at 08:57:23PM +0100, Jakub Jelinek wrote: >> On Fri, Nov 29, 2013 at 08:55:26PM +0100, Marek Polacek wrote: >> > 2013-11-29 Marek Polacek >> > >> > * bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Remove -lpthread -ldl.

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-29 Thread Marek Polacek
On Fri, Nov 29, 2013 at 08:57:23PM +0100, Jakub Jelinek wrote: > On Fri, Nov 29, 2013 at 08:55:26PM +0100, Marek Polacek wrote: > > 2013-11-29 Marek Polacek > > > > * bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Remove -lpthread -ldl. > > > > --- gcc/bootstrap-ubsan.mk.mp3 2013-11-29 20:5

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-29 Thread Jakub Jelinek
On Fri, Nov 29, 2013 at 08:55:26PM +0100, Marek Polacek wrote: > 2013-11-29 Marek Polacek > > * bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Remove -lpthread -ldl. > > --- gcc/bootstrap-ubsan.mk.mp32013-11-29 20:50:04.788238860 +0100 > +++ gcc/bootstrap-ubsan.mk2013-11-29 20:50:2

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-29 Thread Marek Polacek
On Fri, Nov 29, 2013 at 08:32:34PM +0100, Jakub Jelinek wrote: > On Fri, Nov 29, 2013 at 11:22:00AM -0800, H.J. Lu wrote: > > On Mon, Nov 18, 2013 at 6:44 AM, Marek Polacek wrote: > > > On Mon, Nov 18, 2013 at 02:51:41PM +0100, Jakub Jelinek wrote: > > >> On Wed, Nov 13, 2013 at 12:13:48AM +0100,

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-29 Thread Jakub Jelinek
On Fri, Nov 29, 2013 at 11:22:00AM -0800, H.J. Lu wrote: > On Mon, Nov 18, 2013 at 6:44 AM, Marek Polacek wrote: > > On Mon, Nov 18, 2013 at 02:51:41PM +0100, Jakub Jelinek wrote: > >> On Wed, Nov 13, 2013 at 12:13:48AM +0100, Marek Polacek wrote: > >> > --- gcc/config/bootstrap-ubsan.mk.mp

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-29 Thread H.J. Lu
On Fri, Nov 29, 2013 at 11:22 AM, H.J. Lu wrote: > On Mon, Nov 18, 2013 at 6:44 AM, Marek Polacek wrote: >> On Mon, Nov 18, 2013 at 02:51:41PM +0100, Jakub Jelinek wrote: >>> On Wed, Nov 13, 2013 at 12:13:48AM +0100, Marek Polacek wrote: >>> > --- gcc/config/bootstrap-ubsan.mk.mp2013-11-1

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-29 Thread H.J. Lu
On Mon, Nov 18, 2013 at 6:44 AM, Marek Polacek wrote: > On Mon, Nov 18, 2013 at 02:51:41PM +0100, Jakub Jelinek wrote: >> On Wed, Nov 13, 2013 at 12:13:48AM +0100, Marek Polacek wrote: >> > --- gcc/config/bootstrap-ubsan.mk.mp2013-11-12 13:46:13.345182065 >> > +0100 >> > +++ gcc/config/bo

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-18 Thread Joseph S. Myers
On Mon, 18 Nov 2013, Marek Polacek wrote: > 2013-11-18 Marek Polacek > > * doc/invoke.texi: Extend -fsanitize=undefined documentation. OK. -- Joseph S. Myers jos...@codesourcery.com

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-18 Thread Marek Polacek
On Mon, Nov 18, 2013 at 04:58:36PM +, Joseph S. Myers wrote: > On Mon, 18 Nov 2013, Marek Polacek wrote: > > > +@item @option{-fsanitize=shift} > > + > > +This option enables checking that the result of a shift operation is > > +not undefined. Note that what exactly is considered undefined di

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-18 Thread Joseph S. Myers
On Mon, 18 Nov 2013, Marek Polacek wrote: > +@item @option{-fsanitize=shift} > + > +This option enables checking that the result of a shift operation is > +not undefined. Note that what exactly is considered undefined differs > +slightly between C and C++, as well as between ANSI C and C99, etc.

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-18 Thread Marek Polacek
On Mon, Nov 18, 2013 at 02:52:34PM +0100, Jakub Jelinek wrote: > Oh, one more thing, please update gcc/doc/, the -fsanitize= description is > far from up to date there. Ok, the following (incremental) hopefully improves the docs. Joseph, would you mind having a look at this? Thanks, 2013-11-18

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-18 Thread Marek Polacek
On Mon, Nov 18, 2013 at 02:51:41PM +0100, Jakub Jelinek wrote: > On Wed, Nov 13, 2013 at 12:13:48AM +0100, Marek Polacek wrote: > > --- gcc/config/bootstrap-ubsan.mk.mp2013-11-12 13:46:13.345182065 > > +0100 > > +++ gcc/config/bootstrap-ubsan.mk 2013-11-12 13:46:49.812314016 +0100 > > @@

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-18 Thread Jakub Jelinek
On Mon, Nov 18, 2013 at 02:51:41PM +0100, Jakub Jelinek wrote: > On Wed, Nov 13, 2013 at 12:13:48AM +0100, Marek Polacek wrote: > > --- gcc/config/bootstrap-ubsan.mk.mp2013-11-12 13:46:13.345182065 > > +0100 > > +++ gcc/config/bootstrap-ubsan.mk 2013-11-12 13:46:49.812314016 +0100 > > @@

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-18 Thread Jakub Jelinek
On Wed, Nov 13, 2013 at 12:13:48AM +0100, Marek Polacek wrote: > --- gcc/config/bootstrap-ubsan.mk.mp 2013-11-12 13:46:13.345182065 +0100 > +++ gcc/config/bootstrap-ubsan.mk 2013-11-12 13:46:49.812314016 +0100 > @@ -2,6 +2,6 @@ > > STAGE2_CFLAGS += -fsanitize=undefined > STAGE3_CFLAGS += -

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-13 Thread Marek Polacek
On Wed, Nov 13, 2013 at 06:45:06AM +0100, Markus Trippelsdorf wrote: > On 2013.11.13 at 00:13 +0100, Marek Polacek wrote: > > 2) bootstrap-ubsan almost passes, but the bootstrap fails when building > >all-fixincludes. The problem here is that libiberty.a is built > >with -fsanitize=undefin

Re: [PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-12 Thread Markus Trippelsdorf
On 2013.11.13 at 00:13 +0100, Marek Polacek wrote: > 2) bootstrap-ubsan almost passes, but the bootstrap fails when building >all-fixincludes. The problem here is that libiberty.a is built >with -fsanitize=undefined, but fixincludes, when linking, >don't link libubsan in. My attemps t

[PATCH] Implement -fsanitize=null + new sanopt pass

2013-11-12 Thread Marek Polacek
Hi! Lately I've been working on the ubsan NULL pointer checking. Its purpose is to detect load from/store to NULL pointer. So, e.g., int *p = NULL; struct S *s = NULL; if (*p) { ... } x = struct s->i; etc. I should explain a bit here about the implementation of it. Firstly, I want