This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PR25018 - ICE in parameter initialization - and PR25029 - assumed size pointer assignments
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: patch <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Wed, 14 Dec 2005 19:30:16 +0100
- Subject: Re: [Patch, fortran] PR25018 - ICE in parameter initialization - and PR25029 - assumed size pointer assignments
- References: <43A059E2.7070506@wanadoo.fr>
I have just noticed that in the course of cleaning up, updating and
reapplying my patches that this part is doubled up in the submitted
patch. Obviously, this will be corrected before committing.
Cheers
Paul
*************** gfc_check_pointer_assign (gfc_expr * lva
*** 1986,1991 ****
--- 2006,2051 ----
return FAILURE;
}
+ if (rvalue->symtree->n.sym
+ && rvalue->symtree->n.sym->as
+ && rvalue->symtree->n.sym->as->type == AS_ASSUMED_SIZE)
+ {
+ gfc_ref * ref;
+ int dim = 0;
+ int last = 0;
+ for (ref = rvalue->ref; ref; ref = ref->next)
+ if (ref->type == REF_ARRAY)
+ for (dim = 0;dim < ref->u.ar.as->rank; dim++)
+ last = ref->u.ar.end[dim] == NULL;
+ if (last)
+ {
+ gfc_error ("The upper bound in the last dimension of the "
+ "assumed_size array on the rhs of the pointer "
+ "assignment at %L must be set", &rvalue->where);
+ return FAILURE;
+ }
+ }
+