Re: [PATCH v3][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-05 Thread Maxim Ostapenko
Ok, I've fixed comments (not sure the note about optimization is well-formatted) and moved replace_call_with_value. Looks better now? On 05/07/17 13:28, Jakub Jelinek wrote: Anyway, this is not a strong requirement, the most important is to fix the comments, then move the replace_call_with_valu

Re: [PATCH v3][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-05 Thread Jakub Jelinek
On Wed, Jul 05, 2017 at 01:19:27PM +0300, Maxim Ostapenko wrote: > But won't we need to replace all alloca uses manually in this case? E.g. to > change str.1_18 value to _27? > > str.1_18 = __builtin_alloca_with_align (_16, 256); > *str.1_18[index_19(D)] ={v} 49; > > to > > _26 = __builtin

Re: [PATCH v3][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-05 Thread Maxim Ostapenko
On 05/07/17 12:34, Jakub Jelinek wrote: On Wed, Jul 05, 2017 at 11:24:15AM +0300, Maxim Ostapenko wrote: + In general, can't we use new_sp as bot parameter because on some s/can't we/we can't/ + /* new_alloca = new_alloca_with_rz + align. */ + g = gimple_build_assign (make_ssa_name (ptr_

Re: [PATCH v3][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-05 Thread Jakub Jelinek
On Wed, Jul 05, 2017 at 11:24:15AM +0300, Maxim Ostapenko wrote: > + In general, can't we use new_sp as bot parameter because on some s/can't we/we can't/ > + /* new_alloca = new_alloca_with_rz + align. */ > + g = gimple_build_assign (make_ssa_name (ptr_type), POINTER_PLUS_EXPR, > +

[PATCH v3][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-05 Thread Maxim Ostapenko
Hi, this is a patch with fixed issues for previous review. Tested and bootstrapped on x86_64-unknown-linux-gnu and ppc64le-redhat-linux. Could you take a look? -Maxim gcc/ChangeLog: 2017-07-05 Maxim Ostapenko * asan.c: Include gimple-fold.h. (get_last_alloca_addr): New function. (handl