Re: [PATCH] Add signed integer overflow checking to ubsan

2013-12-04 Thread Marek Polacek
On Tue, Dec 03, 2013 at 02:14:17PM -0700, Jeff Law wrote: > Perhaps split this patch into two parts which can be reviewed > independently, but go into the tree at the same time. The obvious > hope would be that Uros or one of the other x86 backend folks could > chime in on that part. I posted the

Re: [PATCH] Add signed integer overflow checking to ubsan

2013-12-03 Thread Jeff Law
On 12/03/13 15:05, Jakub Jelinek wrote: On Tue, Dec 03, 2013 at 02:14:17PM -0700, Jeff Law wrote: --- gcc/ubsan.h.mp 2013-11-27 08:46:28.046629473 +0100 +++ gcc/ubsan.h 2013-11-27 08:46:57.578753342 +0100 @@ -21,6 +21,12 @@ along with GCC; see the file COPYING3. #ifndef GCC_UBSAN_H #def

Re: [PATCH] Add signed integer overflow checking to ubsan

2013-12-03 Thread Jakub Jelinek
On Tue, Dec 03, 2013 at 02:14:17PM -0700, Jeff Law wrote: > >--- gcc/ubsan.h.mp 2013-11-27 08:46:28.046629473 +0100 > >+++ gcc/ubsan.h 2013-11-27 08:46:57.578753342 +0100 > >@@ -21,6 +21,12 @@ along with GCC; see the file COPYING3. > > #ifndef GCC_UBSAN_H > > #define GCC_UBSAN_H > > > >+/*

Re: [PATCH] Add signed integer overflow checking to ubsan

2013-12-03 Thread Jeff Law
On 11/27/13 01:13, Marek Polacek wrote: On Fri, Nov 22, 2013 at 10:54:16AM +0100, Marek Polacek wrote: Hi! Working virtually out of Pago Pago. The following is the implementation of the signed integer overflow checking for the UndefinedBehaviorSanitizer. I wrote some of the generic bits; Jaku

Re: [PATCH] Add signed integer overflow checking to ubsan

2013-11-27 Thread Marek Polacek
On Fri, Nov 22, 2013 at 10:54:16AM +0100, Marek Polacek wrote: > Hi! > > Working virtually out of Pago Pago. > > The following is the implementation of the signed integer overflow > checking for the UndefinedBehaviorSanitizer. I wrote some of the > generic bits; Jakub did the i?86 handlind/optab

Re: [PATCH] Add signed integer overflow checking to ubsan

2013-11-22 Thread Marek Polacek
On Fri, Nov 22, 2013 at 02:55:52PM +0100, Jakub Jelinek wrote: > On Fri, Nov 22, 2013 at 10:54:16AM +0100, Marek Polacek wrote: > > 1) currently, we seem to miscompile some code with -Os. That's why > >I skipped -Os in some of the test. > > The following (untested) incremental fix should hope

Re: [PATCH] Add signed integer overflow checking to ubsan

2013-11-22 Thread Jakub Jelinek
On Fri, Nov 22, 2013 at 10:54:16AM +0100, Marek Polacek wrote: > 1) currently, we seem to miscompile some code with -Os. That's why >I skipped -Os in some of the test. The following (untested) incremental fix should hopefully fix it. Perhaps the calls before expand_normal aren't needed, dunn

Re: [PATCH] Add signed integer overflow checking to ubsan

2013-11-22 Thread Joseph S. Myers
On Fri, 22 Nov 2013, Marek Polacek wrote: > 3) for integer overflow checking we will want to thwart some of the >folding in the C FE. E.g., I think int a = INT_MAX + 1; is folded >in the FE and thus ubsan doesn't detect because it doesn't see >any PLUS_EXPR. Generally, an expression