Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-12 Thread Andreas Schwab
On Jul 11 2017, Maxim Ostapenko wrote: > Ok, I see, it seems that we need to add convert in > expand_asan_emit_allocas_unpoison too. This patch seems to work for me on > aarch64 -mabi=ilp32, could you check it as well? This fixes all regressions. Andreas. -- Andreas

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-11 Thread Maxim Ostapenko
On 11/07/17 17:56, Andreas Schwab wrote: On Jul 11 2017, Maxim Ostapenko wrote: diff --git a/gcc/builtins.c b/gcc/builtins.c index 608993a..6437979 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4976,9 +4976,7 @@ expand_asan_emit_allocas_unpoison (tree exp)

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-11 Thread Andreas Schwab
On Jul 11 2017, Maxim Ostapenko wrote: > diff --git a/gcc/builtins.c b/gcc/builtins.c > index 608993a..6437979 100644 > --- a/gcc/builtins.c > +++ b/gcc/builtins.c > @@ -4976,9 +4976,7 @@ expand_asan_emit_allocas_unpoison (tree exp) >

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-11 Thread Maxim Ostapenko
On 11/07/17 16:51, Andreas Schwab wrote: On Jul 10 2017, Maxim Ostapenko wrote: diff --git a/gcc/asan.c b/gcc/asan.c index 95004d7..89c2731 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1567,9 +1567,10 @@ asan_emit_allocas_unpoison (rtx top, rtx bot, rtx_insn *before)

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-11 Thread Andreas Schwab
On Jul 10 2017, Maxim Ostapenko wrote: > diff --git a/gcc/asan.c b/gcc/asan.c > index 95004d7..89c2731 100644 > --- a/gcc/asan.c > +++ b/gcc/asan.c > @@ -1567,9 +1567,10 @@ asan_emit_allocas_unpoison (rtx top, rtx bot, rtx_insn > *before) >else > start_sequence

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-10 Thread Maxim Ostapenko
Hi Andreas, On 08/07/17 21:48, Andreas Schwab wrote: This breaks gcc.dg/asan/pr80168.c on aarch64 -mabi=ilp32: /opt/gcc/gcc-20170708/gcc/testsuite/gcc.dg/asan/pr80168.c:7:1: internal compiler error: in emit_library_call_value_1, at calls.c:4555 0x701577 emit_library_call_value_1

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-07-08 Thread Andreas Schwab
This breaks gcc.dg/asan/pr80168.c on aarch64 -mabi=ilp32: /opt/gcc/gcc-20170708/gcc/testsuite/gcc.dg/asan/pr80168.c:7:1: internal compiler error: in emit_library_call_value_1, at calls.c:4555 0x701577 emit_library_call_value_1 ../../gcc/calls.c:4554 0x7068d7

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-06-16 Thread Richard Biener
On Wed, 14 Jun 2017, Jakub Jelinek wrote: > Hi! > > So, I've tried to look at > struct __attribute__((aligned (N))) S { char s[N]; }; > > void bar (struct S *, struct S *); > > void > foo (int x) > { > struct S a; > { > struct S b[x]; > bar (, [0]); > } > { > struct S b[x +

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-06-14 Thread Jakub Jelinek
Hi! So, I've tried to look at struct __attribute__((aligned (N))) S { char s[N]; }; void bar (struct S *, struct S *); void foo (int x) { struct S a; { struct S b[x]; bar (, [0]); } { struct S b[x + 4]; bar (, [0]); } } void baz (int x) { struct S a; struct S

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-06-14 Thread Maxim Ostapenko
Hi Jakub, thank you for your points. I've updated the patch. -Maxim gcc/ChangeLog: 2017-06-14 Maxim Ostapenko * asan.c: Include gimple-fold.h. (get_last_alloca_addr): New function. (handle_builtin_stackrestore): Likewise. (handle_builtin_alloca): Likewise.

Re: [PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-06-13 Thread Jakub Jelinek
On Tue, Jun 13, 2017 at 03:11:41PM +0300, Maxim Ostapenko wrote: > @@ -531,11 +533,166 @@ get_mem_ref_of_assignment (const gassign *assignment, >return true; > } > > +/* Return address of last allocated dynamic alloca. */ > + > +static tree > +get_last_alloca_addr () > +{ > + if

[PING^3][RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.​

2017-06-13 Thread Maxim Ostapenko
Hi, I would like to ping the following patch: https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01374.html Rebased version is attached. Thanks, -Maxim gcc/ChangeLog: 2017-06-13 Maxim Ostapenko * asan.c: Include gimple-fold.h. (get_last_alloca_addr): New function.