Re: [PATCH] -fsanitize=alignment support

2014-07-25 Thread Jason Merrill
On 07/25/2014 05:21 PM, Jakub Jelinek wrote: On Fri, Jul 25, 2014 at 04:41:08PM -0400, Jason Merrill wrote: On 07/04/2014 04:47 PM, Jakub Jelinek wrote: (ubsan_expand_null_ifn): ...take type from ckind argument's type rather than first argument. Why? It looks like they have

Re: [PATCH] -fsanitize=alignment support

2014-07-25 Thread Jakub Jelinek
On Fri, Jul 25, 2014 at 04:41:08PM -0400, Jason Merrill wrote: > On 07/04/2014 04:47 PM, Jakub Jelinek wrote: > > (ubsan_expand_null_ifn): ...take type from ckind argument's type rather > > than > > first argument. > > Why? It looks like they have the same type with your patch, and then

Re: [PATCH] -fsanitize=alignment support

2014-07-25 Thread Jason Merrill
On 07/04/2014 04:47 PM, Jakub Jelinek wrote: (ubsan_expand_null_ifn): ...take type from ckind argument's type rather than first argument. Why? It looks like they have the same type with your patch, and then you need to convert ckind back to unsigned char. Jason

[PATCH] -fsanitize=alignment support

2014-07-04 Thread Jakub Jelinek
Hi! This patch adds -fsanitize=alignment support, part of -fsanitize=undefined, which will complain about misaligned accesses (those where the compiler isn't told it is less than naturally aligned access, such as with packed struct accesses). In addition to that it adds instrumentation of referenc