Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-25 Thread Jakub Jelinek
On Wed, Sep 25, 2013 at 10:34:42AM +0200, Marek Polacek wrote: > > 2013-09-17 Marek Polacek > > Jakub Jelinek > > > > PR sanitizer/58413 > > c-family/ > > * c-ubsan.c (ubsan_instrument_shift): Don't instrument > > an expression if we can prove it is correct. > > (ubsan

Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-25 Thread Marek Polacek
Ping. On Tue, Sep 17, 2013 at 12:32:03PM +0200, Marek Polacek wrote: > On Mon, Sep 16, 2013 at 08:35:35PM +0200, Jakub Jelinek wrote: > > On Fri, Sep 13, 2013 at 08:01:36PM +0200, Marek Polacek wrote: > > I'd say the above is going to be a maintainance nightmare, with all the code > > duplication.

Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-17 Thread Marek Polacek
On Mon, Sep 16, 2013 at 03:59:12PM +, Joseph S. Myers wrote: > On Mon, 16 Sep 2013, Marek Polacek wrote: > > > On Fri, Sep 13, 2013 at 07:18:24PM +, Joseph S. Myers wrote: > > > On Fri, 13 Sep 2013, Marek Polacek wrote: > > > > > > > This is kind of fugly, but don't have anything better a

Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-17 Thread Marek Polacek
On Mon, Sep 16, 2013 at 08:35:35PM +0200, Jakub Jelinek wrote: > On Fri, Sep 13, 2013 at 08:01:36PM +0200, Marek Polacek wrote: > I'd say the above is going to be a maintainance nightmare, with all the code > duplication. And you are certainly going to miss cases that way, > e.g. > void > foo (voi

Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-16 Thread Jakub Jelinek
On Fri, Sep 13, 2013 at 08:01:36PM +0200, Marek Polacek wrote: > 2013-09-13 Marek Polacek > > PR sanitizer/58413 > c-family/ > * c-ubsan.c (ubsan_instrument_shift): Don't instrument > an expression if we can prove it is correct. > > testsuite/ > * c-c++-common/ubsan/shi

Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-16 Thread Joseph S. Myers
On Mon, 16 Sep 2013, Marek Polacek wrote: > On Fri, Sep 13, 2013 at 07:18:24PM +, Joseph S. Myers wrote: > > On Fri, 13 Sep 2013, Marek Polacek wrote: > > > > > This is kind of fugly, but don't have anything better at the moment. > > > 2013-09-13 Marek Polacek > > > > > > PR sanitizer/5

Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-16 Thread Marek Polacek
On Fri, Sep 13, 2013 at 07:18:24PM +, Joseph S. Myers wrote: > On Fri, 13 Sep 2013, Marek Polacek wrote: > > > This is kind of fugly, but don't have anything better at the moment. > > 2013-09-13 Marek Polacek > > > > PR sanitizer/58413 > > c-family/ > > * c-ubsan.c (ubsan_instrumen

[PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-13 Thread Marek Polacek
This is kind of fugly, but don't have anything better at the moment. The thing is that we were always instrumenting shift expressions, even when both operands were INTEGER_CSTs and we could prove at compile time that the expression is well defined. This causes problems in the C FE, mainly at place

Re: [PATCH] Don't always instrument shifts (PR sanitizer/58413)

2013-09-13 Thread Joseph S. Myers
On Fri, 13 Sep 2013, Marek Polacek wrote: > This is kind of fugly, but don't have anything better at the moment. > 2013-09-13 Marek Polacek > > PR sanitizer/58413 > c-family/ > * c-ubsan.c (ubsan_instrument_shift): Don't instrument > an expression if we can prove it is correc