Re: malloc cannot alias preexisting pointers

2019-05-20 Thread Richard Biener
On Sat, May 18, 2019 at 2:56 PM Marc Glisse wrote: > > On Wed, 15 May 2019, Richard Biener wrote: > > > As you write the heuristic you could as well remove the malloc result > > points-to set from the others after points-to analysis is finished? > > Looking at the vector testcase: > > #include >

Re: malloc cannot alias preexisting pointers

2019-05-18 Thread Marc Glisse
On Wed, 15 May 2019, Richard Biener wrote: As you write the heuristic you could as well remove the malloc result points-to set from the others after points-to analysis is finished? Looking at the vector testcase: #include #include #include inline void* operator new(std::size_t n){return

Re: malloc cannot alias preexisting pointers

2019-05-15 Thread Richard Biener
On Tue, May 14, 2019 at 4:05 PM Marc Glisse wrote: > > On Tue, 14 May 2019, Richard Biener wrote: > > >>> In princple PTA should know the aliasing cannot happen but possibly > >>> the info is either lost or the IL is too obfuscated at the point it gets > >>> computed. (hello C++...) > >> > >> We

Re: malloc cannot alias preexisting pointers

2019-05-14 Thread Marc Glisse
On Tue, 14 May 2019, Richard Biener wrote: In princple PTA should know the aliasing cannot happen but possibly the info is either lost or the IL is too obfuscated at the point it gets computed. (hello C++...) We don't need much obfuscation for this, a simple C program int g; int*f(int**p){

Re: malloc cannot alias preexisting pointers

2019-05-14 Thread Richard Biener
On Mon, May 13, 2019 at 3:38 PM Marc Glisse wrote: > > On Mon, 13 May 2019, Richard Biener wrote: > > > On Sun, May 12, 2019 at 2:51 PM Marc Glisse wrote: > >> > >> On Sun, 12 May 2019, Richard Sandiford wrote: > >> > >>> Marc Glisse writes: > Hello, > > this patch lets gcc know

[V2] malloc cannot alias preexisting pointers

2019-05-13 Thread Marc Glisse
Here is a version of the patch with a cheaper test, and an extra testcase for Martin. (I kept the tree-ssa-loop-niter.c part although I am not using it anymore) 2019-05-15 Marc Glisse gcc/ * tree-ssa-loop-niter.c (stmt_dominates_stmt_p): Handle NULL basic block. *

Re: malloc cannot alias preexisting pointers

2019-05-13 Thread Martin Sebor
On 5/13/19 11:37 AM, Marc Glisse wrote: On Mon, 13 May 2019, Martin Sebor wrote: On 5/11/19 5:33 PM, Marc Glisse wrote: Hello, this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This is a bit ad hoc and fragile. A small

Re: malloc cannot alias preexisting pointers

2019-05-13 Thread Marc Glisse
On Mon, 13 May 2019, Martin Sebor wrote: On 5/11/19 5:33 PM, Marc Glisse wrote: Hello, this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This is a bit ad hoc and fragile. A small improvement would be, when the 2 statements

Re: malloc cannot alias preexisting pointers

2019-05-13 Thread Martin Sebor
On 5/13/19 10:49 AM, Jakub Jelinek wrote: On Mon, May 13, 2019 at 10:36:00AM -0600, Martin Sebor wrote: On 5/11/19 5:33 PM, Marc Glisse wrote: Hello, this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This is a bit ad hoc and

Re: malloc cannot alias preexisting pointers

2019-05-13 Thread Jakub Jelinek
On Mon, May 13, 2019 at 10:36:00AM -0600, Martin Sebor wrote: > On 5/11/19 5:33 PM, Marc Glisse wrote: > > Hello, > > > > this patch lets gcc know that if a pointer existed before the call to > > malloc, the result of malloc cannot alias it. This is a bit ad hoc and > > fragile. A small

Re: malloc cannot alias preexisting pointers

2019-05-13 Thread Martin Sebor
On 5/11/19 5:33 PM, Marc Glisse wrote: Hello, this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This is a bit ad hoc and fragile. A small improvement would be, when the 2 statements are in the same bb but in the wrong order,

Re: malloc cannot alias preexisting pointers

2019-05-13 Thread Marc Glisse
On Mon, 13 May 2019, Richard Biener wrote: On Sun, May 12, 2019 at 2:51 PM Marc Glisse wrote: On Sun, 12 May 2019, Richard Sandiford wrote: Marc Glisse writes: Hello, this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This

Re: malloc cannot alias preexisting pointers

2019-05-13 Thread Richard Biener
On Sun, May 12, 2019 at 2:51 PM Marc Glisse wrote: > > On Sun, 12 May 2019, Richard Sandiford wrote: > > > Marc Glisse writes: > >> Hello, > >> > >> this patch lets gcc know that if a pointer existed before the call to > >> malloc, the result of malloc cannot alias it. This is a bit ad hoc and >

Re: malloc cannot alias preexisting pointers

2019-05-12 Thread Marc Glisse
On Sun, 12 May 2019, Richard Sandiford wrote: Marc Glisse writes: Hello, this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This is a bit ad hoc and fragile. A small improvement would be, when the 2 statements are in the same

Re: malloc cannot alias preexisting pointers

2019-05-12 Thread Richard Sandiford
Marc Glisse writes: > Hello, > > this patch lets gcc know that if a pointer existed before the call to > malloc, the result of malloc cannot alias it. This is a bit ad hoc and > fragile. A small improvement would be, when the 2 statements are in the > same bb but in the wrong order, to check

Re: malloc cannot alias preexisting pointers

2019-05-11 Thread Marc Glisse
On Sun, 12 May 2019, Marc Glisse wrote: this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This is a bit ad hoc and fragile. A small improvement would be, when the 2 statements are in the same bb but in the wrong order, to check

malloc cannot alias preexisting pointers

2019-05-11 Thread Marc Glisse
Hello, this patch lets gcc know that if a pointer existed before the call to malloc, the result of malloc cannot alias it. This is a bit ad hoc and fragile. A small improvement would be, when the 2 statements are in the same bb but in the wrong order, to check if there is any statement in