Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-06 Thread Martin Sebor
This looks like an impressive improvement! FWIW, I've been meaning to look into similar opportunities mentioned in bug 79265. Hi. Thank you very much for feedback. If you want I can help with the PR? I belatedly realized I didn't answer one of your questions (or got an answer to one of mine :

Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-06 Thread Jakub Jelinek
On Fri, Oct 06, 2017 at 10:30:11AM -0600, Martin Sebor wrote: > I think that should work too. ptrdiff_t is usually the same size > as size_t. The two exceptions I could find are VMS and the M32C > target where size_t is always 32-bits wide but ptrdiff_t can be > 64-bits. I don't know what that m

Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-06 Thread Martin Sebor
On 10/06/2017 04:18 AM, Martin Liška wrote: On 10/05/2017 07:06 PM, Martin Sebor wrote: On 10/04/2017 03:05 AM, Martin Liška wrote: Hello. Following patch adds support for optimizing out unnecessary UBSAN_PTR checks. It handles separately positive and negative offsets, zero offset is ignored.

Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-06 Thread Martin Liška
On 10/05/2017 07:06 PM, Martin Sebor wrote: > On 10/04/2017 03:05 AM, Martin Liška wrote: >> Hello. >> >> Following patch adds support for optimizing out unnecessary UBSAN_PTR checks. >> It handles separately positive and negative offsets, zero offset is ignored. >> Apart from that, we utilize get_

Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-06 Thread Jakub Jelinek
On Thu, Oct 05, 2017 at 03:52:45PM +0200, Martin Liška wrote: > > Do you really need to handle offset != NULL_TREE? > > If the bit offset is representable in shwi, then it will just be > > in bitpos and offset will be NULL. > > For this: > UBSAN_PTR (&MEM[(void *)&b + 9223372036854775807B], 1); >

Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-05 Thread Martin Sebor
On 10/04/2017 03:05 AM, Martin Liška wrote: Hello. Following patch adds support for optimizing out unnecessary UBSAN_PTR checks. It handles separately positive and negative offsets, zero offset is ignored. Apart from that, we utilize get_inner_reference for local and global variables, that also

Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-05 Thread Martin Liška
On 10/04/2017 08:06 PM, Jakub Jelinek wrote: > On Wed, Oct 04, 2017 at 11:05:23AM +0200, Martin Liška wrote: >> Following patch adds support for optimizing out unnecessary UBSAN_PTR checks. >> It handles separately positive and negative offsets, zero offset is ignored. >> Apart from that, we utiliz

Re: [PATCH] Add sanopt support for UBSAN_PTR.

2017-10-04 Thread Jakub Jelinek
On Wed, Oct 04, 2017 at 11:05:23AM +0200, Martin Liška wrote: > Following patch adds support for optimizing out unnecessary UBSAN_PTR checks. > It handles separately positive and negative offsets, zero offset is ignored. > Apart from that, we utilize get_inner_reference for local and global > vari

[PATCH] Add sanopt support for UBSAN_PTR.

2017-10-04 Thread Martin Liška
Hello. Following patch adds support for optimizing out unnecessary UBSAN_PTR checks. It handles separately positive and negative offsets, zero offset is ignored. Apart from that, we utilize get_inner_reference for local and global variables, that also helps to reduce some. Some numbers: 1) postg