Scalarization of subcomponent-references
Daniel Kraft
d@domob.eu
Mon Jan 26 20:54:00 GMT 2009
Paul Richard Thomas wrote:
> 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?
Thanks for the help and offer! I tried to incorporate
gfc_conv_subref_array_arg into the code as you suggested (if I got it
correctly), but unfortunatelly this failed because the subcomponent
reference is processed by the caller of gfc_conv_elemental_dependencies
which then tried to add ".i" to the already integer temporary...
I think however that I got a patch working, see details in my mail to be
posted... It is not the best solution, but I hope it at least works and
gets the regression right.
Yours,
Daniel
--
Done: Arc-Bar-Cav-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran
More information about the Fortran
mailing list