This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [FORTRAN PATCH] Consider suitable derived types copyable


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]