[FORTRAN PATCH] Consider suitable derived types copyable

Brooks Moses brooks.moses@codesourcery.com
Thu Jan 18 02:53:00 GMT 2007


Roger Sayle wrote:
> The trick is to use the same logic as in gfc_trans_scalar_assign, and
> check the ts.derived->alloc_comp field, which indicates whether the type
> contains any allocatable fields that require special handling. Presumably,
> the front-end sets this field correctly for derived types containing
> derived types, otherwise both the existing gfc_trans_scalar_assign and the
> new code below contain potential bugs.  Likewise, for derived types
> containing character fields.

Huh -- we don't implement character fields in a way such that memcpy 
would work properly?  That seems sort of odd, since they're fixed legth, 
and so there's no obvious need to store them in an indirect fashion.

Meanwhile, I presume that this all works properly for derived types with 
pointer components?

- Brooks



More information about the Gcc-patches mailing list