On Thu, Oct 16, 2014 at 12:43:25PM +0400, Yury Gribov wrote: > Not a backport, specifically enables said instructions in KASan.
> Instrument unaligned objects in KASan. > > 2014-10-15 Yury Gribov <y.gri...@samsung.com> > > * asan.c (instrument_derefs): Enable unaligned path for KASan. > > diff --git a/gcc/asan.c b/gcc/asan.c > index b8fbed3..db4e3a0 100644 > --- a/gcc/asan.c > +++ b/gcc/asan.c > @@ -1705,8 +1705,11 @@ instrument_derefs (gimple_stmt_iterator *iter, tree t, > } > > size_in_bytes = int_size_in_bytes (type); > - if ((size_in_bytes & (size_in_bytes - 1)) != 0 > - || (unsigned HOST_WIDE_INT) size_in_bytes - 1 >= 16) > + if (size_in_bytes <= 0) > + return; > + if ((flag_sanitize & SANITIZE_USER_ADDRESS) != 0 > + && ((size_in_bytes & (size_in_bytes - 1)) != 0 > + || (unsigned HOST_WIDE_INT) size_in_bytes - 1 >= 16)) > return; > > HOST_WIDE_INT bitsize, bitpos; Ok. Jakub