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: Scalarization of subcomponent-references


Hi Daniel,

> With the program above, this code is run with the "A(1:N2)%I" expression and
> the debugger confirms that "e" is really this expression in gfortran's
> internal tree format.  However, parmse.expr (which is used to initialize the
> allocated temporary for the INTENT(INOUT) argument) is simply "&parmse.0" of
> type "struct array1_unseq*".  I would expect it to be of type integer array
> instead of record array (and this is also what leads to the ICE later on)!
>  What's wrong here with my understanding?

Nothing - just think what the consequences are if the derived type has
more components.

I fixed the same problem in function calls with (trans-expr.c):

(/* Returns a reference to a temporary array into which a component of
   an actual argument derived type array is copied and then returned
   after the function call.  */
void
gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr,
			   int g77, sym_intent intent)

This should be deployed here by copying an indirect reference to
se->expr to the temporary ss.  I was having a look at this at
lunchtime today, as it happens.  I'll take it a little bit further
tonight, if you like?

Cheers

Paul


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