[Patch, fortran] PR29422 and PR29428 - allocatable component wrinkles
Paul Thomas
paulthomas2@wanadoo.fr
Wed Oct 11 15:33:00 GMT 2006
:ADDPATCH fortran:
Well, these are the first, I suppose, of quite a few!
PR29422 is associated with the fact that resolve_transfer was not
checking functions for IO suitability; this applies to derived types
with pointer components, as well as allocatable, Try the testcase with
allocatable => pointer on gcc-4.2. The fix is easy; allow functions to
be tested as well as variables.
PR29428 concerns double calls to functions that result from a
nullifcation of the rhs of an assignment of a derived type with
allocatable components. It turns out that the nullify is unnecessary,
being a left-over from an early version of the allocatable component
patch, so the patch is to remove it. I discovered it whilst developing
a fix for PR29371; changing pointer=>allocatable resulted in four lines
of output, instead of three!
Both the testcases are those submitted by the reporters.
Dominique d'Humieres has pointed out to me that the arrays need to be
normalised so that lbound is one, rather than for example, copying the
array bounds of constructor elements. This is a rather substantial
change, since it will hit various testcases too. I will not hurry to
fix this because we have survived until the 9th of this month with
incorrectly normalised bounds all over the place (PR29391). However, I
will try to get it sorted on the timescale of a week. Dominique, would
you be so kind as to submit a PR for this, please?
Regtested on AMD64/Cygwin_NT - OK for trunk?
Paul
2006-10-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29422
* resolve.c (resolve_transfer): Test functions for suitability
for IO, as well as variables.
PR fortran/29428
* trans-expr.c (gfc_trans_scalar_assign): Remove nullify of
rhs expression.
2006-10-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29422
* gfortran.dg/alloc_comp_constraint_4.f90: New test.
PR fortran/29428
* gfortran.dg/alloc_comp_assign_5.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr29422.diff
Type: text/x-patch
Size: 1823 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061011/2ef8770c/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Change.Logs
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061011/2ef8770c/attachment.ksh>
More information about the Fortran
mailing list