Re: [PATCH] Don't expand string/memory builtins if ASan is enabled.

2014-10-17 Thread Jakub Jelinek
On Fri, Oct 17, 2014 at 05:01:33PM +0400, Yury Gribov wrote: > On 10/17/2014 04:24 PM, Jakub Jelinek wrote: > >>+/* Returns TRUE if given FCODE corresponds to string or memory builtin > >>function. > >>+ */ > >>+ > >>+static inline bool > >>+is_memory_builtin (enum built_in_function fcode) > >>+{

Re: [PATCH] Don't expand string/memory builtins if ASan is enabled.

2014-10-17 Thread Yury Gribov
On 10/17/2014 04:24 PM, Jakub Jelinek wrote: +/* Returns TRUE if given FCODE corresponds to string or memory builtin function. + */ + +static inline bool +is_memory_builtin (enum built_in_function fcode) +{ + return fcode <= BUILT_IN_STRSTR && fcode >= BUILT_IN_BCMP; This is too fragile and u

Re: [PATCH] Don't expand string/memory builtins if ASan is enabled.

2014-10-17 Thread Jakub Jelinek
On Fri, Oct 17, 2014 at 03:45:52PM +0400, Maxim Ostapenko wrote: > Patch also changes logic in asan_mem_ref_hash updating. I eliminated memory > ref access size from hash computing, so all accesses for same memory > reference have the same hash. Updating of asan_mem_ref_hash occurs only if > new ac

[PATCH] Don't expand string/memory builtins if ASan is enabled.

2014-10-17 Thread Maxim Ostapenko
Hi, this patch disables string/memory builtin functions inlining if ASan is enabled. As described in my previous post (https://gcc.gnu.org/ml/gcc/2014-09/msg00020.html), this allow us to be sure that some dangerous builtins (strcpy, stpcpy, etc) will be handled correctly. Also, some redundant