This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gomp merge] Fortran FE changes from gomp branch not dependent on OpenMP
On Wed, Jan 18, 2006 at 08:57:20PM +0000, Paul Brook wrote:
> > Ensure that whenever possible (i.e. with the exception of assumed size
> > arrays) all ARRAY_TYPEs passed to the middle-end have complete types.
> > Currently, if the arrays (or CHARACTER vars/params or arrays of CHARACTER)
> > have constant length, they are complete, but otherwise they have usually
> > incomplete type, no TYPE_SIZE{,_UNIT}, no upper bound on TYPE_DOMAIN, etc.
> > While gfortran could sort of live without it till now, OpenMP handling in
> > the middle-end relies on the types and decls to be complete, so that it
> > can privatize them.
>
> Are you sure you're doing the right thing with assumed shape arrays? These may
> be discontiguous. To fix this properly we probably need to avoid flattening
> arrays.
For assumed-shape if they are discontiguous, the ARRAY_TYPE just spans even
the wholes. There are many tests in libgomp/testsuite/libgomp.fortran/,
several of them include assumed shape array privatization etc. and all of
them pass.
> > often creates temporary variables when converting front-end trees to
> > GENERIC trees and furthermore many of the sizes depend on the value
> > of other variables, initialized during gfc_trans_deferred_vars.
> > So a part of my patch (gfc_trans_vla_type_sizes and its callers)
> > "gimplifies" TYPE_DOMAIN and TYPE_SIZE* by hand at the point in
> > gfc_trans_deferred_vars when the variables it uses are already
> > initialized.
>
> Hmm, ok. I'm not sure using "gimplicifation" to describe this is a good idea
> though.
I used that term just because gfc_trans_vla_type_sizes is essentially
a simplified gimplify_type_sizes. The only place I used that term is
in the ChangeLog entry though.
Jakub