Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-27 Thread Richard Biener
On Fri, 27 May 2016, Jan Hubicka wrote: > Hi, > this is version of patch which bootstrap all languages at x86_64. OK? The tree-pretty-print.c change is ok. I think the > - if (stride) > + if (stride && akind >= GFC_ARRAY_ALLOCATABLE) should include a comment. Richard. > Honza > > *

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-27 Thread Jan Hubicka
Hi, this is version of patch which bootstrap all languages at x86_64. OK? Honza * trans-types.c (gfc_array_range_type): Remove. (gfc_init_types): Do not build gfc_array_range_type. (gfc_get_array_type_bounds): Do not put unrealistic array bounds. * trans-types.h

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Jan Hubicka
> As said I'd simply use NULL TYPE_MAX_VALUE, not drop TYPE_DOMAIN > completely (yes, NULL TYPE_DOMAIN is equal to [0:] so we can as well > print that - as you say, not sure what else breaks with that ;)) NULL TYPE_MAX_VALUE was used by my previous patch, because it used gfc_array_range_type

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Richard Biener
On Tue, 24 May 2016, Jan Hubicka wrote: > Hi, > I tried the attached patch that gets rid of gfc_array_range_type because it > seems pointless from middle-end POV. It however affects .original dumps in the > following way: > --- assumed_type_2.f90.003t.original2016-05-24 14:32:45.771503552

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Jan Hubicka
Hi, I tried the attached patch that gets rid of gfc_array_range_type because it seems pointless from middle-end POV. It however affects .original dumps in the following way: --- assumed_type_2.f90.003t.original2016-05-24 14:32:45.771503552 +0200 +++ ../assumed_type_2.f90.003t.original

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Jan Hubicka
> > Hmm, you are probably right. If we can have array with TYPE_DOMAIN != NULL > > and sane bounds, but with TYPE_SIZE == NULL, we probably need to punt on > > NULL > > TYPE_SIZE. I can add it just to be sure. > > As a MEM_REF embeds a VIEW_CONVERT you can placement-new > > struct { int a[5];

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Richard Biener
On Tue, 24 May 2016, Jan Hubicka wrote: > > > > Ah, yes. Now I see. > > > > > The test I updated that looks for DECL simply assumes > > > that declarations can not be accessed past their end. > > > It would make more sense to use object size machinery here somehow. > > > (i.e. even in fortran

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Jan Hubicka
> > Ah, yes. Now I see. > > > The test I updated that looks for DECL simply assumes > > that declarations can not be accessed past their end. > > It would make more sense to use object size machinery here somehow. > > (i.e. even in fortran we have accesses to mallocated buffers of constant >

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Richard Biener
On Tue, 24 May 2016, Jan Hubicka wrote: > > > - if (stride) > > > + if (stride && akind >= GFC_ARRAY_ALLOCATABLE) > > > rtype = build_range_type (gfc_array_index_type, gfc_index_zero_node, > > > int_const_binop (MINUS_EXPR, stride, > > >

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Jan Hubicka
> > - if (stride) > > + if (stride && akind >= GFC_ARRAY_ALLOCATABLE) > > rtype = build_range_type (gfc_array_index_type, gfc_index_zero_node, > > int_const_binop (MINUS_EXPR, stride, > >build_int_cst (TREE_TYPE

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-24 Thread Richard Biener
On Mon, 23 May 2016, Jan Hubicka wrote: > > > > The assert below is unnecessary btw - it is ensured by IL checking. > I removed the assert but had to add a check that sizes match. As sported by > the > testsuite, the declaration size doesn't need to match the size of object that > we > see. >

[fortran] Re: Make array_at_struct_end_p to grok MEM_REFs

2016-05-23 Thread Jan Hubicka
> > The assert below is unnecessary btw - it is ensured by IL checking. I removed the assert but had to add a check that sizes match. As sported by the testsuite, the declaration size doesn't need to match the size of object that we see. > > Rather than annotating an ARRAY_REF I'd have FEs