Re: [PATCH] PR fortran/59910 -- structure constructor in DATA statement

2015-11-18 Thread Steve Kargl
On Wed, Nov 18, 2015 at 11:23:21AM -0800, Steve Kargl wrote: > On Tue, Nov 17, 2015 at 05:01:42PM -0800, Steve Kargl wrote: > > On Tue, Nov 17, 2015 at 04:36:01PM -0800, Steve Kargl wrote: > > > On Wed, Nov 18, 2015 at 12:24:29AM +0100, Dominique d'Humières wrote: > > > > > ??? but I suspect gfc_re

Re: [PATCH] PR fortran/59910 -- structure constructor in DATA statement

2015-11-18 Thread Steve Kargl
On Tue, Nov 17, 2015 at 05:01:42PM -0800, Steve Kargl wrote: > On Tue, Nov 17, 2015 at 04:36:01PM -0800, Steve Kargl wrote: > > On Wed, Nov 18, 2015 at 12:24:29AM +0100, Dominique d'Humières wrote: > > > > ??? but I suspect gfc_reduce_init_expr() > > > > may be useful for PARAMETER statements as w

Re: [PATCH] PR fortran/59910 -- structure constructor in DATA statement

2015-11-18 Thread Jerry DeLisle
On 11/17/2015 12:34 PM, Steve Kargl wrote: > Here's what looks like a fairly simple patch, but it leads > to a question. Why does gfortran not try to reduce the > components in a structure constructor in general? I've > hidden the gfc_reduce_init_expr() behind a check for a > DATA statement, but

Re: [PATCH] PR fortran/59910 -- structure constructor in DATA statement

2015-11-17 Thread Steve Kargl
On Tue, Nov 17, 2015 at 04:36:01PM -0800, Steve Kargl wrote: > On Wed, Nov 18, 2015 at 12:24:29AM +0100, Dominique d'Humières wrote: > > > ??? but I suspect gfc_reduce_init_expr() > > > may be useful for PARAMETER statements as well (need to > > > check this!). > > > > As in the following test >

Re: [PATCH] PR fortran/59910 -- structure constructor in DATA statement

2015-11-17 Thread Steve Kargl
On Wed, Nov 18, 2015 at 12:24:29AM +0100, Dominique d'Humières wrote: > > ??? but I suspect gfc_reduce_init_expr() > > may be useful for PARAMETER statements as well (need to > > check this!). > > As in the following test > > module m > implicit none > type t > integer :: i >

Re: [PATCH] PR fortran/59910 -- structure constructor in DATA statement

2015-11-17 Thread Dominique d'Humières
> … but I suspect gfc_reduce_init_expr() > may be useful for PARAMETER statements as well (need to > check this!). As in the following test module m implicit none type t integer :: i end type t type(t), dimension(2), parameter :: a1 = (/ t(1), t(2) /) type(t), dimens

[PATCH] PR fortran/59910 -- structure constructor in DATA statement

2015-11-17 Thread Steve Kargl
Here's what looks like a fairly simple patch, but it leads to a question. Why does gfortran not try to reduce the components in a structure constructor in general? I've hidden the gfc_reduce_init_expr() behind a check for a DATA statement, but I suspect gfc_reduce_init_expr() may be useful for