This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Scalarization of subcomponent-references
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Daniel Kraft <d at domob dot eu>
- Cc: Mikael Morin <mikael dot morin at tele2 dot fr>, Tobias Burnus <burnus at net-b dot de>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Mon, 26 Jan 2009 20:50:45 +0100
- Subject: Re: Scalarization of subcomponent-references
- References: <497E080D.7060207@domob.eu>
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