This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[Patch, fortran] PR31564 - Error: Type/rank mismatch in argument


:ADDPATCH fortran:

This PR arises from the behaviour of gfc_simplify_expr, when faced
with a variable array reference to a component of a derived type
parameter.  Such references to parameter arrays are separated off as
variable expressions in gfc_match_rvalue and the solution in this case
is to do the same.  The patch does not check for variable references
and so treats all array references in the same way.  This could be
changed but I have seen no need to do so.

A slight wrinkle is that references to use associated derived type
references fail to find an external link with the mangled name.  This
has been dealt with by resetting attr.use_assoc and setting
sym->module to NULL.

The testcase is basically the contributors.

Bootstrapped and regtested on x86_ia64/FC5 - OK for trunk?

Paul

2007-09-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/31564
	* primary.c (gfc_match_rvalue): Make expressions that refer
	to derived type parameters that have array references into
	variable expressions.  Remove references to use association
	from the symbol.

2007-09-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/31564
	* gfortran.dg/derived_comp_array_ref_2.f90: New test.

Attachment: pr31564.diff
Description: Binary data


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