This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: semi-patch for pr 20845
On Sat, Jan 28, 2006 at 07:49:46AM +0100, Paul Thomas wrote:
> >This appears to work with detecting the missing SAVE, but there are a
> >few test suite regressions. First, my patch suggest that der_pointer_4.f90
> >is invalid code and I've verified this via Lahey's code checker. The
> >regressions are derived_recursion.f90, host_used_types_1.f90,
> >used_dummy_types_1.f90, used_dummy_types_4.f90, used_types_1.f90, and
> >defined_types_2.f90. I don't see why my patch is causing the regression,
> >so I'm hoping that someone (pault, tobi?) has some insight.
> >
> The patch never tests if there is a default initializer coming and so
> catches all module derived types. Without having tried it, I think you
> need to do the likes of:
>
> + if (sym->ts.type == BT_DERIVED && !(sym->value || flag)
> + constructor_expr = gfc_default_initializer (&sym->ts); /*decl
> needed somewhere*/
Yep. This appears to be the key. I was testing sym->value
under the assumption that the initialization was already
reduced to some value.
BTW, my patch exposes another problem with the now (in)famous
char_result_11.f90 tests.
I'll supply a patch and testcase later today. Need to run to
little league (ie kid's baseball).
--
Steve