Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access

2020-06-08 Thread Jakub Jelinek via Gcc-patches
On Thu, Jun 04, 2020 at 01:52:53PM +0200, Richard Biener wrote: > * g++.dg/torture/pr95493.C: New testcase. > +using K [[gnu::vector_size(16)]] = int; ... > +int a = [](K y) { > + for (int j = 0; j < 4; ++j) > +if (y[j] != 0) > + return j; > +

Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access

2020-06-05 Thread Richard Biener
On June 5, 2020 6:38:10 PM GMT+02:00, Eric Botcazou wrote: >> I've installed it on trunk but will give it quite a while there >before >> backporting. I'm still somewhat worried about the >> >> /* ??? If we end up with a constant or a descriptor do not >> record a MEM_EXPR. */ >

Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access

2020-06-05 Thread Eric Botcazou
> I've installed it on trunk but will give it quite a while there before > backporting. I'm still somewhat worried about the > > /* ??? If we end up with a constant or a descriptor do not > record a MEM_EXPR. */ > else if (CONSTANT_CLASS_P (t) > >|| TREE_CO

Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access

2020-06-05 Thread Richard Biener
On Fri, 5 Jun 2020, Eric Botcazou wrote: > > The patch ends up recording the whole Array ref with variable index. All > > alias analysis code deals with this just fine. IIRC historically we tried > > to save memory with stripping and dropping of MEM_EXPRs. > > OK, I agree that the cleanup makes s

Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access

2020-06-05 Thread Eric Botcazou
> The patch ends up recording the whole Array ref with variable index. All > alias analysis code deals with this just fine. IIRC historically we tried > to save memory with stripping and dropping of MEM_EXPRs. OK, I agree that the cleanup makes sense these days and can probably also be backported

Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access

2020-06-04 Thread Richard Biener via Gcc-patches
On June 4, 2020 6:20:36 PM GMT+02:00, Eric Botcazou wrote: >> I'll go with this variant since it is more obvious unless I hear >> otherwise. > >Yes, at least this one doesn't appear to further confuse an already >confusing >implementation. ;-) > >> Thanks, >> Richard. >> >> >> The following pa

Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access

2020-06-04 Thread Eric Botcazou
> I'll go with this variant since it is more obvious unless I hear > otherwise. Yes, at least this one doesn't appear to further confuse an already confusing implementation. ;-) > Thanks, > Richard. > > > The following patch avoids keeping the inherited MEM_ATTRS when > set_mem_attributes_minu