Re: [PATCH] Add UBSAN_{PTR,BOUNDS} folding (PR sanitizer/81981, take 2)

2017-09-02 Thread Richard Biener
On September 1, 2017 10:28:16 PM GMT+02:00, Jakub Jelinek wrote: >On Fri, Sep 01, 2017 at 07:10:51PM +0200, Richard Biener wrote: >> OK, I thought we have one. Can you add a helper for it please? >> replace_with_nop or so? I thought there's maybe replace_with_value >which >> handles null lhs b

[PATCH] Add UBSAN_{PTR,BOUNDS} folding (PR sanitizer/81981, take 2)

2017-09-01 Thread Jakub Jelinek
On Fri, Sep 01, 2017 at 07:10:51PM +0200, Richard Biener wrote: > OK, I thought we have one. Can you add a helper for it please? > replace_with_nop or so? I thought there's maybe replace_with_value which > handles null lhs by replacing with nop. (can't check, writing from phone) Actually, you'

Re: [PATCH] Add UBSAN_{PTR,BOUNDS} folding (PR sanitizer/81981)

2017-09-01 Thread Richard Biener
On September 1, 2017 3:53:28 PM GMT+02:00, Jakub Jelinek wrote: >On Fri, Sep 01, 2017 at 02:32:43PM +0200, Richard Biener wrote: >> On September 1, 2017 1:16:54 PM GMT+02:00, Jakub Jelinek > wrote: >> >Hi! >> > >> >This patch fixes the following testcase by folding some ubsan >internal >> >fns >>

Re: [PATCH] Add UBSAN_{PTR,BOUNDS} folding (PR sanitizer/81981)

2017-09-01 Thread Jakub Jelinek
On Fri, Sep 01, 2017 at 02:32:43PM +0200, Richard Biener wrote: > On September 1, 2017 1:16:54 PM GMT+02:00, Jakub Jelinek > wrote: > >Hi! > > > >This patch fixes the following testcase by folding some ubsan internal > >fns > >we'd either remove anyway during sanopt, or lower into if (cond) > >do

Re: [PATCH] Add UBSAN_{PTR,BOUNDS} folding (PR sanitizer/81981)

2017-09-01 Thread Richard Biener
On September 1, 2017 1:16:54 PM GMT+02:00, Jakub Jelinek wrote: >Hi! > >This patch fixes the following testcase by folding some ubsan internal >fns >we'd either remove anyway during sanopt, or lower into if (cond) >do_something during sanopt where cond would be always false. > >Additionally, I've

[PATCH] Add UBSAN_{PTR,BOUNDS} folding (PR sanitizer/81981)

2017-09-01 Thread Jakub Jelinek
Hi! This patch fixes the following testcase by folding some ubsan internal fns we'd either remove anyway during sanopt, or lower into if (cond) do_something during sanopt where cond would be always false. Additionally, I've tried to clean up a little bit IFN_UBSAN_OBJECT_SIZE handling by using va